2
// This unit is part of the GLScene Engine https://github.com/glscene
5
Stores contextual info useful during rendering methods.
8
23/08/10 - Yar - Removed modelViewMatrix, lightDisableCounter. Added PipelineTransformation.
9
22/02/10 - Yar - Added bufferLighting, bufferFog, bufferDepthTest to TGLRenderContextInfo
10
14/03/09 - DanB - Removed IsVolumeClipped functions, instead replaced with
11
IsVolumeClipped functions in GLVectorGeometry.pas that use TFrustrum
12
09/10/08 - DanB - Added TRenderContextClippingInfo + IsVolumeClipped
13
functions from GLVectorGeometry.pas, added nearClippingDistance
14
05/10/08 - DanB - Created from GLTexture.pas split
17
unit GLRenderContextInfo;
24
GLPersistentClasses, GLVectorGeometry, GLState,
25
GLPipelineTransformation, GLColor;
29
TDrawState = (dsRendering, dsPicking, dsPrinting);
38
{ Determines if objects are sorted, and how.
39
Sorting is done level by level (and not for all entities), values are :
40
osInherited : use inherited sorting mode, defaults to osRenderFarthestFirst
41
osNone : do not sort objects.
42
osRenderFarthestFirst : render objects whose Position is the farthest from
44
osRenderBlendedLast : opaque objects are not sorted and rendered
45
first, blended ones are rendered afterwards and depth sorted.
46
osRenderNearestFirst : render objects whose Position is the nearest to
49
TGLObjectsSorting = (osInherited, osNone,
50
osRenderFarthestFirst, osRenderBlendedLast,
51
osRenderNearestFirst);
53
// TGLVisibilityCulling
55
{ Determines the visibility culling mode.
56
Culling is done level by level, allowed values are:
57
vcInherited : use inherited culling value, if selected for the root
58
level, defaults to vcNone
59
vcNone : no visibility culling is performed
60
vcObjectBased : culling is done on a per-object basis, each object may
61
or may not be culled base on its own AxisAlignedDimensions,
62
culling has no impact on the visibility of its children
63
vcHierarchical : culling is performed hierarchically, using hierarchical
64
bounding boxes, if a parent is culled, all of its children, whatever their
65
culling options are invisible.
66
Depending on the structure of your scene the most efficient culling
67
method will be either vcObjectBased or vcHierarchical. Also note that if
68
you use many objects with "static" geometry and have a T&L graphics
69
board, it may be faster not to cull at all (ie. leave this to the hardware). }
70
TGLVisibilityCulling = (vcInherited, vcNone, vcObjectBased, vcHierarchical);
72
// TRenderContextClippingInfo
74
TRenderContextClippingInfo = record
76
clippingDirection: TVector;
77
viewPortRadius: Single; // viewport bounding radius per distance unit
78
nearClippingDistance: Single;
79
farClippingDistance: Single;
83
// TGLRenderContextInfo
85
{ Stores contextual info useful during rendering methods. }
86
TGLRenderContextInfo = record
87
scene: TObject; //usually TGLScene
88
buffer: TObject; //usually TGLSceneBuffer
89
cameraPosition: TVector;
90
cameraDirection, cameraUp: TVector;
91
viewPortSize: TGLSize;
93
materialLibrary: TObject; //usually TGLMaterialLibrary;
94
lightmapLibrary: TObject; //usually TGLMaterialLibrary;
95
fogDisabledCounter: Integer;
96
drawState: TDrawState;
97
objectsSorting: TGLObjectsSorting;
98
visibilityCulling: TGLVisibilityCulling;
99
GLStates: TGLStateCache;
100
PipelineTransformation: TGLTransformation;
101
rcci: TRenderContextClippingInfo;
102
sceneAmbientColor: TColorVector;
103
bufferFaceCull: Boolean;
104
bufferLighting: Boolean;
106
bufferDepthTest: Boolean;
107
proxySubObject: Boolean;
108
ignoreMaterials: Boolean;
109
ignoreBlendingRequests: Boolean;
110
ignoreDepthRequests: Boolean;
111
amalgamating: Boolean;
112
lights: TPersistentObjectList;
113
afterRenderEffects: TPersistentObjectList;
114
currentMaterialLevel: TGLMaterialLevel;
115
primitiveMask: TGLMeshPrimitives;
116
orderCounter: Integer;
118
PRenderContextInfo = ^TGLRenderContextInfo;