载入中...
搜索中...
未找到
MarchingCubes.cpp
浏览该文件的文档.
519 marching.params.push_back(ParamDescriptor::floating("isolevel", "Iso Level", 0.f, -2.f, 2.f, 0.01f));
520 marching.params.push_back(ParamDescriptor::floating("scale", "Noise Scale", 1.f, 0.01f, 128.f, 0.01f));
547 rock.params.push_back(ParamDescriptor::floating("radius", "Radius", 0.72f, 0.05f, 32.f, 0.01f));
549 rock.params.push_back(ParamDescriptor::floating("variation", "Variation", 0.42f, 0.f, 1.f, 0.01f));
550 rock.params.push_back(ParamDescriptor::floating("angularity", "Angularity", 0.38f, 0.f, 1.f, 0.01f));
551 rock.params.push_back(ParamDescriptor::floating("erosion", "Erosion", 0.16f, 0.f, 0.45f, 0.01f));
558 planet.params.push_back(ParamDescriptor::floating("radius", "Radius", 1.f, 0.01f, 1000.f, 0.01f));
560 planet.params.push_back(ParamDescriptor::floating("tileInset", "Tile Inset", 0.06f, 0.f, 0.49f, 0.01f));
566 terrain.params.push_back(ParamDescriptor::floating("radius", "Hex Radius", 1.f, 0.05f, 64.f, 0.05f));
568 terrain.params.push_back(ParamDescriptor::floating("seaLevel", "Sea Level", 0.43f, 0.f, 1.f, 0.01f));
569 terrain.params.push_back(ParamDescriptor::floating("heightScale", "Height Scale", 4.f, 0.05f, 128.f, 0.05f));
572 terrain.params.push_back(ParamDescriptor::floating("vegetationDensity", "Vegetation Density", 1.f, 0.f, 2.f, 0.05f));
576 tree.params.push_back(ParamDescriptor::choice("style", "Style", "lowpoly", {"lowpoly", "realistic"}));
578 ParamDescriptor::choice("leafMode", "Leaf Mode", "cards", {"cards", "clusters", "canopy", "none"}));
579 tree.params.push_back(ParamDescriptor::choice("branchAlgorithm", "Branch Algorithm", "weberPenn",
582 tree.params.push_back(ParamDescriptor::floating("trunkRadius", "Trunk Radius", 0.33f, 0.02f, 10.f, 0.01f));
583 tree.params.push_back(ParamDescriptor::floating("crownRadius", "Crown Radius", 2.04f, 0.1f, 50.f, 0.05f));
584 tree.params.push_back(ParamDescriptor::floating("leafDensity", "Leaf Density", 0.65f, 0.f, 1.f, 0.01f));
634 addAdvanced(tree, ParamDescriptor::floating("clusterSize", "Cluster Size", 0.30f, 0.04f, 0.8f, 0.01f));
635 addAdvanced(tree, ParamDescriptor::floating("clusterLeafScale", "Cluster Leaf Scale", 0.85f, 0.1f, 3.f, 0.01f));
636 addAdvanced(tree, ParamDescriptor::floating("clusterSpacing", "Cluster Leaf Spacing", 0.80f, 0.25f, 3.f, 0.01f));
637 addAdvanced(tree, ParamDescriptor::floating("clusterSeparation", "Cluster Separation", 0.55f, 0.1f, 3.f, 0.01f));
638 addAdvanced(tree, ParamDescriptor::floating("clusterTilt", "Cluster Plane Tilt", 26.f, 0.f, 80.f, 1.f));
641 addAdvanced(tree, ParamDescriptor::integer("clusterLeaves", "Cluster Leaves Per Plane", 28, 1, 256));
648 ParamDescriptor::choice("leafMode", "Leaf Mode", "mixed", {"mixed", "cards", "blobs", "none"}));
652 bush.params.push_back(ParamDescriptor::floating("leafDensity", "Leaf Density", 0.62f, 0.f, 1.f, 0.01f));
653 bush.params.push_back(ParamDescriptor::floating("lobeScale", "Lobe Scale", 0.68f, 0.35f, 1.25f, 0.01f));
666 flower.params.push_back(ParamDescriptor::floating("height", "Height", 0.55f, 0.15f, 2.5f, 0.01f));
677 registerRecipe(std::move(flower), [](const Params ¶ms, MeshBuild &out, std::string &error) {
688 tower.params.push_back(ParamDescriptor::floating("baseWidth", "Base Width", 10.f, 0.5f, 500.f, 0.1f));
689 tower.params.push_back(ParamDescriptor::floating("baseDepth", "Base Depth", 10.f, 0.5f, 500.f, 0.1f));
690 tower.params.push_back(ParamDescriptor::floating("tierHeight", "Tier Height", 6.f, 0.5f, 100.f, 0.1f));
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:19
void addVertex(float px, float py, float pz, float nx, float ny, float nz, float u, float v)
Adds vertex.
Definition MeshBuild.cpp:33
void setMeta(const std::string &key, const std::string &value)
Sets the meta.
Definition MeshBuild.cpp:244
constexpr HexVec3 lerp(HexVec3 a, HexVec3 b, float t) noexcept
Linear interpolation between two positions.
Definition HexMetrics.h:51
Definition EvpackPointGraphLoader.h:12
void registerCableChainRopeRecipes(MeshRecipeRegistry ®istry)
Register mesh.cable / mesh.chain / mesh.rope mesh recipes.
Definition CableChainRope.cpp:278
bool generateHexPlanetMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build the dual of a subdivided icosahedron. The result is a closed planet made of hexagonal cells plu...
Definition MarchingCubes.cpp:159
void registerCastleMeshRecipe(MeshRecipeRegistry &r)
Register mesh.castle in the built-in mesh recipe registry.
Definition CastleMesh.cpp:221
bool generateBushMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a deterministic procedural small bush. Registered as the mesh.bush recipe.
Definition BushMesh.cpp:174
bool generateHexTerrainMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a deterministic, flat-top hexagonal continent mesh.
Definition HexTerrain.cpp:375
std::function< bool(const Params ¶ms, MeshBuild &out, std::string &error)> MeshRecipeFn
Definition MarchingCubes.h:38
void registerCaveMeshRecipe(MeshRecipeRegistry ®istry)
Register the deterministic three-dimensional limestone cave recipe.
Definition CaveMeshRecipe.cpp:10
void registerMeshDeformationGeometryRecipes(MeshRecipeRegistry ®istry)
Register the extended-plane and customizable hex-grid mesh recipes.
Definition MeshDeformationGeometry.cpp:129
bool marchingCubes(const float *density, int nx, int ny, int nz, float isolevel, MeshBuild &out, std::string *error)
Classic Marching Cubes (Lorensen & Cline) over a regular scalar volume. Density >= isolevel is treate...
Definition MarchingCubes.cpp:249
void registerLinearStructureRecipes(MeshRecipeRegistry ®istry)
Register all built-in linear structure mesh recipes into a registry.
Definition LinearStructure.cpp:283
bool generateTreeMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a deterministic procedural tree. Registered as the mesh.tree recipe.
Definition TreeMesh.cpp:487
eve::Result< void > generateFlowerMesh(const Params ¶ms, MeshBuild &out)
Build a small accent flower (stem + radial petals + centre).
Definition FlowerMesh.cpp:135
void registerPrototypePieceRecipes(MeshRecipeRegistry ®istry)
Register all prototype modules as prototype.* mesh recipes.
Definition PrototypeKit.cpp:326
void registerLSystemRecipes(MeshRecipeRegistry ®istry)
Register the mesh.lsystem grammar-based plant recipe.
Definition LSystemMesh.cpp:206
bool generateMarchingCubesMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build mesh from Params (field + resolution + isolevel).
Definition MarchingCubes.cpp:437
bool fillDensityField(const Params ¶ms, std::vector< float > &density, int &nx, int &ny, int &nz, std::string &error)
Fill a density volume from a named field recipe (sphere / noise / terrain / torus).
Definition MarchingCubes.cpp:341
bool generateRockMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a shared-vertex, deformed icosphere rock for economical game props.
Definition RockMesh.cpp:167
bool generateSkyscraperMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a deterministic procedural skyscraper. Registered as the mesh.skyscraper recipe.
Definition SkyscraperMesh.cpp:102
UI-independent metadata for one procedural recipe parameter.
Definition ParamSchema.h:14
Complete metadata and parameter schema shared by every procgen recipe family.
Definition ParamSchema.h:52
const ParamDescriptor * find(const std::string &key) const
Find one parameter descriptor by stable key.
Definition ParamSchema.cpp:85
std::vector< ParamDescriptor > params
Definition ParamSchema.h:56
void applyDefaults(Params ¶ms) const
Fill missing Params values from this schema.
Definition ParamSchema.cpp:91