Class RenderContext
- Namespace
- HelixToolkit.SharpDX
- Assembly
- HelixToolkit.SharpDX.dll
The render-context is currently generated per frame Optimizations might be possible
public sealed class RenderContext : DisposeObject, IDisposable, IRenderMatrices
- Inheritance
-
RenderContext
- Implements
- Inherited Members
- Extension Methods
Constructors
RenderContext(IRenderHost)
Initializes a new instance of the RenderContext class.
public RenderContext(IRenderHost renderHost)
Parameters
renderHostIRenderHostThe render host.
Fields
AutoUpdateOctree
Gets or sets a value indicating whether [update octree] automatically.
public bool AutoUpdateOctree
Field Value
- bool
trueif [update octree]; otherwise,false.
BoundingFrustum
Gets or sets the bounding frustum.
public BoundingFrustum BoundingFrustum
Field Value
- BoundingFrustum
The bounding frustum.
CustomPassName
Gets or sets the name of the custom pass.
public string CustomPassName
Field Value
- string
The name of the custom pass.
EnableBoundingFrustum
Gets or sets a value indicating whether [enable bounding frustum].
public bool EnableBoundingFrustum
Field Value
- bool
trueif [enable bounding frustum]; otherwise,false.
IsDeferredPass
Gets or sets a value indicating whether is deferred pass.
public bool IsDeferredPass
Field Value
- bool
trueif this instance is deferred pass; otherwise,false.
IsInvertCullMode
Gets or sets a value indicating whether this render pass is using inverted cull mode. If SharpDX.Direct3D11.CullMode=SharpDX.Direct3D11.CullMode.None, default state is used. This is usually used when rendering DynamicCubeMapCore.
public bool IsInvertCullMode
Field Value
- bool
trueSet invert cullmode flag; otherwise,false.
OITRenderStage
Gets or sets a value indicating order independent transparent pass stage.
public OITRenderStage OITRenderStage
Field Value
- OITRenderStage
NoneIt is not using oit passfalse.
TimeStamp
Gets or sets the time stamp.
public TimeSpan TimeStamp
Field Value
- TimeSpan
The time stamp.
Properties
ActualHeight
Gets the actual height.
public float ActualHeight { get; }
Property Value
- float
The actual height.
ActualWidth
Gets the actual width.
public float ActualWidth { get; }
Property Value
- float
The actual width.
Camera
Gets or sets the camera.
public CameraCore? Camera { get; set; }
Property Value
- CameraCore
The camera.
CameraParams
Gets the camera parameters.
public FrustumCameraParams CameraParams { get; }
Property Value
- FrustumCameraParams
The camera parameters.
DpiScale
Gets the dpi scale.
public float DpiScale { get; }
Property Value
- float
The dpi scale.
GlobalTransform
Gets the global transform.
public GlobalTransformStruct GlobalTransform { get; }
Property Value
- GlobalTransformStruct
The global transform.
IsPerspective
Gets a value indicating whether this instance is perspective.
public bool IsPerspective { get; }
Property Value
- bool
trueif this instance is perspective; otherwise,false.
IsShadowMapEnabled
Gets a value indicating whether this instance is shadow map enabled.
public bool IsShadowMapEnabled { get; }
Property Value
- bool
trueif this instance is shadow map enabled; otherwise,false.
LightScene
Gets or sets the light scene.
public Light3DSceneShared? LightScene { get; }
Property Value
- Light3DSceneShared
The light scene.
OITWeightDepthSlope
Gets or sets the oit weight depth slope. Used to increase resolution for particular range of depth values.
If value = 2, the depth range from 0-0.5 expands to 0-1 to increase resolution. However, values from 0.5 - 1 will be pushed to 1
public float OITWeightDepthSlope { get; set; }
Property Value
- float
The oit weight depth slope.
OITWeightMode
Gets or sets the oit weight mode.
Please refer to http://jcgt.org/published/0002/02/09/
Linear0: eq7; Linear1: eq8; Linear2: eq9; NonLinear: eq10
public OITWeightMode OITWeightMode { get; set; }
Property Value
- OITWeightMode
The oit weight mode.
OITWeightPower
Gets or sets the oit weight power used for color weight calculation. Default = 3;
public float OITWeightPower { get; set; }
Property Value
- float
The oit weight power.
ProjectionMatrix
Gets or sets the projection matrix.
public Matrix4x4 ProjectionMatrix { get; }
Property Value
- Matrix4x4
The projection matrix.
RenderHost
Gets the render host.
public IRenderHost RenderHost { get; }
Property Value
- IRenderHost
The render host.
SSAOBias
Gets or sets the ssao bias.
public float SSAOBias { get; set; }
Property Value
- float
The ssao bias.
SSAOEnabled
Gets or sets a value indicating whether [ssao enabled].
public bool SSAOEnabled { get; set; }
Property Value
- bool
trueif [ssao enabled]; otherwise,false.
SSAOIntensity
Gets or sets the ssao intensity.
public float SSAOIntensity { get; set; }
Property Value
- float
The ssao intensity.
ScreenViewProjectionMatrix
Gets the screen view projection matrix.
public Matrix4x4 ScreenViewProjectionMatrix { get; }
Property Value
- Matrix4x4
The screen view projection matrix.
SharedResource
Gets or sets the shared resource.
public ContextSharedResource? SharedResource { get; }
Property Value
- ContextSharedResource
The shared resource.
ViewMatrix
Gets the view matrix.
public Matrix4x4 ViewMatrix { get; }
Property Value
- Matrix4x4
The view matrix.
ViewMatrixInv
Gets or sets the inversed view matrix.
public Matrix4x4 ViewMatrixInv { get; }
Property Value
- Matrix4x4
The inversed view matrix.
Viewport
Current viewport setting
public ViewportF Viewport { get; }
Property Value
ViewportMatrix
Gets the viewport matrix.
public Matrix4x4 ViewportMatrix { get; }
Property Value
- Matrix4x4
The viewport matrix.
updatePerFrameRenderableRequested
Gets or sets a value indicating whether [update per frame renderable requested] in this frame.
public bool updatePerFrameRenderableRequested { get; }
Property Value
- bool
trueif [update per frame renderable requested]; otherwise,false.
updateSceneGraphRequested
Gets or sets a value indicating whether [update scene graph requested] in this frame.
public bool updateSceneGraphRequested { get; }
Property Value
- bool
trueif [update scene graph requested]; otherwise,false.
Methods
GetOffScreenDS(OffScreenTextureSize, Format)
Gets the off screen depth stencil.
public ShaderResourceViewProxy? GetOffScreenDS(OffScreenTextureSize size, Format format)
Parameters
sizeOffScreenTextureSizeThe size.
formatFormatThe format.
Returns
GetOffScreenDS(OffScreenTextureSize, Format, out int, out int)
Gets the off screen ds.
public ShaderResourceViewProxy? GetOffScreenDS(OffScreenTextureSize size, Format format, out int width, out int height)
Parameters
sizeOffScreenTextureSizeThe size.
formatFormatThe format.
widthintThe width.
heightintThe height.
Returns
GetOffScreenRT(OffScreenTextureSize, Format)
Gets the off screen render target.
public ShaderResourceViewProxy? GetOffScreenRT(OffScreenTextureSize size, Format format)
Parameters
sizeOffScreenTextureSizeThe size.
formatFormatThe format.
Returns
GetOffScreenRT(OffScreenTextureSize, Format, out int, out int)
Gets the off screen rt.
public ShaderResourceViewProxy? GetOffScreenRT(OffScreenTextureSize size, Format format, out int width, out int height)
Parameters
sizeOffScreenTextureSizeThe size.
formatFormatThe format.
widthintThe width.
heightintThe height.
Returns
GetOffScreenTexture(OffScreenTextureType, OffScreenTextureSize, Format)
Gets the off screen texture. Same as GetOffScreenRT(OffScreenTextureSize, Format) or GetOffScreenDS(OffScreenTextureSize, Format)
public ShaderResourceViewProxy? GetOffScreenTexture(OffScreenTextureType type, OffScreenTextureSize size, Format format)
Parameters
typeOffScreenTextureTypeThe type.
sizeOffScreenTextureSizeThe size.
formatFormatThe format.
Returns
GetPingPongBufferCurrentRTV()
public ShaderResourceViewProxy? GetPingPongBufferCurrentRTV()
Returns
GetPingPongBufferNextRTV()
public ShaderResourceViewProxy? GetPingPongBufferNextRTV()
Returns
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.
RestoreGlobalTransform()
public void RestoreGlobalTransform()
Set(ref GlobalTransformStruct, ViewportF)
public void Set(ref GlobalTransformStruct transforms, ViewportF viewport)
Parameters
transformsGlobalTransformStructviewportViewportF
Set(ref GlobalTransformStruct, ref ViewportF)
public void Set(ref GlobalTransformStruct transforms, ref ViewportF viewport)
Parameters
transformsGlobalTransformStructviewportViewportF
Update()
Updates all the internal metrices.
public void Update()
UpdatePerFrameData(DeviceContextProxy)
Call to update constant buffer for per frame
public void UpdatePerFrameData(DeviceContextProxy deviceContext)
Parameters
deviceContextDeviceContextProxy
UpdatePerFrameData(bool, bool, DeviceContextProxy)
Call to update constant buffer for per frame
public void UpdatePerFrameData(bool updateGlobalTransform, bool updateLights, DeviceContextProxy deviceContext)
Parameters
updateGlobalTransformboolupdateLightsbooldeviceContextDeviceContextProxy