public sealed class SkyRendererThe background, drawn as the environment the scene is lit by rather than as a colour.
Remarks
The node kind a document needed before a frame could have a sky at all. Every other full-screen pass reads what an earlier pass wrote, and a sceneTextures: line can hand a graph resource to a shading pass — but the environment cube is neither: it is baked before the frame graph exists and it outlives every frame, so no document could name it and every frame ended up clearing to a colour somebody typed beside a cube somebody baked. Two opinions about one sky, drifting apart at the first retune.
What makes it possible is set 0. Sky.rvn declares the cube [PerFrame], and SceneConstants writes that set for whatever effect is about to bind it — under the effect's own name, so declaring environment in the shader is the whole of the wiring. A full-screen pass already binds set 0; nothing new crosses the boundary.
⚠ It writes an existing target and does not declare one. Naming the frame's own HDR colour is what puts the sky behind the scene: this runs first, fills every pixel, and the opaque pass that follows loads rather than clears. A pass that declared a target of its own would need a composite to get it into the frame, which is a second full-screen pass to avoid one clear.
No depth, and no depth test. A sky drawn last would need the depth buffer as a read and a discard per pixel; drawn first it costs one write of the target, which on any hardware made this century is cheaper than the alternative and is what every engine that does not have a dedicated far-plane trick does.
Fields and properties (7)
public RenderView? ViewThe view whose rays the cube is sampled along.
public Matrix4x4 InverseViewProjectionClip back to world, when no View supplies it.
public TextureViewHandle EnvironmentA view of the prefiltered environment cube. Without one this node draws nothing.
public SamplerHandle EnvironmentSamplerHow the cube is sampled. Linear-clamped, normally the frame's shared one.
public float MipCountHow many mip levels the chain has, so Soften can name one.
public bool SoftenWhether to sample the blurred end of the prefiltered chain rather than the sharp one.
public float IntensityA multiplier on the sampled luminance.
Methods (3)
public SkyRenderer()The background, drawn as the environment the scene is lit by rather than as a colour.
protected override void DeclareOutput(CompositorFrame frame, Int2 size)protected override void Configure(CompositorFrame frame, ParameterCollection parameters, IList<ResourceBinding> bindings)Fills in this frame's parameters and bindings.
Used by (2)
- ArenaFrameThirdPersonShooter
- PostEffectFactoryVixen.Rendering.PostFx