Interface SkyRendererRasterConfig

External resources and settings required by a SkyAtmosphereLutRenderer.

interface SkyRendererRasterConfig {
    defaultToPerPixelRayMarch?: boolean;
    depthBuffer: DepthBufferConfig;
    distanceToMaxSampleCount?: number;
    rayMarch?: FullResolutionRayMarchConfig;
    recordInternalRenderBundles?: boolean;
    renderTargetFormat: GPUTextureFormat;
    transmissionFormat?: GPUTextureFormat;
    writeTransmissionOnlyOnPerPixelRayMarch?: boolean;
}

Hierarchy (view full)

Properties

defaultToPerPixelRayMarch?: boolean

If this is true, SkyAtmosphereRasterRenderer.renderSky / SkyAtmosphereComputeRenderer.renderLutsAndSky will default to full-screen ray marching to render the atmosphere.

Defaults to false.

depthBuffer: DepthBufferConfig

The depth buffer to limit the ray marching distance when rendering the sky / atmosphere.

distanceToMaxSampleCount?: number

Distance in kilometers at which the maximum number of sampler per ray is used when ray marching the sky (either when rendering the sky view lookup table or when ray marching the sky per pixel).

Defaults to 100 km.

Settings for the full-resolution ray marching pass.

recordInternalRenderBundles?: boolean

If this is true, the sky rendering passes are pre-recorded into internally managed GPURenderBundles instead of encoding the passes each frame.

Defaults to true.

renderTargetFormat: GPUTextureFormat

The format of the render target at location 0.

Must support RENDER_ATTACHMENT usage. Should have at least 16 bit precision per channel.

transmissionFormat?: GPUTextureFormat

If this is set and dual source blending is not enabled or not available, all render passes will be configured to use two render targets, where transmission will be written to the second render target using this format. In this case, no blend state will be configured for the render target at location 0. Instead, blending is left to the user.

If rayMarch.useColoredTransmittance is true and the device support the "dual-source-blending" feature, this option is ignored.

If writeTransmissionOnlyOnPerPixelRayMarch is true, this setting does not affect the sky rendering pass using the aerial perspective lookup table. It will instead be configured to expect a single render target at location 0 and a blend state will be configured for the pipeline.

writeTransmissionOnlyOnPerPixelRayMarch?: boolean

If this is true, a transmissionFormat is set, and dual source blending is not enabled or not available, only configure the more expensive full-screen ray marching pass to use a second render target and write colored transmittance.

Note that the faster pass using the aerial perspective lookup table does not support colored transmittance anyway and thus writing to a second render target is an extra cost without any benefit.

Defaults to true.