Header menu logo Mibo

ShadowResources Type

Owns the shadow atlas + depth effect + pooled scratch the shadow pass needs, reused across frames. Constructed once by the pipeline; EnsureResources allocates the GPU atlas lazily against the real device on the first shadow pass.

Constructors

Constructor Description

ShadowResources(atlasCfg, biasCfg)

Full Usage: ShadowResources(atlasCfg, biasCfg)

Parameters:
Returns: ShadowResources
atlasCfg : ShadowAtlasConfig
biasCfg : ShadowBiasConfig
Returns: ShadowResources

Instance members

Instance member Description

this.Atlas

Full Usage: this.Atlas

Returns: ShadowAtlas

The shadow atlas (owns the R32F RenderTarget2D, allocated lazily).

Returns: ShadowAtlas

this.BiasesScratch

Full Usage: this.BiasesScratch

Pooled scratch for the per-caster shadowBiases upload (receiver-side depth bias). Copied from Atlas.Biases each frame.

this.BonePaletteScratch

Full Usage: this.BonePaletteScratch

Pooled bone-palette staging array for skinned casters (B12). Shader's MAX_BONES is 128.

this.CollectedDrawCount

Full Usage: this.CollectedDrawCount

Opaque-geometry counts from the last unified collection. Populated whenever the shadow pass or a scene-depth pass collected geometry. The scene-depth render reads the same collected arrays (all entries), while the shadow render reads only CastsShadow entries.

this.CollectedInstancedCount

Full Usage: this.CollectedInstancedCount

this.CollectedModelPartCount

Full Usage: this.CollectedModelPartCount

this.CollectedSkinnedCount

Full Usage: this.CollectedSkinnedCount

this.Draws

Full Usage: this.Draws

Pooled caster mesh draws collected from the buffer (gated by EnableShadows/DisableShadows).

this.Effect

Full Usage: this.Effect

The depth-only effect (DepthShadow.fx), loaded lazily on first shadow pass.

this.Frustum

Full Usage: this.Frustum

Returns: BoundingFrustum

Reused per-caster frustum (updated in-place via .Matrix) to avoid per-frame allocation.

Returns: BoundingFrustum

this.InstanceStaging

Full Usage: this.InstanceStaging

CPU staging array for the per-instance VertexInstanceWorld rows. Grows to the largest instanceCount seen across collected instanced casters. Reused across frames.

this.InstanceVertexBuffer

Full Usage: this.InstanceVertexBuffer

Growable per-instance vertex buffer for instanced shadow casters. Owned by the shadow
 pass (not shared with the forward-pass PBR instance VB) so the two passes never race on it.
 Disposed at shutdown; recreated when an instanced caster exceeds the current capacity.

this.InstancedDraws

Full Usage: this.InstancedDraws

Pooled instanced-caster draws (the world's block grid etc.). Grows on demand.

this.ModelPartDraws

Full Usage: this.ModelPartDraws

Pooled static-ModelMeshPart caster draws (DrawModel/DrawModelWith). Grows on demand.

this.Origin

Full Usage: this.Origin

The frame's shadow-origin override (SetShadowOrigin); ValueNone = use the atlas strategy.

this.Params

Full Usage: this.Params

Cached depth-effect parameter handles (built when the effect loads).

this.PointShadowSlots

Full Usage: this.PointShadowSlots

Per-light shadow slot mapping, indexed by lights.PointLights/SpotLights position; -1 = no shadow.

this.Raster

Full Usage: this.Raster

Cached RasterizerState (polygon-offset bias + back-face culling). Created once on first shadow pass; disposed by the pipeline. Avoids per-frame GPU-state allocation.

this.ShadowResult

Full Usage: this.ShadowResult

The last frame's shadow pass output — read by the forward pass (Shade overrides +
 user-effect scopes) so a custom shader can opt into shadow sampling. ValueNone when no
 shadow-casting light exists or DepthShadow.fx is unavailable.

this.SkinnedDraws

Full Usage: this.SkinnedDraws

Pooled skinned-caster draws (B12). Grows on demand.

this.SpotShadowSlots

Full Usage: this.SpotShadowSlots

Per-light shadow slot mapping for spot lights; -1 = no shadow.

this.UVOffsetsScratch

Full Usage: this.UVOffsetsScratch

Pooled scratch for the multi-caster shadowUVOffsets upload.

this.ViewProjsScratch

Full Usage: this.ViewProjsScratch

Pooled scratch for the multi-caster shadowViewProjs upload.

Type something to start searching.