Table of Contents

Class GpuPickingRenderFeature

Namespace
Stride.CommunityToolkit.Effects.Picking
Assembly
Stride.CommunityToolkit.Effects.dll

The mesh feature's half of GPU picking: gives every mesh drawn in the picking stage the id its pixels write, and remembers which ModelComponent each id stands for so a pixel read back later can be turned into an entity again.

public sealed class GpuPickingRenderFeature : SubRenderFeature, IComponent, IReferencable, ICollectorHolder, IGraphicsRendererCore, IDisposable
Inheritance
GpuPickingRenderFeature
Implements
Inherited Members

Remarks

A port of the render feature Game Studio's viewport selects entities with. It does its work only on frames the picker has a request for: Stride.CommunityToolkit.Effects.Picking.GpuPickingRenderFeature.Active is set by the picker's renderer during collection, before the render system extracts.

Methods

Extract()

public override void Extract()

Find(int)

The component an id read back from the picking target stands for, if it was drawn in the last picking pass.

public ModelComponent? Find(int id)

Parameters

id int

The id, as written by the shader.

Returns

ModelComponent

The component, or null for the cleared background or a component gone since.

InitializeCore()

protected override void InitializeCore()

Prepare(RenderDrawContext)

public override void Prepare(RenderDrawContext context)

Parameters

context RenderDrawContext