Class QuadOverdraw
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Quad overdraw debug visualization.
public class QuadOverdrawInheritance
Remarks
The scene is rendered with a replacement shader that counts, per 2x2 pixel quad, how many primitives were shaded into it, using an atomic lock image so a primitive spanning several pixels of the same quad counts once.
The first render only fills out the depth buffer, the second one renders overdraw
Constructors
QuadOverdraw(RendererContext)
Quad overdraw debug visualization.
public QuadOverdraw(RendererContext rendererContext)Parameters
rendererContext RendererContext
Remarks
The scene is rendered with a replacement shader that counts, per 2x2 pixel quad, how many primitives were shaded into it, using an atomic lock image so a primitive spanning several pixels of the same quad counts once.
The first render only fills out the depth buffer, the second one renders overdraw
Fields
CountImageUnit
Image unit for the count image. Units 1 and 2 are used by the MSAA resolve and depth pyramid compute passes.
public const int CountImageUnit = 4Field Value
LockImageUnit
Image unit for the lock image. Units 1 and 2 are used by the MSAA resolve and depth pyramid compute passes.
public const int LockImageUnit = 3Field Value
Properties
IsActive
Gets whether the current render mode has activated the quad overdraw visualization.
public bool IsActive { get; }Property Value
SceneShader
Gets the replacement shader that counts quad overdraw while the scene renders.
public Shader SceneShader { get; }Property Value
Methods
BeginCountingPass(Framebuffer)
Switches from the depth prime render to the counting render by enabling counting in .
public void BeginCountingPass(Framebuffer framebuffer)Parameters
framebuffer Framebuffer
The framebuffer the scene renders into.
Dispose()
Releases the GPU textures owned by this visualization.
public void Dispose()EndCountingPass(Framebuffer)
Restores the depth state changed by .
public void EndCountingPass(Framebuffer framebuffer)Parameters
framebuffer Framebuffer
The framebuffer passed to .
Load()
Loads the shaders up front so the render mode is registered for the mode dropdown.
public void Load()Prepare(int, int)
Sizes the count images to the framebuffer, resets them, binds them to their image units, and puts in depth prime mode. Call before the first scene render of the frame.
public void Prepare(int width, int height)Parameters
width int
Framebuffer width in pixels.
height int
Framebuffer height in pixels.
Render()
Replaces the bound framebuffer contents with the overdraw heat map and legend. Call after the scene rendered with as the replacement shader.
public void Render()SetRenderMode(string)
Updates based on the active render mode name.
public void SetRenderMode(string renderMode)Parameters
renderMode string

