Class CameraDrawContext
Handle how a camera render a scene.
Implements
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class CameraDrawContext : DrawContext, IDisposable
  Constructors
CameraDrawContext(RenderPipeline, CameraRenderPath, Camera)
Initializes a new instance of the CameraDrawContext class.
Declaration
public CameraDrawContext(RenderPipeline renderPipeline, CameraRenderPath cameraRenderPath, Camera camera)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RenderPipeline | renderPipeline | The pipeline reference.  | 
      
| CameraRenderPath | cameraRenderPath | The renderpath reference.  | 
      
| Camera | camera | The camera.  | 
      
Fields
AutoExposure
Calculating the auto exposure in real time (only compute shader).
Declaration
protected AutoExposure AutoExposure
  Field Value
| Type | Description | 
|---|---|
| AutoExposure | 
Camera
The camera reference.
Declaration
public readonly Camera Camera
  Field Value
| Type | Description | 
|---|---|
| Camera | 
ComputeDepthBounds
Compute the min/max depth bounds of the camera.
Declaration
protected ComputeDepthBounds ComputeDepthBounds
  Field Value
| Type | Description | 
|---|---|
| ComputeDepthBounds | 
settings
The application settings.
Declaration
protected Settings settings
  Field Value
| Type | Description | 
|---|---|
| Settings | 
Properties
AnyPostProcessingInLastFrame
Gets or sets a value indicating whether any postprocessing graph is enabled.
Declaration
public bool AnyPostProcessingInLastFrame { get; set; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
Aperture
Gets the aperture of the camera in f-stops (Default f/16).
Declaration
public float Aperture { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
Remarks
This setting controls how open or closed the camera system's aperture is. Since an f-stop indicate the ratio of the lens' focal length to the diameter of the entrance pupil, high-values (ƒ/16) indicate a small aperture and small values (ƒ/1.4) indicate a wide aperture. In addition to the exposition, the aperture setting controls the depth of field.
BackgroundColor
Gets the color of the background.
Declaration
public Color BackgroundColor { get; }
  Property Value
| Type | Description | 
|---|---|
| Color | The background color of the camera if it was set, or the RenderManager default background color.  | 
      
BoundingFrustum
Gets the boundingFrustum of this camera.
Declaration
public override BoundingFrustum BoundingFrustum { get; }
  Property Value
| Type | Description | 
|---|---|
| BoundingFrustum | 
Overrides
CameraRenderPath
Gets the specify renderpath.
Declaration
public CameraRenderPath CameraRenderPath { get; }
  Property Value
| Type | Description | 
|---|---|
| CameraRenderPath | 
ClearFlags
Gets Clear flags used for clean FrameBuffer, stencilBuffer and ZBuffer.
Declaration
public override ClearFlags ClearFlags { get; }
  Property Value
| Type | Description | 
|---|---|
| ClearFlags | 
Overrides
ClearValue
Gets the Clear value for the camera.
Declaration
public override ClearValue ClearValue { get; }
  Property Value
| Type | Description | 
|---|---|
| ClearValue | 
Overrides
CullingSystem
Gets the culling system used by the Render System. A camera could specify the Culling System that it will use.
Declaration
public override CullingSystem CullingSystem { get; }
  Property Value
| Type | Description | 
|---|---|
| CullingSystem | 
Overrides
Exposure
Gets the Exposure for this camera.
Declaration
public float Exposure { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
FarPlane
Gets the frustum far plane.
Declaration
public override float FarPlane { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
Overrides
FocalDistance
Gets the focal Distance used with Depth Of Field Effect to choose the focus distance from the camera (m).
Declaration
public float FocalDistance { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
FocalLength
Gets the focal length. The simulated distance between the lens and the sensor of the camera. Larger values give a narrower field of view.
Declaration
public float FocalLength { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
Jitter
Gets the current frame camera jittering.
Declaration
public Vector2 Jitter { get; }
  Property Value
| Type | Description | 
|---|---|
| Vector2 | 
MultiviewEyeCount
Gets the number of views of this drawcontext.
Declaration
public override int MultiviewEyeCount { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Overrides
MultiviewInstancingCount
Gets the number of instance count to render all views.
Declaration
public override int MultiviewInstancingCount { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Overrides
Remarks
In a Multiview with RenderTargetIndex strategy the number is MultiviewEyeCount, but in ViewIndex strategy the instanceCount is 1.
MultiviewPosition
Gets the Multiview position array.
Declaration
public override Vector4[] MultiviewPosition { get; }
  Property Value
| Type | Description | 
|---|---|
| Vector4[] | 
Overrides
MultiviewProjection
Gets the Multiview projection transform array.
Declaration
public override Matrix4x4[] MultiviewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4[] | 
Overrides
MultiviewProjectionInverse
Gets the Multiview view projection inverse transform array.
Declaration
public override Matrix4x4[] MultiviewProjectionInverse { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4[] | 
Overrides
MultiviewView
Gets the Multiview view transform array.
Declaration
public override Matrix4x4[] MultiviewView { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4[] | 
Overrides
MultiviewViewProjection
Gets the Multiview view projection transform array.
Declaration
public override Matrix4x4[] MultiviewViewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4[] | 
Overrides
NearPlane
Gets the frustum near plane.
Declaration
public override float NearPlane { get; }
  Property Value
| Type | Description | 
|---|---|
| float | 
Overrides
Position
Gets the position.
Declaration
public override Vector3 Position { get; }
  Property Value
| Type | Description | 
|---|---|
| Vector3 | 
Overrides
PreviousJitter
Gets the previous frame camera jittering.
Declaration
public Vector2 PreviousJitter { get; }
  Property Value
| Type | Description | 
|---|---|
| Vector2 | 
PreviousViewProjection
Gets the previews viewProjection matrix.
Declaration
public Matrix4x4 PreviousViewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Projection
Gets the projection transform.
Declaration
public override Matrix4x4 Projection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
ProjectionInverse
Gets the projection inverse matrix.
Declaration
public override Matrix4x4 ProjectionInverse { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
RenderProjection
Gets the render projection transform.
Declaration
public override Matrix4x4 RenderProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
RenderViewProjection
Gets the render view projection transform.
Declaration
public override Matrix4x4 RenderViewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
ScreenViewport
Gets the screenviewport.
Declaration
public Viewport ScreenViewport { get; }
  Property Value
| Type | Description | 
|---|---|
| Viewport | 
TemporalAntiAliasingEnabled
Gets or sets a value indicating whether the DrawContext uses temporal anti-aliasing so is neccesary jittering the camera.
Declaration
public bool TemporalAntiAliasingEnabled { get; set; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
TemporalHistory
Gets or sets the temporal anti-aliansing history buffer.
Declaration
public Texture TemporalHistory { get; protected set; }
  Property Value
| Type | Description | 
|---|---|
| Texture | 
Transform
Gets the view object transform.
Declaration
public override Transform3D Transform { get; }
  Property Value
| Type | Description | 
|---|---|
| Transform3D | 
Overrides
UnjitteredProjection
Gets the unjittered projection matrix.
Declaration
public Matrix4x4 UnjitteredProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
UnjitteredViewProjection
Gets the unjittered view projection matrix.
Declaration
public Matrix4x4 UnjitteredViewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
View
Gets the view transform.
Declaration
public override Matrix4x4 View { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
ViewCount
Gets the number of views of this draw context.
Declaration
public override int ViewCount { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Overrides
Remarks
A draw context can contains several views (cascade shadows, point light shadows, reflection probe, etc...).
ViewIndex
Gets the View index of this draw context.
Declaration
public override int ViewIndex { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
Overrides
Remarks
A draw context can contains several views (cascade shadows, point light shadows, reflection probe, etc...).
ViewInverse
Gets the view inverse matrix.
Declaration
public override Matrix4x4 ViewInverse { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
ViewProjection
Gets the view projection transform.
Declaration
public override Matrix4x4 ViewProjection { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
ViewProjectionInverse
Gets the view projection inverse transform.
Declaration
public override Matrix4x4 ViewProjectionInverse { get; }
  Property Value
| Type | Description | 
|---|---|
| Matrix4x4 | 
Overrides
Methods
BeforeRender()
Execute actions needed before camera render.
Declaration
public override bool BeforeRender()
  Returns
| Type | Description | 
|---|---|
| bool | True if the camera should be rendered.  | 
      
Overrides
Destroy()
Destroy the resources.
Declaration
protected override void Destroy()
  Overrides
FilterObjects(RenderObjectInfo)
Indicates if this object must be filtered.
Declaration
public override bool FilterObjects(RenderObjectInfo renderObjectInfo)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RenderObjectInfo | renderObjectInfo | The object info to filter.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | True if the object must be filtered.  | 
      
Overrides
GenerateTemporalHistoryTexture()
Create the temporal history texture (Temporal Anti-Aliasing pruposes).
Declaration
protected void GenerateTemporalHistoryTexture()
  GetAdditionalDirectives()
Refresh the additional directives.
Declaration
protected override List<string> GetAdditionalDirectives()
  Returns
| Type | Description | 
|---|---|
| List<string> | The additional directives.  | 
      
Overrides
GetTexture(TextureSemantic, int)
Gets the texture.
Declaration
public override Texture GetTexture(TextureInfo.TextureSemantic textureSemantic, int textureIndex)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TextureInfo.TextureSemantic | textureSemantic | Texture semantic.  | 
      
| int | textureIndex | Texture index.  | 
      
Returns
| Type | Description | 
|---|---|
| Texture | The found texture.  | 
      
Overrides
ProcessAutoDepthBounds()
Compute the auto depth bounds of this camera using the latest frame.
Declaration
protected void ProcessAutoDepthBounds()
  ProcessAutoExposure()
Process the auto exposure.
Declaration
protected void ProcessAutoExposure()
  ProcessFrameBuffer()
Create resources associated to the framebuffer.
Declaration
protected bool ProcessFrameBuffer()
  Returns
| Type | Description | 
|---|---|
| bool | True if the framebuffer is Ok.  | 
      
Render(CommandBuffer)
Execute the draw action of draw context.
Declaration
public override void Render(CommandBuffer commandBuffer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CommandBuffer | commandBuffer | The command buffer used to render.  | 
      
Overrides
SetPerViewEngineParameters()
Collect shader resources per view.
Declaration
protected override void SetPerViewEngineParameters()