File: CastleRenderer.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (561 lines) | stat: -rw-r--r-- 34,693 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleRenderer</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<h1 class="unit">Unit CastleRenderer</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Uses">Uses</a></td><td><a class="section" href="#PasDoc-Classes">Classes, Interfaces, Objects and Records</a></td><td>Functions and Procedures</td><td><a class="section" href="#PasDoc-Types">Types</a></td><td><a class="section" href="#PasDoc-Constants">Constants</a></td><td><a class="section" href="#PasDoc-Variables">Variables</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="description">Description</h2>
<p>
VRML/X3D low-level rendering (<a class="normal" href="CastleRenderer.TGLRenderer.html">TGLRenderer</a>). You usually don't want to use this renderer directly, you should rather use <a class="normal" href="CastleScene.TCastleScene.html">TCastleScene</a> that wraps this renderer and gives you simple method to render whole scene.

<p>The overview of this class can also be found in engine documentation [<a  href="http://castle-engine.sourceforge.net/engine_doc.php">http://castle-engine.sourceforge.net/engine_doc.php</a>] in chapter &quot;OpenGL rendering&quot;, section &quot;Basic OpenGL rendering&quot;.

<p><b>Usage:</b>

<p></p>

<ol class="paragraph_spacing">
  <li value="1"><p> Call <a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a> for all the states that you want to later render. The order of calling <a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a> methods doesn't matter, also you are free to prepare states that you will not actually use later. Of course a state, once prepared, may be used in rendering as many times as you want.

<p>It's important that you have to prepare <i>every state that you plan to later render</i>. During rendring the state must have exactly the same (fields, properties) values as when it was prepared. In particular, it must have the same pointers to nodes Last*/Active* and their contents also must be the same. <a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a> may save some associations between objects and OpenGL resources, so it's important that the same pointer must always point to the same object (until it's unprepared).

<p><a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a> requires active OpenGL context. It doesn't modify OpenGL state (only allocates some resources like texture names). It cannot be called inside a display list. </p></li>
  <li value="2"><p> When you want to release resources, you should call TGLRenderer.Unprepare on nodes that you want to change or free. This should be used with nodes that were passed as Last*/Active* in some State for <a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a>.

<p>Note: before engine 2.0.0 release, it was allowed to free some VRML nodes <i>before</i> unpreparing them. This was depending on the fact that during unprepare we will not actually dereference pointers (not look at nodes contents etc.). This is forbidden since 2010-03-25, as it causes some difficult problems (like TGLRendererShaderProgram.Destroy really needs to access some VRML nodes), and was inherently unclean and unsafe (it's not a nice programming practice to have a pointers that may be invalid). </p></li>
  <li value="3"><p> To start actual rendering, call <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderBegin">TGLRenderer.RenderBegin</a>. To end rendering, call <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderEnd">TGLRenderer.RenderEnd</a>. Between these calls, you should not touch OpenGL state yourself &mdash; the renderer may depend that every state change goes through it. At the end of <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderEnd">TGLRenderer.RenderEnd</a>, the OpenGL state is restored just as it was before <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderBegin">TGLRenderer.RenderBegin</a>. </p></li>
  <li value="4"><p> Between <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderBegin">TGLRenderer.RenderBegin</a> and <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderEnd">TGLRenderer.RenderEnd</a> you should render the shapes by calling RenderShape.

<p>Remember that you can render only shapes that have Shape.State prepared by <a class="normal" href="CastleRenderer.TGLRenderer.html#Prepare">TGLRenderer.Prepare</a>. </p></li>
  <li value="5"><p> Since the first prepare / render calls, this renderer assumes it's always called in the same OpenGL context. To break association with OpenGL context call <a class="normal" href="CastleRenderer.TGLRenderer.html#UnprepareAll">TGLRenderer.UnprepareAll</a> (this is like calling TGLRenderer.Unprepare on every prepared thing + clearing some remaining resources). </p></li>
</ol>

<p>

<p><b>OpenGL state affecting VRML rendering:</b>

<p>Some OpenGL state is unconditionally reset by <a class="normal" href="CastleRenderer.TGLRenderer.html#RenderBegin">TGLRenderer.RenderBegin</a>.

<p>There's also some OpenGL state that we let affect our rendering. This allows you to customize rendering by using normal OpenGL commands.

<p></p>

<ul class="paragraph_spacing">
  <li><p>First of all, current matrix values (MODELVIEW, PROJECTION and TEXTURE) affect our rendering as usual.

<p>So you can move the rendered VRML model by normal OpenGL matrix transformations, you can even affect rendered texture coords by your own texture matrix etc.</p></li>
  <li><p>Current glPolygonMode.

<p>Of course for normal rendering you want to render polygons (both sides, GL_FRONT_AND_BACK) with GL_FILL. But you can change it to get wireframe model view.</p></li>
  <li><p>Blending settings (GL_BLEND enabled state, glBlendFunc), and glDepthMask.

<p>These are typically controlled by higher-level renderer (Scene) to allow rendering scenes with both tranparent and opaque objects. Only such higher-level renderer may control them, as only it controls the order of rendering shapes, which is important for rendering tranparent shapes.</p></li>
  <li><p>Current GL_FOG_HINT.

<p>Just like for any other OpenGL program, you may want to set this to GL_NICEST (if you have to render models that may look bad when fog is interpolated without perspective correction).</p></li>
  <li><p>glFrontFace is assumed to be CCW (OpenGL default) but not manipulated by this unit anywhere.

<p>So our normals passed to OpenGL always point from CCW side. Even if you supplied in VRML file normals pointing from CW (indicated e.g. by IndexedFaceSet.ccw = FALSE field in VRML 97), we will internally invert them and pass inverted ones to OpenGL. And when culling faces, we switch using <code>glCullFace( GL_BACK / GL_FRONT)</code>, not by switching front face.

<p>Why so much work was done to always work with front face = CCW assumption? Because this is very handy when you render mirrors by using <code>Scale(1, 1, -1)</code> trick. See [<a  href="http://www.opengl.org/resources/code/samples/mjktips/Reflect.html">http://www.opengl.org/resources/code/samples/mjktips/Reflect.html</a>] and example program <code>castle_game_engine/examples/vrml/plane_mirror_and_shadow.lpr</code>. With such strange scale, CCW and CW invert places. Sides that were CCW normally are now CW. This means that you want to call <code>glFrontFace(GL_CW)</code> temporarily when rendering scene in the mirror. This way scene in the mirror will have correct normals and backface culling.

<p>Since we don't touch <code>glFrontFace</code> anywhere, this is possible to you. And you can reuse resources for the scene in the mirror. </p></li>
</ul>

<p>

<p><b>Rendered TrianglesCount and VerticesCount:</b>

<p>This renderer uses the same triangles and vertices counts as calculated by TAbstractGeometryNode.Triangulate, TAbstractGeometryNode.LocalTriangulate, <a class="normal" href="X3DNodes.TAbstractGeometryNode.html#TrianglesCount">TAbstractGeometryNode.TrianglesCount</a>, <a class="normal" href="X3DNodes.TAbstractGeometryNode.html#VerticesCount">TAbstractGeometryNode.VerticesCount</a>, with OverTriangulate = <code>True</code>.

<p>Note that it doesn't mean that we actually call TAbstractGeometryNode.Triangulate for VRML rendering. In fact, currently we don't, and it allows us to be much faster (for starters, rendering by indexes, or quad strips, that would not be possible by generic implementation calling TAbstractGeometryNode.Triangulate). But our rendering methods generate the same triangles as TAbstractGeometryNode.Triangulate.

<p>Although for debug purposes, we have a renderer using <a class="normal" href="CastleShapes.TShape.html#LocalTriangulate">TShape.LocalTriangulate</a>, see notes about USE_VRML_TRIANGULATION in the source code.</p>
<a name="PasDoc-Uses"></a><h2 class="uses">Uses</h2>
<ul class="useslist"><li>Classes</li><li>SysUtils</li><li><a  href="CastleUtils.html">CastleUtils</a></li><li><a  href="CastleVectors.html">CastleVectors</a></li><li>GL</li><li>GLU</li><li>GLExt</li><li><a  href="X3DFields.html">X3DFields</a></li><li><a  href="X3DNodes.html">X3DNodes</a></li><li><a  href="X3DLexer.html">X3DLexer</a></li><li><a  href="CastleImages.html">CastleImages</a></li><li><a  href="CastleGLUtils.html">CastleGLUtils</a></li><li>CastleRendererInternalLights</li><li><a  href="CastleGLShaders.html">CastleGLShaders</a></li><li><a  href="CastleGLImages.html">CastleGLImages</a></li><li><a  href="CastleVideos.html">CastleVideos</a></li><li><a  href="X3DTime.html">X3DTime</a></li><li><a  href="CastleShapes.html">CastleShapes</a></li><li><a  href="CastleGLCubeMaps.html">CastleGLCubeMaps</a></li><li><a  href="CastleClassUtils.html">CastleClassUtils</a></li><li><a  href="CastleDDS.html">CastleDDS</a></li><li><a  href="Castle3D.html">Castle3D</a></li><li>FGL</li><li><a  href="CastleGeometryArrays.html">CastleGeometryArrays</a></li><li><a  href="CastleArraysGenerator.html">CastleArraysGenerator</a></li><li>CastleRendererInternalShader</li><li><a  href="X3DShadowMaps.html">X3DShadowMaps</a></li><li>CastleRendererInternalTextureEnv</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Classes"></a><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TRenderingAttributes.html"><code>TRenderingAttributes</code></a></td>
<td class="itemdesc">Various properties that control rendering done with <a class="normal" href="CastleRenderer.TGLRenderer.html">TGLRenderer</a>.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TTextureImageCache.html"><code>TTextureImageCache</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TTextureVideoCache.html"><code>TTextureVideoCache</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TTextureCubeMapCache.html"><code>TTextureCubeMapCache</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TTexture3DCache.html"><code>TTexture3DCache</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TTextureDepthOrFloatCache.html"><code>TTextureDepthOrFloatCache</code></a></td>
<td class="itemdesc">Cached depth or float texture.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TShapeCache.html"><code>TShapeCache</code></a></td>
<td class="itemdesc">Cached shape resources.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TShaderProgramCache.html"><code>TShaderProgramCache</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLRendererContextCache.html"><code>TGLRendererContextCache</code></a></td>
<td class="itemdesc">Cache used by <a class="normal" href="CastleRenderer.TGLRenderer.html">TGLRenderer</a> instances to share OpenGL resources, like textures.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TResourceRenderer.html"><code>TResourceRenderer</code></a></td>
<td class="itemdesc">Base class for <a class="normal" href="CastleRenderer.TGLRenderer.html">TGLRenderer</a> helper.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TResourceRendererList.html"><code>TResourceRendererList</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLTextureNode.html"><code>TGLTextureNode</code></a></td>
<td class="itemdesc">OpenGL handling for VRML/X3D texture node.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLTextureNodes.html"><code>TGLTextureNodes</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLSingleTextureNode.html"><code>TGLSingleTextureNode</code></a></td>
<td class="itemdesc">Common class for all single (not multi-texture) texture nodes.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLMultiTextureNode.html"><code>TGLMultiTextureNode</code></a></td>
<td class="itemdesc">Handler for <a class="normal" href="X3DNodes.TMultiTextureNode.html">TMultiTextureNode</a>.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLImageTextureNode.html"><code>TGLImageTextureNode</code></a></td>
<td class="itemdesc">Handler for <a class="normal" href="X3DNodes.TAbstractTexture2DNode.html">TAbstractTexture2DNode</a> with image (not a video).</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLMovieTextureNode.html"><code>TGLMovieTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLRenderedTextureNode.html"><code>TGLRenderedTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLCubeMapTextureNode.html"><code>TGLCubeMapTextureNode</code></a></td>
<td class="itemdesc">Common handling for texture nodes of <a class="normal" href="X3DNodes.TAbstractEnvironmentTextureNode.html">TAbstractEnvironmentTextureNode</a>.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLComposedCubeMapTextureNode.html"><code>TGLComposedCubeMapTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLImageCubeMapTextureNode.html"><code>TGLImageCubeMapTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLGeneratedCubeMapTextureNode.html"><code>TGLGeneratedCubeMapTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGL3DTextureNode.html"><code>TGL3DTextureNode</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLGeneratedShadowMap.html"><code>TGLGeneratedShadowMap</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLShaderTexture.html"><code>TGLShaderTexture</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TBumpMappingRenderer.html"><code>TBumpMappingRenderer</code></a></td>
<td class="itemdesc">Rendering with bump mapping.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TBumpMappingRendererList.html"><code>TBumpMappingRendererList</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TX3DGLSLProgram.html"><code>TX3DGLSLProgram</code></a></td>
<td class="itemdesc">GLSL program integrated with VRML/X3D renderer.</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TX3DRendererShape.html"><code>TX3DRendererShape</code></a></td>
<td class="itemdesc">Shape that can be rendered.</td>
</tr>
<tr class="list2">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.TGLRenderer.html"><code>TGLRenderer</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold" href="CastleRenderer.EGLRendererror.html"><code>EGLRendererror</code></a></td>
<td class="itemdesc">&nbsp;</td>
</tr>
</table>
<a name="PasDoc-Types"></a><h3 class="summary">Types</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TBeforeGLVertexProc">TBeforeGLVertexProc</a></b> = procedure (Node: <a  href="X3DNodes.TAbstractGeometryNode.html">TAbstractGeometryNode</a>; const Vert: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>) of object;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TShadersRendering">TShadersRendering</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TCullFace">TCullFace</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TBumpMapping">TBumpMapping</a></b> = CastleRendererInternalShader.TBumpMapping;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TLightRenderEvent">TLightRenderEvent</a></b> = CastleRendererInternalLights.TLightRenderEvent;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TRenderingMode">TRenderingMode</a></b> = (...);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TRenderingAttributesClass">TRenderingAttributesClass</a></b> = class of <a  href="CastleRenderer.TRenderingAttributes.html">TRenderingAttributes</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TTextureImageCacheList">TTextureImageCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureImageCache.html">TTextureImageCache</a>&gt;;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TTextureVideoCacheList">TTextureVideoCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureVideoCache.html">TTextureVideoCache</a>&gt;;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TTextureCubeMapCacheList">TTextureCubeMapCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureCubeMapCache.html">TTextureCubeMapCache</a>&gt;;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TTexture3DCacheList">TTexture3DCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTexture3DCache.html">TTexture3DCache</a>&gt;;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TTextureDepthOrFloatCacheList">TTextureDepthOrFloatCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureDepthOrFloatCache.html">TTextureDepthOrFloatCache</a>&gt;;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TVboType">TVboType</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TVboTypes">TVboTypes</a></b> = set of <a  href="CastleRenderer.html#TVboType">TVboType</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TVboArrays">TVboArrays</a></b> = array [<a  href="CastleRenderer.html#TVboType">TVboType</a>] of <a  href="CastleGLUtils.html#TGLuint">TGLuint</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TShapeCacheList">TShapeCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TShapeCache.html">TShapeCache</a>&gt;;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TShaderProgramCacheList">TShaderProgramCacheList</a></b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TShaderProgramCache.html">TShaderProgramCache</a>&gt;;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TGLTextureNodeClass">TGLTextureNodeClass</a></b> = class of <a  href="CastleRenderer.TGLTextureNode.html">TGLTextureNode</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#TLineType">TLineType</a></b> = (...);</code></td>
</tr>
</table>
<a name="PasDoc-Constants"></a><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#AllVboTypes">AllVboTypes</a></b> = [Low(<a  href="CastleRenderer.html#TVboType">TVboType</a>) .. High(<a  href="CastleRenderer.html#TVboType">TVboType</a>)];</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#BumpMappingNames">BumpMappingNames</a></b>: array [<a  href="CastleRenderer.html#TBumpMapping">TBumpMapping</a>] of string =
  ( 'None',
    'Basic',
    'Parallax',
    'Steep Parallax',
    'Steep Parallax With Self-Shadowing' );</code></td>
</tr>
</table>
<a name="PasDoc-Variables"></a><h3 class="summary">Variables</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#LogRendererCache">LogRendererCache</a></b>: boolean = false;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a  href="CastleRenderer.html#LogRenderer">LogRenderer</a></b>: boolean = false;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Types</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TBeforeGLVertexProc"></a><code><b>TBeforeGLVertexProc</b> = procedure (Node: <a  href="X3DNodes.TAbstractGeometryNode.html">TAbstractGeometryNode</a>; const Vert: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>) of object;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShadersRendering"></a><code><b>TShadersRendering</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;<h6 class="description_section">Values</h6>
<ul>
<li>
srDisable: &nbsp;</li>
<li>
srWhenRequired: &nbsp;</li>
<li>
srAlways: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TCullFace"></a><code><b>TCullFace</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Faces to cull (make invisible) during VRML/X3D rendering.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
cfNone: &nbsp;</li>
<li>
cfCW: &nbsp;</li>
<li>
cfCCW: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TBumpMapping"></a><code><b>TBumpMapping</b> = CastleRendererInternalShader.TBumpMapping;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TLightRenderEvent"></a><code><b>TLightRenderEvent</b> = CastleRendererInternalLights.TLightRenderEvent;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TRenderingMode"></a><code><b>TRenderingMode</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
<a class="normal" href="CastleRenderer.TRenderingAttributes.html#Mode">TRenderingAttributes.Mode</a> possible values.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
rmFull: Normal rendering features. Everything is enabled (as long as other <a class="normal" href="CastleRenderer.TRenderingAttributes.html">TRenderingAttributes</a> settings allow them).</li>
<li>
rmPureGeometry: Pure geometry is rendered, without any colors, materials, lights, textures. Only the geometry primitives are rendered. We still set correct modelview matrix transformations, control face culling and depth test and such. The idea is that we &quot;hit&quot; the same pixels as normal rendering (with the exception of alpha test textures, that are not used for pure geometry rendering &mdash; for now). But we do absolutely nothing to set a particular pixel color. Which means that the caller controls the color (by default, if lighting and everything else is disabled, you just get solid look with color from last glColor).

<p>For example, Renderer will not set any color (no glColor calls), will not set any material (no glMaterial calls), will not set any texture coordinates and will not bind any texture, fog and such.

<p>This is useful for special tricks, in particular to draw the geometry into stencil buffer. Another example of use is to render plane-projected shadows, see castle_game_engine/examples/vrml/plane_projected_shadow_demo.lpr, where you have to draw the model with pure <a class="normal" href="CastleColors.html#Black">black</a> color.</li>
<li>
rmDepth: Only the rendering fetures that affect depth buffer work reliably, everything else is undefined (and works as fast as possible). This is suitable if you render only to depth buffer, like for shadow maps.

<p>It's quite similar to rmPureGeometry, except alpha testing must work, so (at least some) textures must be applied over the model. Also, contrary to rmPureGeometry, various features (like fixed-function lighting state) are simply forcibly disabled (instead of letting caller to set OpenGL state for them).</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TRenderingAttributesClass"></a><code><b>TRenderingAttributesClass</b> = class of <a  href="CastleRenderer.TRenderingAttributes.html">TRenderingAttributes</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTextureImageCacheList"></a><code><b>TTextureImageCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureImageCache.html">TTextureImageCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTextureVideoCacheList"></a><code><b>TTextureVideoCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureVideoCache.html">TTextureVideoCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTextureCubeMapCacheList"></a><code><b>TTextureCubeMapCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureCubeMapCache.html">TTextureCubeMapCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTexture3DCacheList"></a><code><b>TTexture3DCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTexture3DCache.html">TTexture3DCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTextureDepthOrFloatCacheList"></a><code><b>TTextureDepthOrFloatCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TTextureDepthOrFloatCache.html">TTextureDepthOrFloatCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TVboType"></a><code><b>TVboType</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
&nbsp;<h6 class="description_section">Values</h6>
<ul>
<li>
vtCoordinate: &nbsp;</li>
<li>
vtAttribute: &nbsp;</li>
<li>
vtIndex: &nbsp;</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TVboTypes"></a><code><b>TVboTypes</b> = set of <a  href="CastleRenderer.html#TVboType">TVboType</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TVboArrays"></a><code><b>TVboArrays</b> = array [<a  href="CastleRenderer.html#TVboType">TVboType</a>] of <a  href="CastleGLUtils.html#TGLuint">TGLuint</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShapeCacheList"></a><code><b>TShapeCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TShapeCache.html">TShapeCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShaderProgramCacheList"></a><code><b>TShaderProgramCacheList</b> = specialize TFPGObjectList&lt;<a  href="CastleRenderer.TShaderProgramCache.html">TShaderProgramCache</a>&gt;;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TGLTextureNodeClass"></a><code><b>TGLTextureNodeClass</b> = class of <a  href="CastleRenderer.TGLTextureNode.html">TGLTextureNode</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TLineType"></a><code><b>TLineType</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Line types (patterns). For ease of implementation, ordered exactly like VRML/X3D LineProperties.linetype field.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
ltSolid: &nbsp;</li>
<li>
ltDashed: &nbsp;</li>
<li>
ltDotted: &nbsp;</li>
<li>
ltDashedDotted: &nbsp;</li>
<li>
ltDashDotDot: &nbsp;</li>
</ul>
</td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="AllVboTypes"></a><code><b>AllVboTypes</b> = [Low(<a  href="CastleRenderer.html#TVboType">TVboType</a>) .. High(<a  href="CastleRenderer.html#TVboType">TVboType</a>)];</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="BumpMappingNames"></a><code><b>BumpMappingNames</b>: array [<a  href="CastleRenderer.html#TBumpMapping">TBumpMapping</a>] of string =
  ( 'None',
    'Basic',
    'Parallax',
    'Steep Parallax',
    'Steep Parallax With Self-Shadowing' );</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<h3 class="detail">Variables</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="LogRendererCache"></a><code><b>LogRendererCache</b>: boolean = false;</code></td>
</tr>
<tr><td colspan="1">
<p>
Log renderer cache events. Allows to see how the cache performs. A <i>lot</i> of log messages.

<p>Meaningful only if you initialized log (see <a class="normal" href="CastleLog.html">CastleLog</a> unit) by <a class="normal" href="CastleLog.html#InitializeLog">InitializeLog</a> first.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="LogRenderer"></a><code><b>LogRenderer</b>: boolean = false;</code></td>
</tr>
<tr><td colspan="1">
<p>
Log various renderer information.

<p>Meaningful only if you initialized log (see <a class="normal" href="CastleLog.html">CastleLog</a> unit) by <a class="normal" href="CastleLog.html#InitializeLog">InitializeLog</a> first.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:11</em>
</span>
</td></tr></table></body></html>