Interface CustomUniformsSourceConfig

interface CustomUniformsSourceConfig {
    bindGroupLayouts: GPUBindGroupLayout[];
    bindGroups: GPUBindGroup[];
    wgslCode: string;
}

Properties

bindGroupLayouts: GPUBindGroupLayout[]

A list of bind group layouts specifying all user-controlled resources containing the individual parts of the uniform values required by a SkyAtmosphereLutRenderer.

This should not contain more than maxBindGroups - 1 bind group layouts, where maxBindGroups is the maximum number of bind group layouts per pipeline layout supported by the device.

bindGroups: GPUBindGroup[]

A list of bind groups generated using the bindGroupLayouts, containing all user-controlled resources containing the individual parts of the uniform values required by a SkyAtmosphereLutRenderer.

wgslCode: string

The shader code to inject into internal pipelines.

This needs to provide at least the following interface:

 fn get_inverse_projection() -> mat4x4<f32>

fn get_inverse_view() -> mat4x4<f32>

fn get_camera_world_position() -> vec3<f32>

fn get_frame_id() -> f32

fn get_screen_resolution() -> vec2<f32>

fn get_ray_march_min_spp() -> f32

fn get_ray_march_max_spp() -> f32

fn get_sun_illuminance() -> vec3<f32>

fn get_sun_direction() -> vec3<f32>

fn get_sun_disk_diameter() -> f32

fn get_sun_disk_luminance_scale() -> f32

fn get_moon_illuminance() -> vec3<f32>

fn get_moon_direction() -> vec3<f32>

fn get_moon_disk_diameter() -> f32

fn get_moon_disk_luminance_scale() -> f32

For more details on the individual parameters, refer to the documentation on Uniforms.

The WGSL code should also include the bind groups matching the given bindGroupLayouts. The bind groups must not use bind group index 0.

If shadows are used (see ShadowConfig), the bind group layouts required to render shadows will be injected before the custom unifom buffer bind group layouts. I.e., the bind group indices should start with 1 + shadowConfig.bindGroupLayouts.length.