载入中...
搜索中...
未找到
eve::procgen::Procgen类 参考

Procedural generation module. Phase A: runtime maps (semantic Grid2D → TileLayer). Phase B: runtime textures (ImageData / Texture). Phase C (partial): mesh recipes (Marching Cubes → MeshBuild / Mesh). Script: procgen <- eve.Procgen(); 更多...

#include <Procgen.h>

类 eve::procgen::Procgen 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Procgen)
 
 Procgen ()
 
 ~Procgen () override=default
 
ParamsnewParams ()
 
OutputSpecnewOutput ()
 
Grid2DnewGrid (int width, int height)
 
Grid2Dgenerate (const std::string &algorithmId, Params *params)
 
bool generateTo (const std::string &algorithmId, Params *params, OutputSpec *output)
 
bool applyToLayer (Grid2D *grid, const std::string &palette, map::TileLayer *layer)
 
void setPaletteGid (const std::string &palette, const std::string &semantic, int gid)
 
int getPaletteGid (const std::string &palette, const std::string &semantic) const
 
int getAlgorithmCount () const
 
std::string getAlgorithmId (int index) const
 
bool hasAlgorithm (const std::string &algorithmId) const
 
bool autotileGrid (Grid2D *grid)
 Post-process a generated grid: fill each wall cell's detail with an 8-bit neighbour mask (autotile directions). Mutates grid in place.
 
uint32_t randomSeed ()
 Fresh non-zero seed for regenerating a level.
 
std::string lastError () const
 
std::string gridToJson (Grid2D *grid) const
 
image::ImageDatagenerateImage (const std::string &recipeId, Params *params)
 RGBA8 ImageData (caller owns). Pixel-friendly recipes: tex.soil/stone/marble/water/sky_cloud.
 
image::ImageDatagenerateNormalImage (const std::string &recipeId, Params *params)
 Normal map derived from albedo luminance (caller owns).
 
graphics::TexturegenerateTexture (const std::string &recipeId, Params *params, graphics::Graphics *gfx)
 Upload recipe to GPU. repeatU/V follow params "seamless" (default on). Caller owns Texture*.
 
int getTextureRecipeCount () const
 
std::string getTextureRecipeId (int index) const
 
bool hasTextureRecipe (const std::string &recipeId) const
 
CloudFieldnewCloudField ()
 New deterministic, tiling, time-animated cloud field (caller owns).
 
CloudShadownewCloudShadow ()
 New sun projection over a cloud field → ground shadows (caller owns).
 
float cloudCoverageAt (CloudField *field, float x, float z, float time)
 Cloud coverage at world (x, z) and time (via a CloudField).
 
float cloudShadowFactor (CloudShadow *shadow, float x, float z, float time)
 Light multiplier in [0,1] from a CloudShadow at world (x, z) and time.
 
void sampleCloud (CloudField *field, float *out, int w, int h, float time, float x0, float z0, float extent)
 
void sampleCloudShadow (CloudShadow *shadow, float *out, int w, int h, float time, float x0, float z0, float extent)
 
PbrTextureSetgeneratePbrMaterial (const std::string &recipeId, Params *params)
 Full metallic-roughness PBR set (albedo/normal/roughness/metallic/height/ao) derived from a single displacement field. Caller owns the returned set (call PbrTextureSet::destroy()). Recipes: pbr.soil/stone/rock/marble/water/ ripple/wood/cloth/ornament/spot/zebra/wall/cement/mud/sky_cloud.
 
int getPbrRecipeCount () const
 
std::string getPbrRecipeId (int index) const
 
bool hasPbrRecipe (const std::string &recipeId) const
 
MeshBuildbuildMesh (const std::string &recipeId, Params *params)
 CPU mesh (caller owns). Recipes: mesh.marchingcubes, mesh.hexplanet.
 
graphics::MeshgenerateMesh (const std::string &recipeId, Params *params, graphics::Graphics *gfx)
 Build + upload to GPU Mesh (owned by Graphics).
 
int getMeshRecipeCount () const
 
std::string getMeshRecipeId (int index) const
 
bool hasMeshRecipe (const std::string &recipeId) const
 
TerrainSamplernewTerrainSampler ()
 Sampling function over continuous map coordinates (caller owns).
 
HeightmapnewHeightmap (int width, int height)
 Empty in-memory heightmap (caller owns).
 
HeightmapgenerateHeightmap (Params *params)
 Build a sampler from params (seed/scale/octaves/…) and materialize it (caller owns).
 
bool heightmapToGrid (Heightmap *heightmap, Params *params, Grid2D *out)
 Classify a heightmap into a semantic Grid2D using params bands (waterMax…).
 
PaletteTablepalettes ()
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

详细描述

Procedural generation module. Phase A: runtime maps (semantic Grid2D → TileLayer). Phase B: runtime textures (ImageData / Texture). Phase C (partial): mesh recipes (Marching Cubes → MeshBuild / Mesh). Script: procgen <- eve.Procgen();

在文件 Procgen.h37 行定义.

构造及析构函数说明

◆ Procgen()

◆ ~Procgen()

eve::procgen::Procgen::~Procgen ( )
overridedefault

成员函数说明

◆ applyToLayer()

bool eve::procgen::Procgen::applyToLayer ( Grid2D grid,
const std::string &  palette,
map::TileLayer layer 
)

在文件 Procgen.cpp113 行定义.

引用了 eve::procgen::PaletteTable::applyToLayer() , 以及 layer.

被这些函数引用 generateTo().

◆ autotileGrid()

bool eve::procgen::Procgen::autotileGrid ( Grid2D grid)

Post-process a generated grid: fill each wall cell's detail with an 8-bit neighbour mask (autotile directions). Mutates grid in place.

在文件 Procgen.cpp145 行定义.

引用了 eve::procgen::autotileGridInPlace().

◆ buildMesh()

MeshBuild * eve::procgen::Procgen::buildMesh ( const std::string &  recipeId,
Params params 
)

CPU mesh (caller owns). Recipes: mesh.marchingcubes, mesh.hexplanet.

在文件 Procgen.cpp304 行定义.

引用了 generate(), eve::procgen::MeshRecipeRegistry::instance(), mesh , 以及 eve::procgen::MeshRecipeRegistry::registerBuiltins().

被这些函数引用 generateMesh().

◆ cloudCoverageAt()

float eve::procgen::Procgen::cloudCoverageAt ( CloudField field,
float  x,
float  z,
float  time 
)

Cloud coverage at world (x, z) and time (via a CloudField).

在文件 Procgen.cpp234 行定义.

引用了 eve::procgen::CloudField::coverageAt(), x , 以及 z.

◆ cloudShadowFactor()

float eve::procgen::Procgen::cloudShadowFactor ( CloudShadow shadow,
float  x,
float  z,
float  time 
)

Light multiplier in [0,1] from a CloudShadow at world (x, z) and time.

在文件 Procgen.cpp243 行定义.

引用了 eve::procgen::CloudShadow::shadowFactorAt(), x , 以及 z.

◆ generate()

Grid2D * eve::procgen::Procgen::generate ( const std::string &  algorithmId,
Params params 
)

在文件 Procgen.cpp72 行定义.

被这些函数引用 buildMesh().

◆ generateHeightmap()

Heightmap * eve::procgen::Procgen::generateHeightmap ( Params params)

Build a sampler from params (seed/scale/octaves/…) and materialize it (caller owns).

在文件 Procgen.cpp361 行定义.

引用了 eve::procgen::TerrainSampler::fromParams(), eve::procgen::Heightmap::generate(), eve::procgen::Params::getHeight() , 以及 eve::procgen::Params::getWidth().

◆ generateImage()

image::ImageData * eve::procgen::Procgen::generateImage ( const std::string &  recipeId,
Params params 
)

RGBA8 ImageData (caller owns). Pixel-friendly recipes: tex.soil/stone/marble/water/sky_cloud.

在文件 Procgen.cpp162 行定义.

引用了 eve::procgen::TextureRecipeRegistry::generate(), eve::procgen::TextureRecipeRegistry::instance() , 以及 eve::procgen::TextureRecipeRegistry::registerBuiltins().

被这些函数引用 generateNormalImage() , 以及 generateTexture().

◆ generateMesh()

◆ generateNormalImage()

image::ImageData * eve::procgen::Procgen::generateNormalImage ( const std::string &  recipeId,
Params params 
)

Normal map derived from albedo luminance (caller owns).

在文件 Procgen.cpp175 行定义.

引用了 albedo, generateImage(), eve::procgen::Params::getFloat(), eve::procgen::Params::getInt(), h, height, eve::procgen::heightToNormalImage(), px , 以及 w.

◆ generatePbrMaterial()

PbrTextureSet * eve::procgen::Procgen::generatePbrMaterial ( const std::string &  recipeId,
Params params 
)

Full metallic-roughness PBR set (albedo/normal/roughness/metallic/height/ao) derived from a single displacement field. Caller owns the returned set (call PbrTextureSet::destroy()). Recipes: pbr.soil/stone/rock/marble/water/ ripple/wood/cloth/ornament/spot/zebra/wall/cement/mud/sky_cloud.

在文件 Procgen.cpp272 行定义.

引用了 eve::procgen::PbrRecipeRegistry::generate(), eve::procgen::PbrRecipeRegistry::instance() , 以及 eve::procgen::PbrRecipeRegistry::registerPbrBuiltins().

◆ generateTexture()

graphics::Texture * eve::procgen::Procgen::generateTexture ( const std::string &  recipeId,
Params params,
graphics::Graphics gfx 
)

Upload recipe to GPU. repeatU/V follow params "seamless" (default on). Caller owns Texture*.

在文件 Procgen.cpp195 行定义.

引用了 generateImage(), eve::image::ImageData::getData(), eve::image::ImageData::getHeight(), eve::procgen::Params::getInt(), eve::image::ImageData::getWidth() , 以及 eve::graphics::Graphics::newTexture().

◆ generateTo()

bool eve::procgen::Procgen::generateTo ( const std::string &  algorithmId,
Params params,
OutputSpec output 
)

◆ getAlgorithmCount()

int eve::procgen::Procgen::getAlgorithmCount ( ) const

◆ getAlgorithmId()

std::string eve::procgen::Procgen::getAlgorithmId ( int  index) const

◆ getMeshRecipeCount()

int eve::procgen::Procgen::getMeshRecipeCount ( ) const

◆ getMeshRecipeId()

std::string eve::procgen::Procgen::getMeshRecipeId ( int  index) const

◆ getPaletteGid()

int eve::procgen::Procgen::getPaletteGid ( const std::string &  palette,
const std::string &  semantic 
) const

在文件 Procgen.cpp126 行定义.

引用了 eve::procgen::PaletteTable::getGid() , 以及 semantic.

◆ getPbrRecipeCount()

int eve::procgen::Procgen::getPbrRecipeCount ( ) const

◆ getPbrRecipeId()

std::string eve::procgen::Procgen::getPbrRecipeId ( int  index) const

◆ getTextureRecipeCount()

int eve::procgen::Procgen::getTextureRecipeCount ( ) const

◆ getTextureRecipeId()

std::string eve::procgen::Procgen::getTextureRecipeId ( int  index) const

◆ gridToJson()

std::string eve::procgen::Procgen::gridToJson ( Grid2D grid) const

在文件 Procgen.cpp157 行定义.

引用了 eve::procgen::gridToJson().

◆ hasAlgorithm()

bool eve::procgen::Procgen::hasAlgorithm ( const std::string &  algorithmId) const

◆ hasMeshRecipe()

bool eve::procgen::Procgen::hasMeshRecipe ( const std::string &  recipeId) const

◆ hasPbrRecipe()

bool eve::procgen::Procgen::hasPbrRecipe ( const std::string &  recipeId) const

◆ hasTextureRecipe()

bool eve::procgen::Procgen::hasTextureRecipe ( const std::string &  recipeId) const

◆ heightmapToGrid()

bool eve::procgen::Procgen::heightmapToGrid ( Heightmap heightmap,
Params params,
Grid2D out 
)

Classify a heightmap into a semantic Grid2D using params bands (waterMax…).

在文件 Procgen.cpp371 行定义.

引用了 eve::procgen::TerrainBands::fromParams() , 以及 eve::procgen::Heightmap::toGrid().

◆ lastError()

std::string eve::procgen::Procgen::lastError ( ) const

在文件 Procgen.cpp155 行定义.

◆ Module_REG()

eve::procgen::Procgen::Module_REG ( Procgen  )

◆ newCloudField()

CloudField * eve::procgen::Procgen::newCloudField ( )

New deterministic, tiling, time-animated cloud field (caller owns).

在文件 Procgen.cpp230 行定义.

◆ newCloudShadow()

CloudShadow * eve::procgen::Procgen::newCloudShadow ( )

New sun projection over a cloud field → ground shadows (caller owns).

在文件 Procgen.cpp232 行定义.

◆ newGrid()

Grid2D * eve::procgen::Procgen::newGrid ( int  width,
int  height 
)

在文件 Procgen.cpp56 行定义.

引用了 height , 以及 width.

◆ newHeightmap()

Heightmap * eve::procgen::Procgen::newHeightmap ( int  width,
int  height 
)

Empty in-memory heightmap (caller owns).

在文件 Procgen.cpp357 行定义.

引用了 height , 以及 width.

◆ newOutput()

OutputSpec * eve::procgen::Procgen::newOutput ( )

在文件 Procgen.cpp54 行定义.

◆ newParams()

Params * eve::procgen::Procgen::newParams ( )

在文件 Procgen.cpp53 行定义.

◆ newTerrainSampler()

TerrainSampler * eve::procgen::Procgen::newTerrainSampler ( )

Sampling function over continuous map coordinates (caller owns).

在文件 Procgen.cpp355 行定义.

◆ palettes()

PaletteTable & eve::procgen::Procgen::palettes ( )
inline

在文件 Procgen.h134 行定义.

◆ randomSeed()

uint32_t eve::procgen::Procgen::randomSeed ( )

Fresh non-zero seed for regenerating a level.

在文件 Procgen.cpp153 行定义.

引用了 eve::procgen::randomSeedValue().

◆ sampleCloud()

void eve::procgen::Procgen::sampleCloud ( CloudField field,
float *  out,
int  w,
int  h,
float  time,
float  x0,
float  z0,
float  extent 
)

Sample coverage/factor into a caller-owned float buffer (w*h).

在文件 Procgen.cpp252 行定义.

引用了 h, eve::procgen::CloudField::sample() , 以及 w.

◆ sampleCloudShadow()

void eve::procgen::Procgen::sampleCloudShadow ( CloudShadow shadow,
float *  out,
int  w,
int  h,
float  time,
float  x0,
float  z0,
float  extent 
)

在文件 Procgen.cpp262 行定义.

引用了 h, eve::procgen::CloudShadow::sampleCoverage() , 以及 w.

◆ setPaletteGid()

void eve::procgen::Procgen::setPaletteGid ( const std::string &  palette,
const std::string &  semantic,
int  gid 
)

在文件 Procgen.cpp122 行定义.

引用了 semantic , 以及 eve::procgen::PaletteTable::setGid().

被这些函数引用 Procgen().


该类的文档由以下文件生成: