Class LightBinner
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Per scene owner of the tile and depth bin cull passes: the item layout, the GPU buffers they read and write, and the constants that tell the shading pass where to look.
public sealed class LightBinner : IDisposableInheritance
Implements
Remarks
One per , because the bit indices it produces are positions in that scene's barn light and env map arrays. The 3D skybox has its own arrays, so its bits mean nothing against these.
Constructors
LightBinner(Scene)
Per scene owner of the tile and depth bin cull passes: the item layout, the GPU buffers they read and write, and the constants that tell the shading pass where to look.
public LightBinner(Scene scene)Parameters
scene Scene
Remarks
One per , because the bit indices it produces are positions in that scene's barn light and env map arrays. The 3D skybox has its own arrays, so its bits mean nothing against these.
Properties
CullBits
Gets the buffer holding this scene's per tile and per depth bin masks.
public StorageBuffer? CullBits { get; }Property Value
Methods
Bind()
Binds this scene's masks and their layout for the shading pass.
public void Bind()Dispatch()
Rasterizes the items projected into per tile and per depth bin masks, so the shading pass iterates only what reaches a given fragment.
public void Dispatch()Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()GetOverlayRegion(bool)
Gets the first word and stride of a batch's tile region, for the debug overlay.
public (uint TileBase, uint Words) GetOverlayRegion(bool envMaps)Parameters
envMaps bool
Whether to describe the env map batch rather than the barn light one.
Returns
LoadShaders()
Loads the two compute shaders. Call once the GL context exists.
public void LoadShaders()SetPixelRemap(Vector4)
Points this pass's pixels at the ones the masks were built for. The viewmodel draws into the same target through a different projection, so it cannot take its tile from gl_FragCoord directly.
public void SetPixelRemap(Vector4 remap)Parameters
remap Vector4
Pixel remap: xy scale, zw bias.
Update(ViewConstants, int, int, bool)
Projects every cull item for this frame and publishes the resulting layout. Must run before the view buffer upload preceding , since the shading pass reads the layout.
public void Update(ViewConstants viewConstants, int viewportWidth, int viewportHeight, bool enabled)Parameters
viewConstants ViewConstants
View the items are projected against.
viewportWidth int
Viewport width in pixels.
viewportHeight int
Viewport height in pixels.
enabled bool
Whether the caller wants binning this frame.

