Rainfall environment#
Back to shader guides.
Rainfall injects custom HLSL into generated GameCube TEV shaders at runtime. This section covers symbols you see most in fragment mods (prev, input.position, u_time). Vertex mods use model-space locals and state uniforms, see Custom shader mods.
Environment uniforms#
The shader code has access to variables defined in the FSUniforms cbuffer:
u_time (float)#
- Meaning: seconds since the game started.
- Purpose: drive animations, waves, and oscillations.
_timePad.x (float)#
- Meaning:
1.0 / renderWidth - Purpose: turn pixel
xinto a 0–1 UV coordinate.
_timePad.y (float)#
- Meaning:
1.0 / renderHeight - Purpose: turn pixel
yinto a 0–1 UV coordinate.
Global fragment registers#
prev(float4)- Meaning: pixel color from the normal render pipeline before your mod runs (RGBA).
- Use: tint, grade, or post-process the final color.
Screen variables#
input.position.xy(float2)- Meaning: pixel coordinates from
(0, 0)at the top-left to(width, height). - Use: screen-space grids, scanlines, and similar effects.
- Meaning: pixel coordinates from
input.position.z(float)- Meaning: non-linear depth in
[0.0, 1.0]. - Use: avoid this for distance-based effects, and prefer
input.position.wfor linear depth.
- Meaning: non-linear depth in
input.position.w(float)- Meaning:
1.0 / w_clip(reciprocal clip-space depth). - Linear depth: camera distance in world units:
- 2D / HUD guard: HUD, text, and ortho draws use
w_clip = 1.0, so they read asinput.position.w == 1.0f:
- Meaning: