Unit CastleRenderContext

Description

Rendering context state.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TScissor Scissor to clip displayed things, in addition to the global scissor affected by TRenderContext.ScissorEnable / TRenderContext.ScissorDisable.
Class TRenderContext The OpenGL / OpenGLES context state.

Functions and Procedures

function PerspectiveProjection(const fovy, aspect, ZNear, ZFar: Single): TMatrix4;
function OrthoProjection(const Dimensions: TFloatRectangle; const ZNear: Single = -1; const ZFar: Single = 1): TMatrix4;
function FrustumProjection(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4;

Types

TClearBuffer = (...);
TClearBuffers = set of TClearBuffer;
TDepthRange = (...);
TColorChannel = 0..3;
TColorChannels = set of TColorChannel;

Variables

RenderContext: TRenderContext;

Description

Functions and Procedures

function PerspectiveProjection(const fovy, aspect, ZNear, ZFar: Single): TMatrix4;

Calculate projection matrix, and set RenderContext.ProjectionMatrix to given value.

For PerspectiveProjection, ZFar may have special ZFarInfinity value to create a perspective projection with far plane set at infinity. Useful e.g. for z-fail shadow volumes.

function OrthoProjection(const Dimensions: TFloatRectangle; const ZNear: Single = -1; const ZFar: Single = 1): TMatrix4;
 
function FrustumProjection(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4;
 

Types

TClearBuffer = (...);
 
Values
  • cbColor
  • cbDepth
  • cbStencil
TClearBuffers = set of TClearBuffer;
 
TDepthRange = (...);

Possible values of TRenderContext.DepthRange.

Values
  • drFull
  • drNear
  • drFar
TColorChannel = 0..3;
 
TColorChannels = set of TColorChannel;
 

Variables

RenderContext: TRenderContext;

Current OpenGL / OpenGLES context state. Only access it during the rendering, i.e. in TCastleUserInterface.Render.

TODO: In the future, this global singleton may be removed, and this may be accessible instead through a new TCastleUserInterface.Render parameter.


Generated by PasDoc 0.16.0.