Table of Contents

Class RenderCore

Namespace
HelixToolkit.SharpDX.Core
Assembly
HelixToolkit.SharpDX.dll
public abstract class RenderCore : DisposeObject, IDisposable, IGUID, IThrowingShadow
Inheritance
RenderCore
Implements
Derived
Inherited Members

Constructors

RenderCore(RenderType)

Initializes a new instance of the RenderCore class.

public RenderCore(RenderType renderType)

Parameters

renderType RenderType

Type of the render.

Fields

ModelMatrix

Model matrix

public Matrix4x4 ModelMatrix

Field Value

Matrix4x4

Properties

DefaultStateBinding

Gets or sets the default state binding.

public StateType DefaultStateBinding { get; set; }

Property Value

StateType

The default state binding.

Device

public Device1? Device { get; }

Property Value

Device1

EffectTechnique

public IRenderTechnique? EffectTechnique { get; }

Property Value

IRenderTechnique

GUID

public Guid GUID { get; }

Property Value

Guid

IsAttached

Is render core has been attached

public bool IsAttached { get; }

Property Value

bool

IsThrowingShadow

public bool IsThrowingShadow { get; set; }

Property Value

bool

NeedUpdate

Indicate whether render host should call Update(RenderContext, DeviceContextProxy) before Render(RenderContext, DeviceContextProxy)

Update(RenderContext, DeviceContextProxy) is used to run such as compute shader before rendering.

Compute shader can be run at the beginning of any other Render(RenderContext, DeviceContextProxy) routine to avoid waiting.

public bool NeedUpdate { get; protected set; }

Property Value

bool

RenderType

Gets or sets the type of the render.

public RenderType RenderType { get; set; }

Property Value

RenderType

The type of the render.

ShadowStateBinding

Gets or sets the default state binding.

public StateType ShadowStateBinding { get; set; }

Property Value

StateType

The default state binding.

Methods

AddComponent<T>(T)

protected T AddComponent<T>(T component) where T : CoreComponent

Parameters

component T

Returns

T

Type Parameters

T

Attach(IRenderTechnique?)

Call to attach the render core.

public void Attach(IRenderTechnique? technique)

Parameters

technique IRenderTechnique

Detach()

Detach render core. Release all resources

public void Detach()

OnAttach(IRenderTechnique?)

During attatching render core. Create all local resources. Use Collect(resource) to let object be released automatically during Detach().

protected abstract bool OnAttach(IRenderTechnique? technique)

Parameters

technique IRenderTechnique

Returns

bool

OnDetach()

On detaching, default is to release all resources

protected abstract void OnDetach()

OnDispose(bool)

Disposes of object resources.

protected override void OnDispose(bool disposeManagedResources)

Parameters

disposeManagedResources bool

If true, managed resources should be disposed of in addition to unmanaged resources.

OnUpdate(RenderContext, DeviceContextProxy)

Only used for running compute shader such as in particle system.

protected virtual void OnUpdate(RenderContext context, DeviceContextProxy deviceContext)

Parameters

context RenderContext
deviceContext DeviceContextProxy

OnUpdateCanRenderFlag()

Called when [update can render flag].

protected virtual bool OnUpdateCanRenderFlag()

Returns

bool

RaiseInvalidateRender()

Invalidates the renderer.

protected void RaiseInvalidateRender()

Render(RenderContext, DeviceContextProxy)

Render routine

public abstract void Render(RenderContext context, DeviceContextProxy deviceContext)

Parameters

context RenderContext
deviceContext DeviceContextProxy

RenderCustom(RenderContext, DeviceContextProxy)

Renders the custom pass. Must apply render pass externally. Usually used during PostEffect rendering.

public virtual void RenderCustom(RenderContext context, DeviceContextProxy deviceContext)

Parameters

context RenderContext

The context.

deviceContext DeviceContextProxy

The device context.

RenderDepth(RenderContext, DeviceContextProxy, ShaderPass?)

Renders the depth pass.

public virtual void RenderDepth(RenderContext context, DeviceContextProxy deviceContext, ShaderPass? customPass)

Parameters

context RenderContext

The context.

deviceContext DeviceContextProxy

The device context.

customPass ShaderPass

RenderShadow(RenderContext, DeviceContextProxy)

Renders the shadow pass. Used to generate shadow map.

public virtual void RenderShadow(RenderContext context, DeviceContextProxy deviceContext)

Parameters

context RenderContext

The context.

deviceContext DeviceContextProxy

The device context.

ResetInvalidateHandler()

Resets the invalidate handler.

public void ResetInvalidateHandler()

SetAffectsCanRenderFlag<T>(ref T, T)

Sets the affects can render flag. This will also invalidate renderer.

protected bool SetAffectsCanRenderFlag<T>(ref T backingField, T value)

Parameters

backingField T

The backing field.

value T

The value.

Returns

bool

Type Parameters

T

SetAffectsRender<T>(ref T, T)

protected bool SetAffectsRender<T>(ref T backingField, T value)

Parameters

backingField T
value T

Returns

bool

Type Parameters

T

Update(RenderContext, DeviceContextProxy)

Update routine. Only used to run update computation such as compute shader in particle system.

Compute shader can be run at the beginning of any other Render(RenderContext, DeviceContextProxy) routine to avoid waiting.

public void Update(RenderContext context, DeviceContextProxy deviceContext)

Parameters

context RenderContext
deviceContext DeviceContextProxy

UpdateCanRenderFlag()

Updates the can render flag.

public void UpdateCanRenderFlag()

Events

InvalidateRender

public event EventHandler<EventArgs>? InvalidateRender

Event Type

EventHandler<EventArgs>