Additional WGSL chunks to add to the shaders.

interface AdditionalChunks {
    additionalHead?: string;
    preliminaryContribution?: string;
    additionalContribution?: string;
}

Properties

additionalHead?: string

Additional WGSL chunk to add to the shader head. Useful for additional WGSL functions.

preliminaryContribution?: string

Preliminary modification to apply to the shader.

For the vertex shader, it is called after the attributes variables declarations and before applying any morph, skinning or matrices calculations.

For the fragment shader, it is called after the material and attributes variables declarations and before applying any lighting calculations.

additionalContribution?: string

Additional modification to apply to the shader.

For the vertex shader, it is called after having declared the outputted result and can therefore be used to update the outputted result.

For the fragment shader, it is called after having applied the lighting calculations and before applying tone mapping if any.