Table of Contents

Class ForwardRenderer

Namespace
Stride.Rendering.Compositing
Assembly
Stride.Engine.dll

Renders your game. It should use current RenderView and GetCurrentCamera(RenderContext).

[Display("Forward renderer", null)]
public class ForwardRenderer : SceneRendererBase, IComponent, IReferencable, ICollectorHolder, ISceneRenderer, IRenderCollector, IGraphicsRenderer, IGraphicsRendererCore, IDisposable, ISharedRenderer, IIdentifiable, IGraphicsRendererBase
Inheritance
ForwardRenderer
Implements
Inherited Members
Extension Methods

Fields

DepthBufferFormat

public const PixelFormat DepthBufferFormat = D24_UNorm_S8_UInt

Field Value

PixelFormat

viewDepthStencil

protected Texture viewDepthStencil

Field Value

Texture

viewOutputTarget

protected Texture viewOutputTarget

Field Value

Texture

Properties

BindDepthAsResourceDuringTransparentRendering

If true, depth buffer generated during OpaqueRenderStage will be available as a shader resource named DepthBase.DepthStencil during TransparentRenderStage.

public bool BindDepthAsResourceDuringTransparentRendering { get; set; }

Property Value

bool

Remarks

This is needed by some effects such as particles soft edges.

On recent platforms that can bind depth buffer as read-only (HasDepthAsReadOnlyRT), depth buffer will be used as is. Otherwise, a copy will be generated.

BindOpaqueAsResourceDuringTransparentRendering

If true, render target generated during OpaqueRenderStage will be available as a shader resource named OpaqueBase.OpaqueRenderTarget during TransparentRenderStage.

public bool BindOpaqueAsResourceDuringTransparentRendering { get; set; }

Property Value

bool

Clear

public ClearRenderer Clear { get; set; }

Property Value

ClearRenderer

GBufferRenderStage

The G-Buffer render stage to render depth buffer and possibly some other extra info to buffers (i.e. normals)

public RenderStage GBufferRenderStage { get; set; }

Property Value

RenderStage

LightProbes

Enable Light Probe.

public bool LightProbes { get; set; }

Property Value

bool

LightShafts

Light shafts effect

public LightShafts LightShafts { get; set; }

Property Value

LightShafts

MSAALevel

The level of multi-sampling

public MultisampleCount MSAALevel { get; set; }

Property Value

MultisampleCount

MSAAResolver

MSAA Resolver is used to resolve multi-sampled render targets into normal render targets

public MSAAResolver MSAAResolver { get; }

Property Value

MSAAResolver

OpaqueRenderStage

The main render stage for opaque geometry.

public RenderStage OpaqueRenderStage { get; set; }

Property Value

RenderStage

PostEffects

The post effects renderer.

public IPostProcessingEffects PostEffects { get; set; }

Property Value

IPostProcessingEffects

ShadowMapRenderStages

The shadow map render stages for shadow casters. No shadow rendering will happen if null.

public List<RenderStage> ShadowMapRenderStages { get; }

Property Value

List<RenderStage>

SubsurfaceScatteringBlurEffect

Separable subsurface scattering effect

public SubsurfaceScatteringBlur SubsurfaceScatteringBlurEffect { get; set; }

Property Value

SubsurfaceScatteringBlur

TransparentRenderStage

The transparent render stage for transparent geometry.

public RenderStage TransparentRenderStage { get; set; }

Property Value

RenderStage

VRSettings

Virtual Reality related settings

public VRRendererSettings VRSettings { get; set; }

Property Value

VRRendererSettings

ViewCount

protected int ViewCount { get; }

Property Value

int

ViewIndex

protected int ViewIndex { get; }

Property Value

int

Methods

CollectCore(RenderContext)

Main collect method.

protected override void CollectCore(RenderContext context)

Parameters

context RenderContext

CollectStages(RenderContext)

protected virtual void CollectStages(RenderContext context)

Parameters

context RenderContext

CollectView(RenderContext)

protected virtual void CollectView(RenderContext context)

Parameters

context RenderContext

ComputeNonMSAADepthFormat(PixelFormat)

protected static PixelFormat ComputeNonMSAADepthFormat(PixelFormat format)

Parameters

format PixelFormat

Returns

PixelFormat

Destroy()

Disposes of object resources.

protected override void Destroy()

DrawCore(RenderContext, RenderDrawContext)

Main drawing method for this renderer that must be implemented.

protected override void DrawCore(RenderContext context, RenderDrawContext drawContext)

Parameters

context RenderContext
drawContext RenderDrawContext

DrawView(RenderContext, RenderDrawContext, int, int)

protected virtual void DrawView(RenderContext context, RenderDrawContext drawContext, int eyeIndex, int eyeCount)

Parameters

context RenderContext
drawContext RenderDrawContext
eyeIndex int
eyeCount int

InitializeCore()

protected override void InitializeCore()

PrepareRenderTargets(RenderDrawContext, Size2)

Prepares targets per frame, caching and handling MSAA etc.

protected virtual void PrepareRenderTargets(RenderDrawContext drawContext, Size2 renderTargetsSize)

Parameters

drawContext RenderDrawContext

The current draw context

renderTargetsSize Size2

The render target size

ValidateOpaqueStageOutput(RenderOutputValidator, RenderContext)

protected virtual void ValidateOpaqueStageOutput(RenderOutputValidator renderOutputValidator, RenderContext renderContext)

Parameters

renderOutputValidator RenderOutputValidator
renderContext RenderContext