CAST II Game Engine

   DESCRIPTION       FEATURES       SCREENSHOTS       FORUMS       DOCUMENTATION       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Unit C2Materials

Description

CAST II Engine materials unit

(C) 2006 George "Mirage" Bakhtadze. www.casteng.com
The source code may be used under either MPL 1.1 or LGPL 2.1 license. See included license.txt file
Unit contains material base class

Classes, Interfaces and Objects

NameDescription
Class TMaterial 
Class TRenderPass 
Class TTechnique 

Functions and Procedures

Overview

function GetBlendingState(Enabled: Boolean; SrcBlend, DestBlend, AlphaRef, ATestFunc, Operation: Integer): TBlendingState;
function GetFillShadeMode(FillMode, ShadeMode, CullMode: Integer; ColorMask: Cardinal): TFillShadeMode;
function GetLightingState(SpecularMode: Integer; NormalizeNormals, Enabled: Boolean; GlobalAmbient: BaseTypes.TColor): TLightingState;
function GetPointEdgeState(PointSprite, PointScale, EdgeAntialias: Boolean): TPointEdgeState;
function GetStencilstate(SFailOp, ZFailOp, PassOp, STestFunc: Integer): TStencilState;
function GetTextureWrap(Set0, Set1, Set2, Set3, Set4, Set5, Set6, Set7: Cardinal): TTextureWrap;
function GetZBufferState(ZWrite: Boolean; ZTestFunc, ZBias: Integer): TZBufferState;

Description

function GetBlendingState(Enabled: Boolean; SrcBlend, DestBlend, AlphaRef, ATestFunc, Operation: Integer): TBlendingState;

 

function GetFillShadeMode(FillMode, ShadeMode, CullMode: Integer; ColorMask: Cardinal): TFillShadeMode;

 

function GetLightingState(SpecularMode: Integer; NormalizeNormals, Enabled: Boolean; GlobalAmbient: BaseTypes.TColor): TLightingState;

 

function GetPointEdgeState(PointSprite, PointScale, EdgeAntialias: Boolean): TPointEdgeState;

 

function GetStencilstate(SFailOp, ZFailOp, PassOp, STestFunc: Integer): TStencilState;

 

function GetTextureWrap(Set0, Set1, Set2, Set3, Set4, Set5, Set6, Set7: Cardinal): TTextureWrap;

 

function GetZBufferState(ZWrite: Boolean; ZTestFunc, ZBias: Integer): TZBufferState;

 

Types

Overview

TBlendingState = record Enabled: Boolean; CRC, AlphaRef, ATestFunc, SrcBlend, DestBlend, Operation: Integer; end;
TFillShadeMode = record CRC, FillMode, ShadeMode, CullMode: Integer; ColorMask: Cardinal; end;
TLightingState = record CRC: Integer; GlobalAmbient: BaseTypes.TColor; SpecularMode: SmallInt; NormalizeNormals, Enabled: Boolean; end;
TPointEdgeState = record CRC: Integer; PointSprite, PointScale, EdgeAntialias: Boolean; end;
TStage = record TextureIndex: Integer; ColorArg0, AlphaArg0: Longword; ColorOp, ColorArg1, ColorArg2: Longword; InvertColorArg1, InvertColorArg2: Boolean; AlphaOp, AlphaArg1, AlphaArg2: Longword; InvertAlphaArg1, InvertAlphaArg2: Boolean; TAddressing: Longword; StoreToTemp: Boolean; MipLODBias: Single; MaxMipLevel, MaxAnisotropy, Filtering: Longword; UVSource, TTransform: Longword; TextureBorder: BaseTypes.TColor; TextureMatrixType: TTextureMatrixType; TextureMatrixBias: Single; Camera: TCamera; end;
TStencilState = record CRC, SFailOp, ZFailOp, PassOp, STestFunc: Integer; end;
TTextureWrap = record CRC: Cardinal; CoordSet: TTWrapCoordSet; end;
TTWrapCoordSet = array[0..MaxTextureCoordSets-1] of Cardinal;
TZBufferState = record CRC, ZTestFunc, ZBias: Integer; ZWrite: Boolean; end;

Description

TBlendingState = record Enabled: Boolean; CRC, AlphaRef, ATestFunc, SrcBlend, DestBlend, Operation: Integer; end;

 

TFillShadeMode = record CRC, FillMode, ShadeMode, CullMode: Integer; ColorMask: Cardinal; end;

 

TLightingState = record CRC: Integer; GlobalAmbient: BaseTypes.TColor; SpecularMode: SmallInt; NormalizeNormals, Enabled: Boolean; end;

 

TPointEdgeState = record CRC: Integer; PointSprite, PointScale, EdgeAntialias: Boolean; end;

 

TStage = record TextureIndex: Integer; ColorArg0, AlphaArg0: Longword; ColorOp, ColorArg1, ColorArg2: Longword; InvertColorArg1, InvertColorArg2: Boolean; AlphaOp, AlphaArg1, AlphaArg2: Longword; InvertAlphaArg1, InvertAlphaArg2: Boolean; TAddressing: Longword; StoreToTemp: Boolean; MipLODBias: Single; MaxMipLevel, MaxAnisotropy, Filtering: Longword; UVSource, TTransform: Longword; TextureBorder: BaseTypes.TColor; TextureMatrixType: TTextureMatrixType; TextureMatrixBias: Single; Camera: TCamera; end;

 

TStencilState = record CRC, SFailOp, ZFailOp, PassOp, STestFunc: Integer; end;

 

TTextureWrap = record CRC: Cardinal; CoordSet: TTWrapCoordSet; end;

 

TTWrapCoordSet = array[0..MaxTextureCoordSets-1] of Cardinal;

 

TZBufferState = record CRC, ZTestFunc, ZBias: Integer; ZWrite: Boolean; end;

 

Enumerations

TPassCondition
Pass running conditions enumeration
 pcOnceRun the pass once for an item
 pcEachLightRun the pass for each light affecting the currently rendering item
TTextureMatrixType
Texture matrix setting
 tmNoneNo texture matrix
 tmCameraInverseInverse camera view matrix
 tmMirrorPredefined texture matrix for a mirror implementation
 tmShadowMapPredefined texture matrix for shadow maps implementation
 tmScaleScale matrix by TextureMatrixBias
 tmCustomTexture matrix for the given coordinate set will be retrieved from the item currently drawn with the RetrieveTextureMatrix delegate

Constants

Overview

cmAlpha = 1;
cmBlue = 8;
cmGreen = 4;
cmRed = 2;
sivNull = -2;
sivUnresolved = -1;
TextureMatrixTypesEnum = 'None' + StringDelimiter + 'Camera inverse' + StringDelimiter + 'Mirror' + StringDelimiter + 'Shadow map' + StringDelimiter + 'Scale' + StringDelimiter + 'Custom';
tivNull = -2;
tivRenderTarget = -16;
tivUnresolved = -1;
TPassConditionsEnum = 'Once' + StringDelimiter + 'For each light';

Description

cmAlpha = 1;

Color mask

cmBlue = 8;

 

cmGreen = 4;

 

cmRed = 2;

 

sivNull = -2;

No Shader specified for the given render pass

sivUnresolved = -1;

Shader unresolved yet or its resolution failed

TextureMatrixTypesEnum = 'None' + StringDelimiter + 'Camera inverse' + StringDelimiter + 'Mirror' + StringDelimiter + 'Shadow map' + StringDelimiter + 'Scale' + StringDelimiter + 'Custom';

Texture matrix type enumeration string

tivNull = -2;

No texture specified for the given stage

tivRenderTarget = -16;

Texture is a render target

tivUnresolved = -1;

Texture unresolved yet or its resolution failed

TPassConditionsEnum = 'Once' + StringDelimiter + 'For each light';

Pass running conditions enumeration string

Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com