source: OGRE/trunk/ogrenew/Docs/manual/manual_17.html @ 657

Revision 657, 25.7 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

RevLine 
[657]1<HTML>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3<!-- Created on , 12 2006 by texi2html 1.64 -->
4<!--
5Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6            Karl Berry  <karl@freefriends.org>
7            Olaf Bachmann <obachman@mathematik.uni-kl.de>
8            and many others.
9Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
11 
12-->
13<HEAD>
14<TITLE>OGRE Manual v1.0.7: Passes</TITLE>
15
16<META NAME="description" CONTENT="OGRE Manual v1.0.7: Passes">
17<META NAME="keywords" CONTENT="OGRE Manual v1.0.7: Passes">
18<META NAME="resource-type" CONTENT="document">
19<META NAME="distribution" CONTENT="global">
20<META NAME="Generator" CONTENT="texi2html 1.64">
21<LINK TYPE="text/css" rel="stylesheet" href="../style.css"> 
22</HEAD>
23
24<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
25
26<A NAME="SEC34"></A>
27<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_16.html#SEC31"> &lt; </A>]</TD>
29<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_15.html#SEC24"> Up </A>]</TD>
30<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_18.html#SEC54"> &gt; </A>]</TD>
31<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
32<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
33<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
34<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
35</TR></TABLE>
36<HR SIZE=1>
37<H3> 3.1.2 Passes </H3>
38<!--docid::SEC34::-->
39A pass is a single render of the geometry in question; a single call to the rendering API with a certain set of rendering properties. A technique can have between one and 16 passes, although clearly the more passes you use, the more expensive the technique will be to render.<BR><BR>
40Passes have a set of global attributes (described below), zero or more nested texture_unit entries (See section <A HREF="manual_18.html#SEC54">3.1.3 Texture Units</A>), and optionally a reference to a vertex and / or a fragment program (See section <A HREF="manual_20.html#SEC86">3.1.5 Using Vertex and Fragment Programs in a Pass</A>).
41<P>
42
43<BR><BR>
44Here are the attributes you can use in a 'pass' section of a .material script:
45</P><P>
46
47<UL>
48<LI>
49<A HREF="manual_17.html#SEC36">ambient</A>
50<LI>
51<A HREF="manual_17.html#SEC37">diffuse</A>
52<LI>
53<A HREF="manual_17.html#SEC38">specular</A>
54<LI>
55<A HREF="manual_17.html#SEC39">emissive</A>
56<LI>
57<A HREF="manual_17.html#SEC40">scene_blend</A>
58<LI>
59<A HREF="manual_17.html#SEC41">depth_check</A>
60<LI>
61<A HREF="manual_17.html#SEC42">depth_write</A>
62<LI>
63<A HREF="manual_17.html#SEC43">depth_func</A>
64<LI>
65<A HREF="manual_17.html#SEC44">depth_bias</A>
66<LI>
67<A HREF="manual_17.html#SEC45">alpha_rejection</A>
68<LI>
69<A HREF="manual_17.html#SEC46">cull_hardware</A>
70<LI>
71<A HREF="manual_17.html#SEC47">cull_software</A>
72<LI>
73<A HREF="manual_17.html#SEC48">lighting</A>
74<LI>
75<A HREF="manual_17.html#SEC49">shading</A>
76<LI>
77<A HREF="manual_17.html#SEC50">fog_override</A>
78<LI>
79<A HREF="manual_17.html#SEC51">colour_write</A>
80<LI>
81<A HREF="manual_17.html#SEC52">max_lights</A>
82<LI>
83<A HREF="manual_17.html#SEC53">iteration</A>
84</UL>
85<P>
86
87<A NAME="SEC35"></A>
88<H2> Attribute Descriptions </H2>
89<!--docid::SEC35::-->
90<A NAME="ambient"></A>
91<A NAME="SEC36"></A>
92<H3> ambient </H3>
93<!--docid::SEC36::-->
94<P>
95
96Sets the ambient colour reflectance properties of this pass. <STRONG>This attribute has no effect if a asm, CG, or HLSL shader program is used.  With GLSL, the shader can read the OpenGL material state.</STRONG> <BR><BR>
97</P><P>
98
99Format: ambient (&#60;red&#62; &#60;green&#62; &#60;blue&#62; [&#60;alpha&#62;]| vertexcolour)<BR>
100NB valid colour values are between 0.0 and 1.0.<BR><BR>
101</P><P>
102
103Example: ambient 0.0 0.8 0.0<BR><BR>
104</P><P>
105
106The base colour of a pass is determined by how much red, green and blue light is reflects at each vertex. This property determines how much ambient light (directionless global light) is reflected.
107It is also possible to make the ambient reflectance track the vertex colour as defined in the mesh by using the keyword vertexcolour instead of the colour values.
108The default is full white, meaning objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light effects, or change the blend of colours to make the object have a base colour other than white. This setting has no effect if dynamic lighting is disabled using the 'lighting off' attribute, or if any texture layer has a 'colour_op replace' attribute.<BR><BR>
109</P><P>
110
111Default: ambient 1.0 1.0 1.0 1.0<BR><BR>
112</P><P>
113
114<A NAME="diffuse"></A>
115<A NAME="SEC37"></A>
116<H3> diffuse </H3>
117<!--docid::SEC37::-->
118<P>
119
120Sets the diffuse colour reflectance properties of this pass. <STRONG>This attribute has no effect if a asm, CG, or HLSL shader program is used.  With GLSL, the shader can read the OpenGL material state.</STRONG><BR><BR>
121</P><P>
122
123Format: diffuse (&#60;red&#62; &#60;green&#62; &#60;blue&#62; [&#60;alpha&#62;]| vertexcolour)<BR>
124NB valid colour values are between 0.0 and 1.0.<BR><BR>
125</P><P>
126
127Example: diffuse 1.0 0.5 0.5<BR><BR>
128</P><P>
129
130The base colour of a pass is determined by how much red, green and blue light is reflects at each vertex. This property determines how much diffuse light (light from instances of the Light class in the scene) is reflected.
131It is also possible to make the diffuse reflectance track the vertex colour as defined in the mesh by using the keyword vertexcolour instead of the colour values.
132The default is full white, meaning objects reflect the maximum white light they can from Light objects. This setting has no effect if dynamic lighting is disabled using the 'lighting off' attribute, or if any texture layer has a 'colour_op replace' attribute.<BR><BR>
133</P><P>
134
135Default: diffuse 1.0 1.0 1.0 1.0<BR><BR>
136</P><P>
137
138<A NAME="specular"></A>
139<A NAME="SEC38"></A>
140<H3> specular </H3>
141<!--docid::SEC38::-->
142<P>
143
144Sets the specular colour reflectance properties of this pass. <STRONG>This attribute has no effect if a asm, CG, or HLSL shader program is used.  With GLSL, the shader can read the OpenGL material state.</STRONG><BR><BR>
145</P><P>
146
147Format: specular (&#60;red&#62; &#60;green&#62; &#60;blue&#62; [&#60;alpha&#62;]| vertexcolour) &#60;shininess&#62;<BR>
148NB valid colour values are between 0.0 and 1.0. Shininess can be any value greater than 0.<BR><BR>
149</P><P>
150
151Example: specular 1.0 1.0 1.0 12.5<BR><BR>
152</P><P>
153
154The base colour of a pass is determined by how much red, green and blue light is reflects at each vertex. This property determines how much specular light (highlights from instances of the Light class in the scene) is reflected.
155It is also possible to make the diffuse reflectance track the vertex colour as defined in the mesh by using the keyword vertexcolour instead of the colour values.
156The default is to reflect no specular light. The colour of the specular highlights is determined by the colour parameters, and the size of the highlights by the separate shininess parameter.. The higher the value of the shininess parameter, the sharper the highlight ie the radius is smaller.  Beware of using shininess values in the range of 0 to 1 since this causes the the specular colour to be applied to the whole surface that has the material applied to it.  When the viewing angle to the surface changes, ugly flickering will also occur when shininess is in the range of 0 to 1.  Shininess values between 1 and 128 work best in both DirectX and OpenGL renderers.  This setting has no effect if dynamic lighting is disabled using the 'lighting off' attribute, or if any texture layer has a 'colour_op replace' attribute.<BR><BR>
157</P><P>
158
159Default: specular 0.0 0.0 0.0 0.0 0.0<BR><BR>
160</P><P>
161
162<A NAME="emissive"></A>
163<A NAME="SEC39"></A>
164<H3> emissive </H3>
165<!--docid::SEC39::-->
166<P>
167
168Sets the amount of self-illumination an object has. <STRONG>This attribute has no effect if a asm, CG, or HLSL shader program is used.  With GLSL, the shader can read the OpenGL material state.</STRONG><BR><BR>
169</P><P>
170
171Format: emissive (&#60;red&#62; &#60;green&#62; &#60;blue&#62; [&#60;alpha&#62;]| vertexcolour)<BR>
172NB valid colour values are between 0.0 and 1.0.<BR><BR>
173</P><P>
174
175Example: emissive 1.0 0.0 0.0<BR><BR>
176</P><P>
177
178If an object is self-illuminating, it does not need external sources to light it, ambient or otherwise. It's like the object has it's own personal ambient light. Unlike the name suggests, this object doesn't act as a light source for other objects in the scene (if you want it to, you have to create a light which is centered on the object).
179It is also possible to make the emissive colour track the vertex colour as defined in the mesh by using the keyword vertexcolour instead of the colour values.
180This setting has no effect if dynamic lighting is disabled using the 'lighting off' attribute, or if any texture layer has a 'colour_op replace' attribute.<BR><BR>
181</P><P>
182
183Default: emissive 0.0 0.0 0.0 0.0<BR><BR>
184</P><P>
185
186<A NAME="scene_blend"></A>
187<A NAME="SEC40"></A>
188<H3> scene_blend </H3>
189<!--docid::SEC40::-->
190<P>
191
192Sets the kind of blending this pass has with the existing contents of the scene. Wheras the texture blending operations seen in the texture_unit entries are concerned with blending between texture layers, this blending is about combining the output of this pass as a whole with the existing contents of the rendering target. This blending therefore allows object transparency and other special effects. There are 2 formats, one using predefined blend types, the other allowing a roll-your-own approach using source and destination factors.<BR><BR>
193</P><P>
194
195Format1: scene_blend &#60;add|modulate|alpha_blend|colour_blend&#62;<BR><BR>
196</P><P>
197
198Example: scene_blend add<BR><BR>
199</P><P>
200
201This is the simpler form, where the most commonly used blending modes are enumerated using a single parameter. Valid &#60;blend_type&#62; parameters are:
202<DL COMPACT>
203<DT>add
204<DD>The colour of the rendering output is added to the scene. Good for exposions, flares, lights, ghosts etc. Equivalent to 'scene_blend one one'.
205<DT>modulate
206<DD>The colour of the rendering output is multiplied with the scene contents. Generally colours and darkens the scene, good for smoked glass, semi-transparent objects etc. Equivalent to 'scene_blend dest_colour zero'.
207<DT>colour_blend
208<DD>Colour the scene based on the brightness of the input colours, but don't darken. Equivalent to 'scene_blend src_colour one_minus_src_colour'
209<DT>alpha_blend
210<DD>The alpha value of the rendering output is used as a mask. Equivalent to 'scene_blend src_alpha one_minus_src_alpha'
211</DL>
212<BR>
213Format2: scene_blend &#60;src_factor&#62; &#60;dest_factor&#62;<BR><BR>
214<P>
215
216Example: scene_blend one one_minus_dest_alpha<BR><BR>
217</P><P>
218
219This version of the method allows complete control over the blending operation, by specifying the source and destination blending factors. The resulting colour which is written to the rendering target is (texture * sourceFactor) + (scene_pixel * destFactor). Valid values for both parameters are:
220<DL COMPACT>
221<DT>one
222<DD>Constant value of 1.0
223<DT>zero
224<DD>Constant value of 0.0
225<DT>dest_colour
226<DD>The existing pixel colour
227<DT>src_colour
228<DD>The texture pixel (texel) colour
229<DT>one_minus_dest_colour
230<DD>1 - (dest_colour)
231<DT>one_minus_src_colour
232<DD>1 - (src_colour)
233<DT>dest_alpha
234<DD>The existing pixel alpha value
235<DT>src_alpha
236<DD>The texel alpha value
237<DT>one_minus_dest_alpha
238<DD>1 - (dest_alpha)
239<DT>one_minus_src_alpha
240<DD>1 - (src_alpha)
241</DL>
242<BR>
243Default: scene_blend one zero (opaque)
244<BR>
245<A NAME="depth_check"></A>
246<A NAME="SEC41"></A>
247<H3> depth_check </H3>
248<!--docid::SEC41::-->
249<P>
250
251Sets whether or not this pass renders with depth-buffer checking on or not.<BR><BR>
252</P><P>
253
254Format: depth_check &#60;on|off&#62;<BR><BR>
255</P><P>
256
257If depth-buffer checking is on, whenever a pixel is about to be written to the frame buffer the depth buffer is checked to see if the pixel is in front of all other pixels written at that point. If not, the pixel is not written. If depth checking is off, pixels are written no matter what has been rendered before. Also see depth_func for more advanced depth check configuration.<BR><BR>
258</P><P>
259
260Default: depth_check on<BR><BR>
261</P><P>
262
263<A NAME="depth_write"></A>
264<A NAME="SEC42"></A>
265<H3> depth_write </H3>
266<!--docid::SEC42::-->
267<P>
268
269Sets whether or not this pass renders with depth-buffer writing on or not.<BR>
270</P><P>
271
272Format: depth_write &#60;on|off&#62;<BR><BR>
273</P><P>
274
275If depth-buffer writing is on, whenever a pixel is written to the frame buffer the depth buffer is updated with the depth value of that new pixel, thus affecting future rendering operations if future pixels are behind this one. If depth writing is off, pixels are written without updating the depth buffer. Depth writing should normally be on but can be turned off when rendering static backgrounds or when rendering a collection of transparent objects at the end of a scene so that they overlap each other correctly.<BR><BR>
276</P><P>
277
278Default: depth_write on<BR>
279</P><P>
280
281<A NAME="depth_func"></A>
282<A NAME="SEC43"></A>
283<H3> depth_func </H3>
284<!--docid::SEC43::-->
285<P>
286
287Sets the function used to compare depth values when depth checking is on.<BR><BR>
288</P><P>
289
290Format: depth_func &#60;func&#62;<BR><BR>
291</P><P>
292
293If depth checking is enabled (see depth_check) a comparison occurs between the depth value of the pixel to be written and the current contents of the buffer. This comparison is normally less_equal, i.e. the pixel is written if it is closer (or at the same distance) than the current contents. The possible functions are:
294<DL COMPACT>
295<DT>always_fail
296<DD>Never writes a pixel to the render target
297<DT>always_pass
298<DD>Always writes a pixel to the render target
299<DT>less
300<DD>Write if (new_Z &#60; existing_Z)
301<DT>less_equal
302<DD>Write if (new_Z &#60;= existing_Z)
303<DT>equal
304<DD>Write if (new_Z == existing_Z)
305<DT>not_equal
306<DD>Write if (new_Z != existing_Z)
307<DT>greater_equal
308<DD>Write if (new_Z &#62;= existing_Z)
309<DT>greater
310<DD>Write if (new_Z &#62;existing_Z)
311</DL>
312<BR>
313Default: depth_func less_equal
314<P>
315
316<A NAME="depth_bias"></A>
317<A NAME="SEC44"></A>
318<H3> depth_bias </H3>
319<!--docid::SEC44::-->
320<P>
321
322Sets the bias applied to the depth value of this pass. Can be used to make coplanar polygons appear on top of others e.g. for decals. <BR><BR>
323</P><P>
324
325Format: depth_bias &#60;value&#62;<BR><BR>
326</P><P>
327
328Where &#60;value&#62; is between 0 and 16, the default being 0. The higher the value, the greater the offset (for if you want to do multiple overlapping decals).<BR><BR>
329</P><P>
330
331<A NAME="alpha_rejection"></A>
332<A NAME="SEC45"></A>
333<H3> alpha_rejection </H3>
334<!--docid::SEC45::-->
335<P>
336
337Sets the way the pass will have use alpha to totally reject pixels from the pipeline.<BR><BR>
338</P><P>
339
340Format: alpha_rejection &#60;function&#62; &#60;value&#62;<BR><BR>
341</P><P>
342
343Example: alpha_rejection greater_equal 128<BR><BR>
344</P><P>
345
346The function parameter can be any of the options listed in the material depth_function attribute. The value parameter can theoretically be any value between 0 and 255, but is best limited to 0 or 128 for hardware compatibility.<BR><BR>
347</P><P>
348
349Default: alpha_rejection always_pass<BR><BR>
350</P><P>
351
352<A NAME="cull_hardware"></A>
353<A NAME="SEC46"></A>
354<H3> cull_hardware </H3>
355<!--docid::SEC46::-->
356<P>
357
358Sets the hardware culling mode for this pass.<BR><BR>
359</P><P>
360
361Format: cull_hardware &#60;clockwise|anticlockwise|none&#62;<BR><BR>
362</P><P>
363
364A typical way for the hardware rendering engine to cull triangles is based on the 'vertex winding' of triangles. Vertex winding refers to the direction in which the vertices are passed or indexed to in the rendering operation as viewed from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for you Americans out there ;). If the option 'cull_hardware clockwise' is set, all triangles whose vertices are viewed in clockwise order from the camera will be culled by the hardware. 'anticlockwise' is the reverse (obviously), and 'none' turns off hardware culling so all triagles are rendered (useful for creating 2-sided passes).<BR><BR>
365</P><P>
366
367Default: cull_hardware clockwise<BR>
368NB this is the same as OpenGL's default but the opposite of Direct3D's default (because Ogre uses a right-handed coordinate system like OpenGL).
369</P><P>
370
371<A NAME="cull_software"></A>
372<A NAME="SEC47"></A>
373<H3> cull_software </H3>
374<!--docid::SEC47::-->
375<P>
376
377Sets the software culling mode for this pass.<BR><BR>
378</P><P>
379
380Format: cull_software &#60;back|front|none&#62;<BR><BR>
381</P><P>
382
383In some situations the engine will also cull geometry in software before sending it to the hardware renderer. This setting only takes effect on SceneManager's that use it (since it is best used on large groups of planar world geometry rather than on movable geometry since this would be expensive), but if used can cull geometry before it is sent to the hardware. In this case the culling is based on whether the 'back' or 'front' of the traingle is facing the camera - this definition is based on the face normal (a vector which sticks out of the front side of the polygon perpendicular to the face). Since Ogre expects face normals to be on anticlockwise side of the face, 'cull_software back' is the software equivalent of 'cull_hardware clockwise' setting, which is why they are both the default. The naming is different to reflect the way the culling is done though, since most of the time face normals are precalculated and they don't have to be the way Ogre expects - you could set 'cull_hardware none' and completely cull in software based on your own face normals, if you have the right SceneManager which uses them.<BR><BR>
384</P><P>
385
386Default: cull_software back<BR><BR>
387</P><P>
388
389<A NAME="lighting"></A>
390<A NAME="SEC48"></A>
391<H3> lighting </H3>
392<!--docid::SEC48::-->
393<P>
394
395Sets whether or not dynamic lighting is turned on for this pass or not. If lighting is turned off, all objects rendered using the pass will be fully lit. <STRONG>This attribute has no effect if a vertex program is used.</STRONG><BR><BR>
396</P><P>
397
398Format: lighting &#60;on|off&#62;<BR><BR>
399</P><P>
400
401Turning dynamic lighting off makes any ambient, diffuse, specular, emissive and shading properties for this pass redundant. When lighting is turned on, objects are lit according to their vertex normals for diffuse and specular light, and globally for ambient and emissive.<BR><BR>
402</P><P>
403
404Default: lighting on<BR><BR>
405</P><P>
406
407<A NAME="shading"></A>
408<A NAME="SEC49"></A>
409<H3> shading </H3>
410<!--docid::SEC49::-->
411<P>
412
413Sets the kind of shading which should be used for representing dynamic lighting for this pass.<BR><BR>
414</P><P>
415
416Format: shading &#60;flat|gouraud|phong&#62;<BR><BR>
417</P><P>
418
419When dynamic lighting is turned on, the effect is to generate colour values at each vertex. Whether these values are interpolated across the face (and how) depends on this setting.<BR><BR>
420<DL COMPACT>
421<DT>flat
422<DD>    No interpolation takes place. Each face is shaded with a single colour determined from the first vertex in the face.
423<DT>gouraud
424<DD>    Colour at each vertex is linearly interpolated across the face.
425<DT>phong
426<DD>    Vertex normals are interpolated across the face, and these are used to determine colour at each pixel. Gives a more natural lighting effect but is more expensive and works better at high levels of tesselation. Not supported on all hardware.
427</DL>
428Default: shading gouraud<BR><BR>
429<P>
430
431<A NAME="fog_override"></A>
432<A NAME="SEC50"></A>
433<H3> fog_override </H3>
434<!--docid::SEC50::-->
435<P>
436
437Tells the pass whether it should override the scene fog settings, and enforce it's own. Very useful for things that you don't want to be affected by fog when the rest of the scene is fogged, or vice versa.<BR><BR>
438</P><P>
439
440Format: fog_override &#60;override?&#62; [&#60;type&#62; &#60;colour&#62; &#60;density&#62; &#60;start&#62; &#60;end&#62;]<BR><BR>
441</P><P>
442
443Default: fog_override false<BR><BR>
444</P><P>
445
446If you specify 'true' for the first parameter and you supply the rest of the parameters, you are telling the pass to use these fog settings in preference to the scene settings, whatever they might be. If you specify 'true' but provide no further parameters, you are telling this pass to never use fogging no matter what the scene says. Here is an explanation of the parameters:<BR>
447<DL COMPACT>
448<DT>type
449<DD><STRONG>none</STRONG> = No fog, equivalent of just using 'fog_override true'<BR>
450<STRONG>linear</STRONG> = Linear fog from the &#60;start&#62; and &#60;end&#62; distances<BR>
451<STRONG>exp</STRONG> = Fog increases exponentially from the camera (fog = 1/e^(distance * density)), use &#60;density&#62; param to control it<BR>
452<STRONG>exp2</STRONG> = Fog increases at the square of FOG_EXP, i.e. even quicker (fog = 1/e^(distance * density)^2), use &#60;density&#62; param to control it
453<DT>colour
454<DD>    Sequence of 3 floating point values from 0 to 1 indicating the red, green and blue intensities
455<DT>density
456<DD>    The density parameter used in the 'exp' or 'exp2' fog types. Not used in linear mode but param must still be there as a placeholder
457<DT>start
458<DD>    The start distance from the camera of linear fog. Must still be present in other modes, even though it is not used.
459<DT>end
460<DD>    The end distance from the camera of linear fog. Must still be present in other modes, even though it is not used.
461</DL>
462<BR>
463Example: fog_override true exp 1 1 1 0.002 100 10000
464<P>
465
466<A NAME="colour_write"></A>
467<A NAME="SEC51"></A>
468<H3> colour_write </H3>
469<!--docid::SEC51::-->
470<P>
471
472Sets whether or not this pass renders with colour writing on or not.<BR>
473</P><P>
474
475Format: colour_write &#60;on|off&#62;<BR><BR>
476</P><P>
477
478If colour writing is off no visible pixels are written to the screen during this pass. You might think this is useless, but if you render with colour writing off, and with very minimal other settings, you can use this pass to initialise the depth buffer before subsequently rendering other passes which fill in the colour data. This can give you significant performance boosts on some newer cards, especially when using complex fragment programs, because if the depth check fails then the fragment program is never run. <BR><BR>
479</P><P>
480
481Default: colour_write on<BR>
482</P><P>
483
484<A NAME="max_lights"></A>
485<A NAME="SEC52"></A>
486<H3> max_lights </H3>
487<!--docid::SEC52::-->
488<P>
489
490Sets the maximum number of lights which will be considered for use with this pass.<BR><BR>
491Format: max_lights &#60;number&#62;<BR><BR>
492</P><P>
493
494The maximum number of lights which can be used when rendering fixed-function materials is set by the rendering system, and is typically set at 8. When you are using the programmable pipeline (See section <A HREF="manual_20.html#SEC86">3.1.5 Using Vertex and Fragment Programs in a Pass</A>) this limit is dependent on the program you are running, or, if you use 'iteration once_per_light' (See section <A HREF="manual_17.html#SEC53">iteration</A>), it effectively only bounded by the number of passes you are willing to use. Whichever method you use, however, the max_lights limit applies.<BR><BR>
495</P><P>
496
497Default: max_lights 8<BR>
498</P><P>
499
500<A NAME="iteration"></A>
501<A NAME="SEC53"></A>
502<H3> iteration </H3>
503<!--docid::SEC53::-->
504<P>
505
506Sets whether or not this pass is iterated, ie issued more than once.<BR><BR>
507</P><P>
508
509Format: iteration &#60;once | once_per_light&#62; [lightType]<BR><BR>
510Example: iteration once_per_light point
511</P><P>
512
513By default, passes are only issued once. However, if you use the programmable pipeline, or you wish to exceed the normal limits on the number of lights which are supported, you might want to use the once_per_light option. In this case, only light index 0 is ever used, and the pass is issued multiple times, each time with a different light in light index 0. Clearly this will make the pass more expensive, but it may be the only way to achieve certain effects such as per-pixel lighting effects which take into account 1..n lights.<BR><BR>
514</P><P>
515
516If you use once_per_light, you should also add an ambient pass to the technique before this pass, otherwise when no lights are in range of this object it will not get rendered at all; this is important even when you have no ambient light in the scene, because you would still want the objects sihouette to appear.<BR><BR>
517</P><P>
518
519The second parameter to the attribute only applies if you use once_per_light, and restricts the pass to being run for lights of a single type (either 'point', 'directional' or 'spot'). In the example, the pass will be run once per point light. This can be useful because when you;re writing a vertex / fragment program it is a lot better if you can assume the kind of lights you'll be dealing with.
520<BR><BR>
521Default: iteration once
522</P><P>
523
524<A NAME="Texture Units"></A>
525<HR SIZE=1>
526<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
527<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_16.html#SEC31"> &lt; </A>]</TD>
528<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_15.html#SEC24"> Up </A>]</TD>
529<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_18.html#SEC54"> &gt; </A>]</TD>
530<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
531<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
532<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
533<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
534</TR></TABLE>
535<BR> 
536<FONT SIZE="-1">
537This document was generated
538by <I>Steve Streeting</I> on <I>, 12 2006</I>
539using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
540"><I>texi2html</I></A>
541
542</BODY>
543</HTML>
Note: See TracBrowser for help on using the repository browser.