LZScene

Форк
0
/
GLRenderContextInfo.pas 
122 строки · 4.5 Кб
1
//
2
// This unit is part of the GLScene Engine https://github.com/glscene
3
//
4
{
5
   Stores contextual info useful during rendering methods.
6

7
  History :  
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
15
    
16
}
17
unit GLRenderContextInfo;
18

19
interface
20

21
{$I GLScene.inc}
22

23
uses
24
  GLPersistentClasses, GLVectorGeometry, GLState,
25
  GLPipelineTransformation, GLColor;
26

27
type
28

29
  TDrawState = (dsRendering, dsPicking, dsPrinting);
30

31
  TGLSize = record
32
    cx: Longint;
33
    cy: Longint;
34
  end;
35

36
  // TGLObjectsSorting
37
  //
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
43
  the camera first.
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
47
  the camera first.
48
        }
49
  TGLObjectsSorting = (osInherited, osNone,
50
    osRenderFarthestFirst, osRenderBlendedLast,
51
    osRenderNearestFirst);
52

53
  // TGLVisibilityCulling
54
  //
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);
71

72
  // TRenderContextClippingInfo
73
  //
74
  TRenderContextClippingInfo = record
75
    origin: TVector;
76
    clippingDirection: TVector;
77
    viewPortRadius: Single; // viewport bounding radius per distance unit
78
    nearClippingDistance: Single;
79
    farClippingDistance: Single;
80
    frustum: TFrustum;
81
  end;
82

83
  // TGLRenderContextInfo
84
  //
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;
92
    renderDPI: Integer;
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;
105
    bufferFog: 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;
117
  end;
118
  PRenderContextInfo = ^TGLRenderContextInfo;
119

120
implementation
121

122
end.
123

124

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.