Skip to main content

Class: ChunkRenderer

The world's chunk materials, keyed by bucket (makeChunkMaterialKey), and the shading inputs they read: uniforms (fog, sky, wind, water, clock, the far seam) and shaderLightingUniforms (the sun, its cascades, the water's look). Both are TSL nodes; hosts write node.value.

Constructors​

constructor​

• new ChunkRenderer(): ChunkRenderer

Returns​

ChunkRenderer

Properties​

materials​

• materials: Map<string, ChunkMaterial>


shaderLightingUniforms​

• shaderLightingUniforms: Object

Type declaration​

NameTypeDescription
ambientColorValueUniform<Color>-
bedCausticScaleValueUniform<1>0..1 scale on the caustic net seen on submerged faces from below.
cascadeSplit0ValueUniform<16>-
cascadeSplit1ValueUniform<48>-
cascadeSplit2ValueUniform<128>-
celestialDirectionValueUniform<Vector3>The celestial disc above the horizon as the sky box actually draws it (getVisibleDiscDirection): the sun by day, the moon by night, never clamped or tilted. Specular reflections read this, so the sun on the water sits under the sun in the sky.
directSunlightValueUniform<1>The share of the sun (the moon by night) that reaches the world as a direct beam, 0..1: 1 under a clear sky, falling as cloud veils the disc. What only a beam draws (glints on water, caustics, the disc seen through the surface from below) scales by it; diffuse daylight (sunlightIntensity) does not. A host with weather lowers it.
shadowBiasValueUniform<0.00018>-
shadowDebugModeValueUniform<0>-
shadowDepthPerBlockValueUniform<0>How much shadow-map depth one block toward the sun spans (cascade 0), for an entity measuring its own body in the map.
shadowMap0TextureNode<"vec4">-
shadowMap1TextureNode<"vec4">-
shadowMap2TextureNode<"vec4">-
shadowMatrix0ValueUniform<Matrix4>-
shadowMatrix1ValueUniform<Matrix4>-
shadowMatrix2ValueUniform<Matrix4>-
shadowNormalBiasValueUniform<0.0015>-
shadowSideFaceBiasScaleValueUniform<1>-
shadowSlopeBiasMinValueUniform<0.00012>-
shadowSlopeBiasScaleValueUniform<0.0012>-
shadowStrengthValueUniform<1>-
shadowTopFaceBiasScaleValueUniform<1>-
skyMiddleColorValueUniform<Color>-
skyTopColorValueUniform<Color>-
sunColorValueUniform<Color>-
sunDirectionValueUniform<Vector3>The shading light: held above a minimum elevation, tilted off the sun's plane, and blended toward the moon through twilight, so terrain shading and shadows stay readable at every hour. Not where the sun is drawn.
sunlightIntensityValueUniform<1>The sun's intensity as the sky gives it (the chunk set's own copy keeps a floor of 0.05): what entity shadows fade with at night.
waterAbsorptionValueUniform<1>-
waterFresnelStrengthValueUniform<0.5>-
waterLevelValueUniform<86>-
waterStreakStrengthValueUniform<0.1>-
waterTintValueUniform<Color>-

uniforms​

• uniforms: ChunkUniforms