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
renderTypeRenderTypeType of the render.
Fields
ModelMatrix
Model matrix
public Matrix4x4 ModelMatrix
Field Value
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
GUID
public Guid GUID { get; }
Property Value
IsAttached
Is render core has been attached
public bool IsAttached { get; }
Property Value
IsThrowingShadow
public bool IsThrowingShadow { get; set; }
Property Value
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
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
componentT
Returns
- T
Type Parameters
T
Attach(IRenderTechnique?)
Call to attach the render core.
public void Attach(IRenderTechnique? technique)
Parameters
techniqueIRenderTechnique
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
techniqueIRenderTechnique
Returns
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
disposeManagedResourcesboolIf 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
contextRenderContextdeviceContextDeviceContextProxy
OnUpdateCanRenderFlag()
Called when [update can render flag].
protected virtual bool OnUpdateCanRenderFlag()
Returns
RaiseInvalidateRender()
Invalidates the renderer.
protected void RaiseInvalidateRender()
Render(RenderContext, DeviceContextProxy)
Render routine
public abstract void Render(RenderContext context, DeviceContextProxy deviceContext)
Parameters
contextRenderContextdeviceContextDeviceContextProxy
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
contextRenderContextThe context.
deviceContextDeviceContextProxyThe device context.
RenderDepth(RenderContext, DeviceContextProxy, ShaderPass?)
Renders the depth pass.
public virtual void RenderDepth(RenderContext context, DeviceContextProxy deviceContext, ShaderPass? customPass)
Parameters
contextRenderContextThe context.
deviceContextDeviceContextProxyThe device context.
customPassShaderPass
RenderShadow(RenderContext, DeviceContextProxy)
Renders the shadow pass. Used to generate shadow map.
public virtual void RenderShadow(RenderContext context, DeviceContextProxy deviceContext)
Parameters
contextRenderContextThe context.
deviceContextDeviceContextProxyThe 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
backingFieldTThe backing field.
valueTThe value.
Returns
Type Parameters
T
SetAffectsRender<T>(ref T, T)
protected bool SetAffectsRender<T>(ref T backingField, T value)
Parameters
backingFieldTvalueT
Returns
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
contextRenderContextdeviceContextDeviceContextProxy
UpdateCanRenderFlag()
Updates the can render flag.
public void UpdateCanRenderFlag()
Events
InvalidateRender
public event EventHandler<EventArgs>? InvalidateRender