Recipe for one stylized leaf cluster ("foliage card bundle"). 更多...
#include <FoliageCluster.h>
Public 属性 | |
| std::uint32_t | seed = 0 |
| RNG stream seed; the same seed and inputs reproduce the same leaves. | |
| float | centerX = 0.f |
| Cluster centre on X, in world units. | |
| float | centerY = 0.f |
| Cluster centre on Y, in world units. | |
| float | centerZ = 0.f |
| Cluster centre on Z, in world units. | |
| float | radius = 1.f |
| Cluster radius in world units; clamped to at least 1e-3. | |
| float | leafSize = 0.2f |
| Leaf length in world units; clamped to at least 1e-3. | |
| float | leafSpacing = 0.9f |
Blue-noise centre distance, in leafSize units. Larger values spread the leaves out (sparser, more see-through foliage). Clamped to at least 0.05. | |
| int | planes = 9 |
Leaf planes rotated around the cluster's Y axis; clamped to 1..24. | |
| int | capPlanes = 2 |
Near-horizontal planes that close the cluster's top and bottom. A pure ring of vertical planes leaves the poles empty. Clamped to 0..8. | |
| float | tiltDegrees = 26.f |
Maximum ring-plane tilt away from vertical, in degrees; clamped to 0..80. | |
| float | planeOffset = 0.18f |
Per-plane translation inside the cluster, in radius units; clamped to 0..0.6. | |
| float | planeScaleVariation = 0.14f |
Per-plane radius variation; clamped to 0..0.6. | |
| float | leafJitter = 0.16f |
Per-leaf offset along the plane normal, in radius units; clamped to 0..0.5. | |
| float | leafScaleVariation = 0.25f |
Leaf size variation as a fraction of leafSize; clamped to 0..0.6. | |
| int | maxLeavesPerPlane = 24 |
Hard cap on leaves per plane; clamped to 1..256. When it binds, the sampler widens the blue-noise distance instead of truncating, so the retained leaves stay evenly distributed. | |
| float | normalRounding = 1.f |
| Blend from the flat plane normal (0) to the cluster sphere normal (1). | |
| float | uvMin = 0.52f |
| Start of the foliage band in the shared tree/bush atlas, on U. | |
| float | uvMax = 1.f |
| End of the foliage band in the shared tree/bush atlas, on U. | |
| bool | doubleSided = true |
Emit both windings per leaf. The engine's mesh3d pipelines cull back faces unless a Material opts into two-sided rasterization, so foliage has to carry both windings. | |
详细描述
Recipe for one stylized leaf cluster ("foliage card bundle").
A cluster is a spherical volume filled with a handful of leaf planes. Each plane is a disk whose leaf centres come from a blue-noise (Poisson-disk) sampler, so the leaves stay evenly spread instead of clumping the way an independent per-leaf random draw does. Only leaf quads are emitted, which is the geometric equivalent of "leaves opaque, everything else transparent": the gaps between leaves cost no geometry, no blending and no sort order.
The planes are placed at stratified yaw angles around the cluster's Y axis with a small random tilt and offset, and vertex normals are transferred from the cluster sphere rather than taken from the leaf's own plane, so a bundle of flat cards still shades like a rounded mass of foliage.
在文件 FoliageCluster.h 第 24 行定义.
类成员变量说明
◆ capPlanes
| int eve::procgen::FoliageClusterDesc::capPlanes = 2 |
Near-horizontal planes that close the cluster's top and bottom. A pure ring of vertical planes leaves the poles empty. Clamped to 0..8.
在文件 FoliageCluster.h 第 49 行定义.
◆ centerX
| float eve::procgen::FoliageClusterDesc::centerX = 0.f |
Cluster centre on X, in world units.
在文件 FoliageCluster.h 第 28 行定义.
◆ centerY
| float eve::procgen::FoliageClusterDesc::centerY = 0.f |
Cluster centre on Y, in world units.
在文件 FoliageCluster.h 第 30 行定义.
◆ centerZ
| float eve::procgen::FoliageClusterDesc::centerZ = 0.f |
Cluster centre on Z, in world units.
在文件 FoliageCluster.h 第 32 行定义.
◆ doubleSided
| bool eve::procgen::FoliageClusterDesc::doubleSided = true |
Emit both windings per leaf. The engine's mesh3d pipelines cull back faces unless a Material opts into two-sided rasterization, so foliage has to carry both windings.
在文件 FoliageCluster.h 第 77 行定义.
◆ leafJitter
| float eve::procgen::FoliageClusterDesc::leafJitter = 0.16f |
Per-leaf offset along the plane normal, in radius units; clamped to 0..0.5.
在文件 FoliageCluster.h 第 57 行定义.
◆ leafScaleVariation
| float eve::procgen::FoliageClusterDesc::leafScaleVariation = 0.25f |
Leaf size variation as a fraction of leafSize; clamped to 0..0.6.
在文件 FoliageCluster.h 第 59 行定义.
◆ leafSize
| float eve::procgen::FoliageClusterDesc::leafSize = 0.2f |
Leaf length in world units; clamped to at least 1e-3.
在文件 FoliageCluster.h 第 36 行定义.
◆ leafSpacing
| float eve::procgen::FoliageClusterDesc::leafSpacing = 0.9f |
Blue-noise centre distance, in leafSize units. Larger values spread the leaves out (sparser, more see-through foliage). Clamped to at least 0.05.
在文件 FoliageCluster.h 第 42 行定义.
◆ maxLeavesPerPlane
| int eve::procgen::FoliageClusterDesc::maxLeavesPerPlane = 24 |
Hard cap on leaves per plane; clamped to 1..256. When it binds, the sampler widens the blue-noise distance instead of truncating, so the retained leaves stay evenly distributed.
在文件 FoliageCluster.h 第 65 行定义.
◆ normalRounding
| float eve::procgen::FoliageClusterDesc::normalRounding = 1.f |
Blend from the flat plane normal (0) to the cluster sphere normal (1).
在文件 FoliageCluster.h 第 67 行定义.
◆ planeOffset
| float eve::procgen::FoliageClusterDesc::planeOffset = 0.18f |
Per-plane translation inside the cluster, in radius units; clamped to 0..0.6.
在文件 FoliageCluster.h 第 53 行定义.
◆ planes
| int eve::procgen::FoliageClusterDesc::planes = 9 |
Leaf planes rotated around the cluster's Y axis; clamped to 1..24.
在文件 FoliageCluster.h 第 44 行定义.
◆ planeScaleVariation
| float eve::procgen::FoliageClusterDesc::planeScaleVariation = 0.14f |
Per-plane radius variation; clamped to 0..0.6.
在文件 FoliageCluster.h 第 55 行定义.
◆ radius
| float eve::procgen::FoliageClusterDesc::radius = 1.f |
Cluster radius in world units; clamped to at least 1e-3.
在文件 FoliageCluster.h 第 34 行定义.
◆ seed
| std::uint32_t eve::procgen::FoliageClusterDesc::seed = 0 |
RNG stream seed; the same seed and inputs reproduce the same leaves.
在文件 FoliageCluster.h 第 26 行定义.
◆ tiltDegrees
| float eve::procgen::FoliageClusterDesc::tiltDegrees = 26.f |
Maximum ring-plane tilt away from vertical, in degrees; clamped to 0..80.
在文件 FoliageCluster.h 第 51 行定义.
◆ uvMax
| float eve::procgen::FoliageClusterDesc::uvMax = 1.f |
End of the foliage band in the shared tree/bush atlas, on U.
在文件 FoliageCluster.h 第 71 行定义.
◆ uvMin
| float eve::procgen::FoliageClusterDesc::uvMin = 0.52f |
Start of the foliage band in the shared tree/bush atlas, on U.
在文件 FoliageCluster.h 第 69 行定义.
该结构体的文档由以下文件生成:
- src/modules/procgen/algorithms/FoliageCluster.h