Class PickingTexture
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Framebuffer for GPU-based object picking using unique object IDs.
public class PickingTexture : FramebufferInheritance
object ← Framebuffer ← PickingTexture
Inherited Members
Framebuffer.FboHandle, Framebuffer.Width, Framebuffer.Height, Framebuffer.HasValidDimensions(), Framebuffer.NumMips, Framebuffer.NumSamples, Framebuffer.Target, Framebuffer.Color, Framebuffer.Depth, Framebuffer.Stencil, Framebuffer.ColorFormat, Framebuffer.DepthFormat, Framebuffer.InitialStatus, Framebuffer.TargetState, Framebuffer.Bind(FramebufferTarget), Framebuffer.ClearColor, Framebuffer.ClearMask, Framebuffer.BindAndClear(FramebufferTarget), Framebuffer.GLDefaultFramebuffer, Framebuffer.Equals(object?), Framebuffer.GetHashCode(), Framebuffer.Prepare(string, int, int, int, Framebuffer.AttachmentFormat?, Framebuffer.DepthAttachmentFormat?), Framebuffer.Initialize(), Framebuffer.Resize(int, int, int), Framebuffer.Resize(int, int), Framebuffer.ChangeFormat(Framebuffer.AttachmentFormat?, Framebuffer.DepthAttachmentFormat?, FramebufferAttachment?), Framebuffer.CheckStatus_ThrowIfIncomplete(string), Framebuffer.AttachColorMipLevel(int), Framebuffer.GetMipSize(int), Framebuffer.Delete(), Framebuffer.SetShadowDepthSamplerState(bool)
Constructors
PickingTexture(RendererContext, EventHandler<PickingResponse>)
Initializes the picking framebuffer, shaders, and subscribes to the pick event.
public PickingTexture(RendererContext rendererContext, EventHandler<PickingTexture.PickingResponse> onPicked)Parameters
rendererContext RendererContext
Renderer context for loading shaders.
onPicked EventHandler<PickingTexture.PickingResponse>
Handler invoked when a pick result is available.
Properties
ActiveNextFrame
Gets whether a pick has been requested and will be resolved on the next frame.
public bool ActiveNextFrame { get; }Property Value
DebugShader
Gets the debug shader that visualizes the picking buffer contents on screen.
public Shader DebugShader { get; }Property Value
IsDebugActive
Gets whether the current render mode has activated picking debug visualization.
public bool IsDebugActive { get; }Property Value
Shader
Gets the picking shader used during the picking render pass.
public Shader Shader { get; }Property Value
Methods
Finish()
Reads back the picking pixel if a request was pending and stores the response for the next event trigger.
public void Finish()RequestNextFrame(int, int, PickingIntent)
Schedules a pick at the given cursor position to be resolved after the next frame renders.
public void RequestNextFrame(int x, int y, PickingTexture.PickingIntent intent)Parameters
x int
Cursor X position in window coordinates.
y int
Cursor Y position in window coordinates.
intent PickingTexture.PickingIntent
The interaction intent for this pick request.
SetRenderMode(string)
Updates based on whether the current render mode matches the picking shader's supported modes.
public void SetRenderMode(string renderMode)Parameters
renderMode string
Name of the active render mode.
TriggerEventIfAny()
Fires with the stored response if one is available.
public void TriggerEventIfAny()OnPicked
Raised when a pick response is ready to be consumed.
public event EventHandler<PickingTexture.PickingResponse> OnPicked
