Skip to content

Variable: GodRaysShader ​

ts
const GodRaysShader: object;

Screen-space God Rays (Crytek radial blur method).

Seeds rays exclusively from a dedicated mask texture (tMask) that contains ONLY the star — rendered via a layer isolation pass. This prevents bright non-stellar pixels (gas planets, surface highlights, lens flare glows) near the sun UV from polluting the ray accumulation.

Variable ray lengths: angular noise (overlapping sine harmonics) modulates the weight per direction — some angles produce long bright rays, others nearly nothing, giving an organic star-burst pattern.

Pass order: RenderPass → GodRaysShaderPass → UnrealBloomPass → OutputPass Rays are bloomed by UnrealBloomPass, giving them a soft organic glow.

Type Declaration ​

name ​

ts
name: string = 'GodRaysShader';

uniforms ​

ts
uniforms: object;

uniforms.tDiffuse ​

ts
tDiffuse: object;

uniforms.tDiffuse.value ​

ts
value: Texture<unknown, TextureEventMap> | null;

uniforms.tMask ​

ts
tMask: object;

Star-only render (black everywhere else). Seeds all ray contributions.

uniforms.tMask.value ​

ts
value: Texture<unknown, TextureEventMap> | null;

uniforms.uSunUV ​

ts
uSunUV: object;

Sun position in UV space [0,1]. Updated every frame from camera projection.

uniforms.uSunUV.value ​

ts
value: Vector2;

uniforms.uExposure ​

ts
uExposure: object;

Overall brightness of rays

uniforms.uExposure.value ​

ts
value: number = 0.7;

uniforms.uDecay ​

ts
uDecay: object;

Attenuation per sample step (closer to 1 = longer rays)

uniforms.uDecay.value ​

ts
value: number = 0.5;

uniforms.uDensity ​

ts
uDensity: object;

Step stretch factor

uniforms.uDensity.value ​

ts
value: number = 0.7;

uniforms.uWeight ​

ts
uWeight: object;

Per-sample weight before angular modulation

uniforms.uWeight.value ​

ts
value: number = 0.4;

uniforms.uEnabled ​

ts
uEnabled: object;

0–1 fade: 0 when sun is off-screen or behind camera

uniforms.uEnabled.value ​

ts
value: number = 1.0;

vertexShader ​

ts
vertexShader: string;

fragmentShader ​

ts
fragmentShader: string;

Distribué sous la licence indiquée dans le dépôt.