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

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

added ogre dependencies and patched ogre sources

Line 
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: Texture Units</TITLE>
15
16<META NAME="description" CONTENT="OGRE Manual v1.0.7: Texture Units">
17<META NAME="keywords" CONTENT="OGRE Manual v1.0.7: Texture Units">
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="SEC54"></A>
27<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_17.html#SEC34"> &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_19.html#SEC76"> &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.3 Texture Units </H3>
38<!--docid::SEC54::-->
39<P>
40
41Here are the attributes you can use in a 'texture_unit' section of a .material script:
42</P><P>
43
44<A NAME="SEC55"></A>
45<H2> Available Texture Layer Attributes </H2>
46<!--docid::SEC55::-->
47<UL>
48<LI>
49<A HREF="manual_18.html#SEC57">texture</A>
50<LI>
51<A HREF="manual_18.html#SEC58">anim_texture</A>
52<LI>
53<A HREF="manual_18.html#SEC59">cubic_texture</A>
54<LI>
55<A HREF="manual_18.html#SEC60">tex_coord_set</A>
56<LI>
57<A HREF="manual_18.html#SEC61">tex_address_mode</A>
58<LI>
59<A HREF="manual_18.html#SEC62">filtering</A>
60<LI>
61<A HREF="manual_18.html#SEC63">max_anisotropy</A>
62<LI>
63<A HREF="manual_18.html#SEC64">colour_op</A>
64<LI>
65<A HREF="manual_18.html#SEC65">colour_op_ex</A>
66<LI>
67<A HREF="manual_18.html#SEC66">colour_op_multipass_fallback</A>
68<LI>
69<A HREF="manual_18.html#SEC67">alpha_op_ex</A>
70<LI>
71<A HREF="manual_18.html#SEC68">env_map</A>
72<LI>
73<A HREF="manual_18.html#SEC69">scroll</A>
74<LI>
75<A HREF="manual_18.html#SEC70">scroll_anim</A>
76<LI>
77<A HREF="manual_18.html#SEC71">rotate</A>
78<LI>
79<A HREF="manual_18.html#SEC72">rotate_anim</A>
80<LI>
81<A HREF="manual_18.html#SEC73">scale</A>
82<LI>
83<A HREF="manual_18.html#SEC74">wave_xform</A>
84<LI>
85<A HREF="manual_18.html#SEC75">transform</A>
86</UL>
87<P>
88
89You can also use a nested 'texture_source' section in order to use a special add-in as a source of texture data, See section <A HREF="manual_56.html#SEC205">6. External Texture Sources</A> for details.
90</P><P>
91
92<A NAME="SEC56"></A>
93<H2> Attribute Descriptions  </H2>
94<!--docid::SEC56::-->
95<A NAME="texture"></A>
96<A NAME="SEC57"></A>
97<H3> texture </H3>
98<!--docid::SEC57::-->
99<P>
100
101Sets the name of the static texture image this layer will use.<BR><BR>
102</P><P>
103
104Format: texture &#60;texturename&#62; [&#60;type&#62;]<BR><BR>
105</P><P>
106
107Example: texture funkywall.jpg<BR><BR>
108</P><P>
109
110This setting is mutually exclusive with the anim_texture attribute. Note that the texture file cannot include spaces. Those of you Windows users who like spaces in filenames, please get over it and use underscores instead.<BR><BR>
111The 'type' parameter allows you to specify a the type of texture to create - the default is '2d', but you can override this; here's the full list:
112<DL COMPACT>
113<DT>1d
114<DD>A 1-dimensional texture; that is, a texture which is only 1 pixel high. These kinds of textures can be useful when you need to encode a function in a texture and use it as a simple lookup, perhaps in a fragment program. It is important that you use this setting when you use a fragment program which uses 1-dimensional texture coordinates, since GL requires you to use a texture type that matches (D3D will let you get away with it, but you ought to plan for cross-compatibility). Your texture widths should still be a power of 2 for best compatibility and performance.
115<DT>2d
116<DD>The default type which is assumed if you omit it, your texture has a width and a height, both of which should preferably be powers of 2, and if you can, make them square because this will look best on the most hardware. These can be addressed with 2D texture coordinates.
117<DT>3d
118<DD>A 3 dimensional texture ie volume texture. Your texture has a width, a height, both of which should be powers of 2, and has depth. These can be addressed with 3d texture coordinates ie through a pixel shader.
119<DT>cubic
120<DD>This texture is made up of 6 2D textures which are pasted around the inside of a cube. Can be addressed with 3D texture coordinates and are useful for cubic reflection maps and normal maps.
121</DL>
122<P>
123
124Default: none<BR><BR>
125</P><P>
126
127<A NAME="anim_texture"></A>
128<A NAME="SEC58"></A>
129<H3> anim_texture </H3>
130<!--docid::SEC58::-->
131<P>
132
133Sets the images to be used in an animated texture layer. In this case an animated texture layer means one which has multiple frames, each of which is a separate image file. There are 2 formats, one for implicitly determined image names, one for explicitly named images.<BR><BR>
134</P><P>
135
136Format1 (short): anim_texture &#60;base_name&#62; &#60;num_frames&#62; &#60;duration&#62;<BR><BR>
137</P><P>
138
139Example: anim_texture flame.jpg 5 2.5<BR><BR>
140</P><P>
141
142This sets up an animated texture layer made up of 5 frames named flame_0.jpg, flame_1.jpg, flame_2.jpg etc, with an animation length of 2.5 seconds (2fps). If duration is set to 0, then no automatic transition takes place and frames must be changed manually in code.<BR><BR>
143</P><P>
144
145Format2 (long): anim_texture &#60;frame1&#62; &#60;frame2&#62; ... &#60;duration&#62;<BR><BR>
146</P><P>
147
148Example: anim_texture flamestart.jpg flamemore.png flameagain.jpg moreflame.jpg lastflame.tga 2.5<BR><BR>
149</P><P>
150
151This sets up the same duration animation but from 5 separately named image files. The first format is more concise, but the second is provided if you cannot make your images conform to the naming standard required for it. <BR><BR>
152</P><P>
153
154Default: none<BR><BR>
155</P><P>
156
157<A NAME="cubic_texture"></A>
158<A NAME="SEC59"></A>
159<H3> cubic_texture </H3>
160<!--docid::SEC59::-->
161<P>
162
163Sets the images used in a cubic texture, i.e. one made up of 6 individual images making up the faces of a cube. These kinds of textures are used for reflection maps (if hardware supports cubic reflection maps) or skyboxes. There are 2 formats, a brief format expecting image names of a particular format and a more flexible but longer format for arbitrarily named textures.<BR><BR>
164</P><P>
165
166Format1 (short): cubic_texture &#60;base_name&#62; &#60;combinedUVW|separateUV&#62;<BR><BR>
167</P><P>
168
169The base_name in this format is something like 'skybox.jpg', and the system will expect you to provide skybox_fr.jpg, skybox_bk.jpg, skybox_up.jpg, skybox_dn.jpg, skybox_lf.jpg, and skybox_rt.jpg for the individual faces.<BR><BR>
170</P><P>
171
172Format2 (long): cubic_texture &#60;front&#62; &#60;back&#62; &#60;left&#62; &#60;right&#62; &#60;up&#62; &#60;down&#62; separateUV<BR><BR>
173</P><P>
174
175In this case each face is specified explicitly, incase you don't want to conform to the image naming standards above. You can only use this for the separateUV version since the combinedUVW version requires a single texture name to be assigned to the combined 3D texture (see below).<BR><BR>
176</P><P>
177
178In both cases the final parameter means the following:
179<DL COMPACT>
180<DT>combinedUVW
181<DD>    The 6 textures are combined into a single 'cubic' texture map which is then addressed using 3D texture coordinates with U, V and W components. Necessary for reflection maps since you never know which face of the box you are going to need. Note that not all cards support cubic environment mapping.
182<DT>separateUV
183<DD>    The 6 textures are kept separate but are all referenced by this single texture layer. One texture at a time is active (they are actually stored as 6 frames), and they are addressed using standard 2D UV coordinates. This type is good for skyboxes since only one face is rendered at one time and this has more guaranteed hardware support on older cards.
184</DL>
185<BR>
186Default: none
187<P>
188
189<A NAME="tex_coord_set"></A>
190<A NAME="SEC60"></A>
191<H3> tex_coord_set </H3>
192<!--docid::SEC60::-->
193<P>
194
195Sets which texture coordinate set is to be used for this texture layer. A mesh can define multiple sets of texture coordinates, this sets which one this material uses.<BR><BR>
196</P><P>
197
198Format: tex_coord_set &#60;set_num&#62;<BR><BR>
199</P><P>
200
201Example: tex_coord_set 2<BR><BR>
202</P><P>
203
204Default: tex_coord_set 0<BR><BR>
205</P><P>
206
207<A NAME="tex_address_mode"></A>
208<A NAME="SEC61"></A>
209<H3> tex_address_mode </H3>
210<!--docid::SEC61::-->
211Defines what happens when texture coordinates exceed 1.0 for this texture layer.<BR><BR>
212<P>
213
214Format: tex_address_mode &#60;wrap|clamp|mirror&#62;
215<DL COMPACT>
216<DT>wrap
217<DD>    Any value beyond 1.0 wraps back to 0.0. Texture is repeated.
218<DT>clamp
219<DD>    Values beyond 1.0 are clamped to 1.0. Texture 'streaks' beyond 1.0 since last line of pixels is used across the rest of the address space. Useful for textures which need exact coverage from 0.0 to 1.0 without the 'fuzzy edge' wrap gives when combined with filtering.
220<DT>mirror
221<DD>    Texture flips every boundary, meaning texture is mirrored every 1.0 u or v
222</DL>
223<BR>
224Default: tex_address_mode wrap<BR><BR>
225<P>
226
227<A NAME="filtering"></A>
228<A NAME="SEC62"></A>
229<H3> filtering </H3>
230<!--docid::SEC62::-->
231<P>
232
233Sets the type of texture filtering used when magnifying or minifying a texture. There are 2 formats to this attribute, the simple format where you simply specify the name of a predefined set of filtering options, and the complex format, where you individually set the minification, magnification, and mip filters yourself.<BR><BR>
234<STRONG>Simple Format</STRONG><BR>
235Format: filtering &#60;none|bilinear|trilinear|anisotropic&#62;<BR>
236Default: filtering bilinear<BR><BR>
237With this format, you only need to provide a single parameter which is one of the following:
238<DL COMPACT>
239<DT>none
240<DD>    No filtering or mipmapping is used. This is equivalent to the complex format 'filtering point point none'.
241<DT>bilinear
242<DD>    2x2 box filtering is performed when magnifying or reducing a texture, and a mipmap is picked from the list but no filtering is done between the levels of the mipmaps. This is equivalent to the complex format 'filtering linear linear point'.
243<DT>trilinear
244<DD>    2x2 box filtering is performed when magnifying and reducing a texture, and the closest 2 mipmaps are filtered together. This is equivalent to the complex format 'filtering linear linear linear'.
245<DT>anisotropic
246<DD>    This is the same as 'trilinear', except the filtering algorithm takes account of the slope of the triangle in relation to the camera rather than simply doing a 2x2 pixel filter in all cases. This makes triangles at acute angles look less fuzzy. Equivalent to the complex format 'filtering anisotropic anisotropic linear'. Note that in order for this to make any difference, you must also set the <A HREF="manual_18.html#SEC63">max_anisotropy</A> attribute too.
247</DL>
248<BR><BR>
249<STRONG>Complex Format</STRONG><BR>
250Format: filtering &#60;minification&#62; &#60;magnification&#62; &#60;mip&#62;<BR>
251Default: filtering linear linear point<BR><BR>
252This format gives you complete control over the minification, magnification, and mip filters. Each parameter can be one of the following:
253<DL COMPACT>
254<DT>none
255<DD>    Nothing - only a valid option for the 'mip' filter , since this turns mipmapping off completely. The lowest setting for min and mag is 'point'.
256<DT>point
257<DD>    Pick the closet pixel in min or mag modes. In mip mode, this picks the closet matching mipmap.
258<DT>linear
259<DD>    Filter a 2x2 box of pixels around the closest one. In the 'mip' filter this enables filtering between mipmap levels.
260<DT>anisotropic
261<DD>    Only valid for min and mag modes, makes the filter compensate for camera-space slope of the triangles. Note that in order for this to make any difference, you must also set the <A HREF="manual_18.html#SEC63">max_anisotropy</A> attribute too.
262</DL>
263<P>
264
265<A NAME="max_anisotropy"></A>
266<A NAME="SEC63"></A>
267<H3> max_anisotropy </H3>
268<!--docid::SEC63::-->
269<P>
270
271Sets the maximum degree of anisotropy that the renderer will try to compensate for when filtering textures. The degree of anisotropy is the ratio between the height of the texture segment visible in a screen space region versus the width - so for example a floor plane, which stretches on into the distance and thus the vertical texture coordinates change much faster than the horizontal ones, has a higher anisotropy than a wall which is facing you head on (which has an anisotropy of 1 if your line of sight is perfectly perpendicular to it). You should set the max_anisotropy value to something greater than 1 to begin compensating; higher values can compensate for more acute angles.<BR><BR>
272In order for this to be used, you have to set the minification and/or the magnification <A HREF="manual_18.html#SEC62">filtering</A> option on this texture to anisotropic.
273</P><P>
274
275Format: max_anisotropy &#60;value&#62;<BR>
276Default: max_anisotropy 1
277</P><P>
278
279<A NAME="colour_op"></A>
280<A NAME="SEC64"></A>
281<H3> colour_op </H3>
282<!--docid::SEC64::-->
283<P>
284
285Determines how the colour of this texture layer is combined with the one below it (or the lighting effect on the geometry if this is the first layer).<BR><BR>
286</P><P>
287
288Format: colour_op &#60;replace|add|modulate|alpha_blend&#62;<BR><BR>
289</P><P>
290
291This method is the simplest way to blend texture layers, because it requires only one parameter, gives you the most common blending types, and automatically sets up 2 blending methods: one for if single-pass multitexturing hardware is available, and another for if it is not and the blending must be achieved through multiple rendering passes. It is, however, quite limited and does not expose the more flexible multitexturing operations, simply because these can't be automatically supported in multipass fallback mode. If want to use the fancier options, use <A HREF="manual_18.html#SEC65">colour_op_ex</A>, but you'll either have to be sure that enough multitexturing units will be available, or you should explicitly set a fallback using <A HREF="manual_18.html#SEC66">colour_op_multipass_fallback</A>.<BR>
292<DL COMPACT>
293<DT>replace
294<DD>    Replace all colour with texture with no adjustment.
295<DT>add
296<DD>    Add colour components together.
297<DT>modulate
298<DD>    Multiply colour components together.
299<DT>alpha_blend
300<DD>    Blend based on texture alpha.
301</DL>
302<BR>
303Default: colour_op modulate
304<P>
305
306<A NAME="colour_op_ex"></A>
307<A NAME="SEC65"></A>
308<H3> colour_op_ex </H3>
309<!--docid::SEC65::-->
310<P>
311
312This is an extended version of the <A HREF="manual_18.html#SEC64">colour_op</A> attribute which allows extremely detailed control over the blending applied between this and earlier layers. Multitexturing hardware can apply more complex blending operations that multipass blendind, but you are limited to the number of texture units which are available in hardware.<BR><BR>
313</P><P>
314
315Format: colour_op_ex &#60;operation&#62; &#60;source1&#62; &#60;source2&#62; [&#60;manual_factor&#62;] [&#60;manual_colour1&#62;] [&#60;manual_colour2&#62;]<BR><BR>
316</P><P>
317
318Example colour_op_ex add_signed src_manual src_current 0.5<BR><BR>
319</P><P>
320
321See the IMPORTANT note below about the issues between mulitpass and multitexturing that using this method can create. Texture colour operations determine how the final colour of the surface appears when rendered. Texture units are used to combine colour values from various sources (e.g. the diffuse colour of the surface from lighting calculations, combined with the colour of the texture). This method allows you to specify the 'operation' to be used, i.e. the calculation such as adds or multiplies, and which values to use as arguments, such as a fixed value or a value from a previous calculation.<BR><BR>
322</P><P>
323
324<DL COMPACT>
325<DT>Operation options
326<DD><DL COMPACT>
327<DT>source1
328<DD>    Use source1 without modification
329<DT>source2
330<DD>    Use source2 without modification
331<DT>modulate
332<DD>    Multiply source1 and source2 together.
333<DT>modulate_x2
334<DD>    Multiply source1 and source2 together, then by 2 (brightening).
335<DT>modulate_x4
336<DD>    Multiply source1 and source2 together, then by 4 (brightening).
337<DT>add
338<DD>    Add source1 and source2 together.
339<DT>add_signed
340<DD>    Add source1 and source2 then subtract 0.5.
341<DT>add_smooth
342<DD>    Add source1 and source2, subtract the product
343<DT>subtract
344<DD>    Subtract source2 from source1
345<DT>blend_diffuse_alpha
346<DD>    Use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha).
347<DT>blend_texture_alpha
348<DD>    As blend_diffuse_alpha but use alpha from texture
349<DT>blend_current_alpha
350<DD>    As blend_diffuse_alpha but use current alpha from previous stages (same as blend_diffuse_alpha for first layer)
351<DT>blend_manual
352<DD>    As blend_diffuse_alpha but use a constant manual alpha value specified in &#60;manual&#62;
353<DT>dotproduct
354<DD>    The dot product of source1 and source2
355</DL>
356<DT>Source1 and source2 options
357<DD><DL COMPACT>
358<DT>src_current
359<DD>    The colour as built up from previous stages.
360<DT>src_texture
361<DD>    The colour derived from the texture assigned to this layer.
362<DT>src_diffuse
363<DD>    The interpolated diffuse colour from the vertices (same as 'src_current' for first layer).
364<DT>src_specular
365<DD>    The interpolated specular colour from the vertices.
366<DT>src_manual
367<DD>    The manual colour specified at the end of the command.
368</DL>
369</DL>
370<BR>
371For example 'modulate' takes the colour results of the previous layer, and multiplies them with the new texture being applied. Bear in mind that colours are RGB values from 0.0-1.0 so multiplying them together will result in values in the same range, 'tinted' by the multiply. Note however that a straight multiply normally has the effect of darkening the textures - for this reason there are brightening operations like modulate_x2. Note that because of the limitations on some underlying APIs (Direct3D included) the 'texture' argument can only be used as the first argument, not the second. <BR><BR>
372<P>
373
374Note that the last parameter is only required if you decide to pass a value manually into the operation. Hence you only need to fill these in if you use the 'blend_manual' operation.<BR><BR>
375</P><P>
376
377IMPORTANT: Ogre tries to use multitexturing hardware to blend texture layers together. However, if it runs out of texturing units (e.g. 2 of a GeForce2, 4 on a GeForce3) it has to fall back on multipass rendering, i.e. rendering the same object multiple times with different textures. This is both less efficient and there is a smaller range of blending operations which can be performed. For this reason, if you use this method you really should set the colour_op_multipass_fallback attribute to specify which effect you want to fall back on if sufficient hardware is not available (the default is just 'modulate' which is unlikely to be what you want if you're doing swanky blending here). If you wish to avoid having to do this, use the simpler colour_op attribute which allows less flexible blending options but sets up the multipass fallback automatically, since it only allows operations which have direct multipass equivalents.<BR><BR>
378</P><P>
379
380Default: none (colour_op modulate)<BR>
381</P><P>
382
383<A NAME="colour_op_multipass_fallback"></A>
384<A NAME="SEC66"></A>
385<H3> colour_op_multipass_fallback </H3>
386<!--docid::SEC66::-->
387<P>
388
389Sets the multipass fallback operation for this layer, if you used colour_op_ex and not enough multitexturing hardware is available.<BR><BR>
390</P><P>
391
392Format: colour_op_multipass_fallback &#60;src_factor&#62; &#60;dest_factor&#62;<BR><BR>
393</P><P>
394
395Example: colour_op_mulitpass_fallback one one_minus_dest_alpha<BR><BR>
396</P><P>
397
398Because some of the effects you can create using colour_op_ex are only supported under multitexturing hardware, if the hardware is lacking the system must fallback on multipass rendering, which unfortunately doesn't support as many effects. This attribute is for you to specify the fallback operation which most suits you.<BR><BR>
399</P><P>
400
401The parameters are the same as in the scene_blend attribute; this is because multipass rendering IS effectively scene blending, since each layer is rendered on top of the last using the same mechanism as making an object transparent, it's just being rendered in the same place repeatedly to get the multitexture effect. If you use the simpler (and less flexible) colour_op attribute you don't need to call this as the system sets up the fallback for you.<BR><BR>
402</P><P>
403
404<A NAME="alpha_op_ex"></A>
405<A NAME="SEC67"></A>
406<H3> alpha_op_ex </H3>
407<!--docid::SEC67::-->
408<P>
409
410Behaves in exactly the same away as <A HREF="manual_18.html#SEC65">colour_op_ex</A> except that it determines how alpha values are combined between texture layers rather than colour values.The only difference is that the 2 manual colours at the end of colour_op_ex are just single floating-point values in alpha_op_ex.
411</P><P>
412
413<A NAME="env_map"></A>
414<A NAME="SEC68"></A>
415<H3> env_map </H3>
416<!--docid::SEC68::-->
417<P>
418
419Turns on/off texture coordinate effect that makes this layer an environment map.<BR><BR>
420</P><P>
421
422Format: env_map &#60;off|spherical|planar|cubic_reflection|cubic_normal&#62;<BR><BR>
423</P><P>
424
425Environment maps make an object look reflective by using automatic texture coordinate generation depending on the relationship between the objects vertices or normals and the eye.<BR><BR>
426<DL COMPACT>
427<DT>spherical
428<DD>    A spherical environment map. Requires a single texture which is either a fish-eye lens view of the reflected scene, or some other texture which looks good as a spherical map (a texture of glossy highlights is popular especially in car sims). This effect is based on the relationship between the eye direction and the vertex normals of the object, so works best when there are a lot of gradually changing normals, i.e. curved objects.
429<DT>planar
430<DD>    Similar to the spherical environment map, but the effect is based on the position of the vertices in the viewport rather than vertex normals. This effect is therefore useful for planar geometry (where a spherical env_map would not look good because the normals are all the same) or objects without normals.
431<DT>cubic_reflection
432<DD>    A more advanced form of reflection mapping which uses a group of 6 textures making up the inside of a cube, each of which is a view if the scene down each axis. Works extremely well in all cases but has a higher technical requirement from the card than spherical mapping. Requires that you bind a <A HREF="manual_18.html#SEC59">cubic_texture</A> to this texture unit and use the 'combinedUVW' option.
433<DT>cubic_normal
434<DD>    Generates 3D texture coordinates containing the camera space normal vector from the normal information held in the vertex data. Again, full use of this feature requires a <A HREF="manual_18.html#SEC59">cubic_texture</A> with the 'combinedUVW' option.
435       
436</DL>
437<BR>
438Default: env_map off<BR>
439<P>
440
441<A NAME="scroll"></A>
442<A NAME="SEC69"></A>
443<H3> scroll </H3>
444<!--docid::SEC69::-->
445<P>
446
447Sets a fixed scroll offset for the texture.<BR><BR>
448</P><P>
449
450Format: scroll &#60;x&#62; &#60;y&#62;<BR><BR>
451</P><P>
452
453This method offsets the texture in this layer by a fixed amount. Useful for small adjustments without altering texture coordinates in models. However if you wish to have an animated scroll effect, see the <A HREF="manual_18.html#SEC70">scroll_anim</A> attribute.<BR><BR>
454</P><P>
455
456<A NAME="scroll_anim"></A>
457<A NAME="SEC70"></A>
458<H3> scroll_anim </H3>
459<!--docid::SEC70::-->
460<P>
461
462Sets up an animated scroll for the texture layer. Useful for creating fixed-speed scrolling effects on a texture layer (for varying scroll speeds, see <A HREF="manual_18.html#SEC74">wave_xform</A>).<BR><BR>
463</P><P>
464
465Format: scroll_anim &#60;xspeed&#62; &#60;yspeed&#62;<BR>
466</P><P>
467
468<A NAME="rotate"></A>
469<A NAME="SEC71"></A>
470<H3> rotate </H3>
471<!--docid::SEC71::-->
472<P>
473
474Rotates a texture to a fixed angle. This attribute changes the rotational orientation of a texture to a fixed angle, useful for fixed adjustments. If you wish to animate the rotation, see <A HREF="manual_18.html#SEC72">rotate_anim</A>.<BR><BR>
475</P><P>
476
477Format: rotate &#60;angle&#62;<BR><BR>
478</P><P>
479
480The parameter is a anticlockwise angle in degrees.<BR><BR>
481</P><P>
482
483<A NAME="rotate_anim"></A>
484<A NAME="SEC72"></A>
485<H3> rotate_anim </H3>
486<!--docid::SEC72::-->
487<P>
488
489Sets up an animated rotation effect of this layer. Useful for creating fixed-speed rotation animations (for varying speeds, see <A HREF="manual_18.html#SEC74">wave_xform</A>).<BR><BR>
490</P><P>
491
492Format: rotate_anim &#60;revs_per_second&#62;<BR><BR>
493</P><P>
494
495The parameter is a number of anticlockwise revolutions per second.<BR><BR>
496</P><P>
497
498<A NAME="scale"></A>
499<A NAME="SEC73"></A>
500<H3> scale </H3>
501<!--docid::SEC73::-->
502<P>
503
504Adjusts the scaling factor applied to this texture layer. Useful for adjusting the size of textures without making changes to geometry. This is a fixed scaling factor, if you wish to animate this see <A HREF="manual_18.html#SEC74">wave_xform</A>.<BR><BR>
505</P><P>
506
507Format: scale &#60;x_scale&#62; &#60;y_scale&#62;<BR><BR>
508</P><P>
509
510Valid scale values are greater than 0, with a scale factor of 2 making the texture twice as big in that dimension etc.<BR><BR>
511</P><P>
512
513<A NAME="wave_xform"></A>
514<A NAME="SEC74"></A>
515<H3> wave_xform </H3>
516<!--docid::SEC74::-->
517<P>
518
519Sets up a transformation animation based on a wave function. Useful for more advanced texture layer transform effects. You can add multiple instances of this attribute to a single texture layer if you wish.<BR><BR>
520</P><P>
521
522Format: wave_xform &#60;xform_type&#62; &#60;wave_type&#62; &#60;base&#62; &#60;frequency&#62; &#60;phase&#62; &#60;amplitude&#62;<BR><BR>
523</P><P>
524
525Example: wave_xform scale_x sine 1.0 0.2 0.0 5.0<BR><BR>
526<DL COMPACT>
527<DT>xform_type
528<DD><DL COMPACT>
529<DT>scroll_x
530<DD>    Animate the x scroll value
531<DT>scroll_y
532<DD>    Animate the y scroll value
533<DT>rotate
534<DD>    Animate the rotate value
535<DT>scale_x
536<DD>    Animate the x scale value
537<DT>scale_y
538<DD>    Animate the y scale value
539</DL>
540<DT>wave_type
541<DD><DL COMPACT>
542<DT>sine
543<DD>    A typical sine wave which smoothly loops between min and max values
544<DT>triangle
545<DD>    An angled wave which increases &#38; decreases at constant speed, changing instantly at the extremes
546<DT>square
547<DD>    Max for half the wavelength, min for the rest with instant transition between
548<DT>sawtooth
549<DD>    Gradual steady increase from min to max over the period with an instant return to min at the end.
550<DT>inverse_sawtooth
551<DD>    Gradual steady decrease from max to min over the period, with an instant return to max at the end.
552</DL>
553<DT>base
554<DD>    The base value, the minimum if amplitude &#62; 0, the maximum if amplitdue &#60; 0
555<DT>frequency
556<DD>    The number of wave iterations per second, i.e. speed
557<DT>phase
558<DD>    Offset of the wave start
559<DT>amplitude
560<DD>    The size of the wave
561</DL>
562<BR>
563The range of the output of the wave will be {base, base+amplitude}. So the example above scales the texture in the x direction between 1 (normal size) and 5 along a sine wave at one cycle every 5 second (0.2 waves per second).<BR><BR>
564<P>
565
566<A NAME="transform"></A>
567<A NAME="SEC75"></A>
568<H3> transform </H3>
569<!--docid::SEC75::-->
570<P>
571
572This attribute allows you to specify a static 4x4 transformation matrix for the texture unit, thus replacing the individual scroll, rotate and scale attributes mentioned above. <BR><BR>
573</P><P>
574
575Format: transform m00 m01 m02 m03 m10 m11 m12 m13 m20 m21 m22 m23 m30 m31 m32 m33<BR><BR>
576</P><P>
577
578The indexes of the 4x4 matrix value above are expressed as m&#60;row&#62;&#60;col&#62;.
579</P><P>
580
581<A NAME="Declaring Vertex and Fragment Programs"></A>
582<HR SIZE=1>
583<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
584<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_17.html#SEC34"> &lt; </A>]</TD>
585<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_15.html#SEC24"> Up </A>]</TD>
586<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_19.html#SEC76"> &gt; </A>]</TD>
587<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>
588<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
589<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
590<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
591</TR></TABLE>
592<BR> 
593<FONT SIZE="-1">
594This document was generated
595by <I>Steve Streeting</I> on <I>, 12 2006</I>
596using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
597"><I>texi2html</I></A>
598
599</BODY>
600</HTML>
Note: See TracBrowser for help on using the repository browser.