Skip to content

Functions

Stage: Fragment

void clrwl_computeFragment(vec4 sampleColor, out vec4 fragColor, out vec2 fragLight, out float ao, out vec4 overlayColor);

sampleColor: the result obtained from sampling gtexture.
fragColor: the result of sampleColor * clrwl_vertexColor, processed by the material’s fragment shader, with ambient occlusion applied.
fragLight: the final lightmap value, with values ranging from 0.03125 to 0.96875.
ao: the ambient occlusion value.
overlayColor: equivalent to Iris’s entityColor.

The function will also decide if the fragment should be discarded using the material’s cutout shader.

Stage: Geometry

void clrwl_setVertexOut(int i);

i: the input vertex index

Use this function before emitting a vertex in the geometry stage. It will assign the given input vertex attributes to the emitted vertex.
This is important as Flywheel material shaders uses some attributes from the vertex stage (see Attributes Overview page).

Program: clrwl_shadow_distort

vec2 clrwl_distortShadowClipXY(vec2 vertexClipXY);

vertexClipXY: a XY position in clip space

When shadow.occlusion.culling is enabled, the shaderpack must implement this function.

This function should distort the provided XY position, using the same distortion function as the shadow program, and return the result.

Program: clrwl_shadow_distort

float clrwl_distortShadowClipZ(float vertexClipZ);

vertexClipZ: a Z value in clip space

When shadow.occlusion.culling is enabled, the shaderpack must implement this function.

This function should distort the provided Z value, using the same distortion function as the shadow program, and return the result.