载入中...
搜索中...
未找到
MarchingCubes.cpp
浏览该文件的文档.
345bool fillDensityField(const Params ¶ms, std::vector<float> &density, int &nx, int &ny, int &nz,
530 marching.params.push_back(ParamDescriptor::floating("isolevel", "Iso Level", 0.f, -2.f, 2.f, 0.01f));
531 marching.params.push_back(ParamDescriptor::floating("scale", "Noise Scale", 1.f, 0.01f, 128.f, 0.01f));
558 rock.params.push_back(ParamDescriptor::floating("radius", "Radius", 0.72f, 0.05f, 32.f, 0.01f));
560 rock.params.push_back(ParamDescriptor::floating("variation", "Variation", 0.42f, 0.f, 1.f, 0.01f));
561 rock.params.push_back(ParamDescriptor::floating("angularity", "Angularity", 0.38f, 0.f, 1.f, 0.01f));
562 rock.params.push_back(ParamDescriptor::floating("erosion", "Erosion", 0.16f, 0.f, 0.45f, 0.01f));
569 planet.params.push_back(ParamDescriptor::floating("radius", "Radius", 1.f, 0.01f, 1000.f, 0.01f));
571 planet.params.push_back(ParamDescriptor::floating("tileInset", "Tile Inset", 0.06f, 0.f, 0.49f, 0.01f));
577 terrain.params.push_back(ParamDescriptor::floating("radius", "Hex Radius", 1.f, 0.05f, 64.f, 0.05f));
579 terrain.params.push_back(ParamDescriptor::floating("seaLevel", "Sea Level", 0.43f, 0.f, 1.f, 0.01f));
580 terrain.params.push_back(ParamDescriptor::floating("heightScale", "Height Scale", 4.f, 0.05f, 128.f, 0.05f));
583 terrain.params.push_back(ParamDescriptor::floating("vegetationDensity", "Vegetation Density", 1.f, 0.f, 2.f, 0.05f));
587 tree.params.push_back(ParamDescriptor::choice("style", "Style", "lowpoly", {"lowpoly", "realistic"}));
589 ParamDescriptor::choice("leafMode", "Leaf Mode", "cards", {"cards", "clusters", "canopy", "none"}));
590 tree.params.push_back(ParamDescriptor::choice("branchAlgorithm", "Branch Algorithm", "weberPenn",
593 tree.params.push_back(ParamDescriptor::floating("trunkRadius", "Trunk Radius", 0.33f, 0.02f, 10.f, 0.01f));
594 addAdvanced(tree, ParamDescriptor::floating("trunkTipRatio", "Trunk Tip Radius Ratio", 0.10f, 0.03f, 0.4f, 0.01f));
595 addAdvanced(tree, ParamDescriptor::floating("trunkTaper", "Trunk Taper Profile", 0.85f, 0.5f, 2.f, 0.05f));
596 addAdvanced(tree, ParamDescriptor::floating("rootFlare", "Root Flare", 0.70f, 0.f, 1.5f, 0.05f));
597 addAdvanced(tree, ParamDescriptor::floating("rootFlareHeight", "Root Flare Height", 0.10f, 0.03f, 0.25f, 0.01f));
598 addAdvanced(tree, ParamDescriptor::floating("barkRelief", "Bark Relief", 0.04f, 0.f, 0.12f, 0.01f));
599 addAdvanced(tree, ParamDescriptor::floating("trunkNoise", "Trunk Surface Noise", 0.18f, 0.f, 0.35f, 0.01f));
600 addAdvanced(tree, ParamDescriptor::floating("trunkNoiseScale", "Trunk Noise Wavelength", 3.f, 1.f, 8.f, 0.1f));
602 addAdvanced(tree, ParamDescriptor::floating("trunkKnotStrength", "Trunk Knot Strength", 0.35f, 0.f, 0.6f, 0.01f));
603 addAdvanced(tree, ParamDescriptor::integer("surfaceSegments", "Stem Surface Segments", 64, 8, 192));
604 tree.params.push_back(ParamDescriptor::floating("crownRadius", "Crown Radius", 2.04f, 0.1f, 50.f, 0.05f));
605 tree.params.push_back(ParamDescriptor::floating("leafDensity", "Leaf Density", 0.65f, 0.f, 1.f, 0.01f));
655 addAdvanced(tree, ParamDescriptor::floating("clusterSize", "Cluster Size", 0.30f, 0.04f, 0.8f, 0.01f));
656 addAdvanced(tree, ParamDescriptor::floating("clusterLeafScale", "Cluster Leaf Scale", 0.85f, 0.1f, 3.f, 0.01f));
657 addAdvanced(tree, ParamDescriptor::floating("clusterSpacing", "Cluster Leaf Spacing", 0.80f, 0.25f, 3.f, 0.01f));
658 addAdvanced(tree, ParamDescriptor::floating("clusterSeparation", "Cluster Separation", 0.55f, 0.1f, 3.f, 0.01f));
659 addAdvanced(tree, ParamDescriptor::floating("clusterTilt", "Cluster Plane Tilt", 26.f, 0.f, 80.f, 1.f));
662 addAdvanced(tree, ParamDescriptor::integer("clusterLeaves", "Cluster Leaves Per Plane", 28, 1, 256));
669 ParamDescriptor::choice("leafMode", "Leaf Mode", "mixed", {"mixed", "cards", "clusters", "blobs", "none"}));
673 bush.params.push_back(ParamDescriptor::floating("leafDensity", "Leaf Density", 0.62f, 0.f, 1.f, 0.01f));
674 bush.params.push_back(ParamDescriptor::floating("lobeScale", "Lobe Scale", 0.68f, 0.35f, 1.25f, 0.01f));
682 addAdvanced(bush, ParamDescriptor::floating("twigRadius", "Twig Radius", 0.0264f, 0.001f, 2.4f, 0.001f));
685 addAdvanced(bush, ParamDescriptor::floating("stemSpread", "Basal Stem Spread", 0.22f, 0.02f, 0.45f, 0.01f));
686 addAdvanced(bush, ParamDescriptor::floating("branchingStart", "Branching Start", 0.14f, 0.08f, 0.55f, 0.01f));
687 addAdvanced(bush, ParamDescriptor::floating("branchCurve", "Branch Curve", 0.3f, 0.f, 0.6f, 0.01f));
689 ParamDescriptor::floating("branchRadiusFalloff", "Branch Radius Falloff", 0.5f, 0.3f, 0.7f, 0.01f));
691 addAdvanced(bush, ParamDescriptor::floating("foliageStart", "Foliage Start", 0.10f, 0.05f, 0.5f, 0.01f));
694 addAdvanced(bush, ParamDescriptor::floating("canopyNormalBlend", "Canopy Normal Blend", 0.45f, 0.f, 0.8f, 0.01f));
696 addAdvanced(bush, ParamDescriptor::integer("clusterLeaves", "Cluster Leaves Per Plane", 48, 1, 256));
701 splash.params.push_back(ParamDescriptor::floating("height", "Height", 2.4f, 0.2f, 20.f, 0.05f));
704 splash.params.push_back(ParamDescriptor::floating("flare", "Flare", 1.0f, 0.35f, 1.75f, 0.01f));
711 flower.params.push_back(ParamDescriptor::floating("height", "Height", 0.55f, 0.15f, 2.5f, 0.01f));
722 registerRecipe(std::move(flower), [](const Params ¶ms, MeshBuild &out, std::string &error) {
733 tower.params.push_back(ParamDescriptor::floating("baseWidth", "Base Width", 10.f, 0.5f, 500.f, 0.1f));
734 tower.params.push_back(ParamDescriptor::floating("baseDepth", "Base Depth", 10.f, 0.5f, 500.f, 0.1f));
735 tower.params.push_back(ParamDescriptor::floating("tierHeight", "Tier Height", 6.f, 0.5f, 100.f, 0.1f));
std::string getString(const char *key, const std::string &fallback={}) const
Returns the string.
Definition Json.cpp:428
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:20
constexpr HexVec3 lerp(HexVec3 a, HexVec3 b, float t) noexcept
Linear interpolation between two positions.
Definition HexMetrics.h:51
ForceVector add(ForceVector a, ForceVector b)
Definition ForceMath.h:13
Definition EvpackPointGraphLoader.h:12
void registerCabinetRecipe(MeshRecipeRegistry ®istry)
Register mesh.cabinet and its editor schema during single-threaded initialization.
Definition Cabinet.cpp:119
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:163
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:253
bool generateHexTerrainMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a deterministic, flat-top hexagonal continent mesh.
Definition HexTerrain.cpp:373
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:253
EVENGINE_API_DOMAINS void registerVesselRecipes(MeshRecipeRegistry ®istry)
Register pottery recipes at initialization on the registry owner thread.
Definition VesselRecipes.cpp:82
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:624
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 generateWaterSplashMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build deterministic clay-sheet crowns for a stylized water splash.
Definition WaterSplashMesh.cpp:95
bool generateMarchingCubesMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build mesh from Params (field + resolution + isolevel).
Definition MarchingCubes.cpp:442
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:345
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