diff options
Diffstat (limited to 'libraries/irrlicht-1.8/include/EMaterialTypes.h')
-rw-r--r-- | libraries/irrlicht-1.8/include/EMaterialTypes.h | 468 |
1 files changed, 234 insertions, 234 deletions
diff --git a/libraries/irrlicht-1.8/include/EMaterialTypes.h b/libraries/irrlicht-1.8/include/EMaterialTypes.h index 086ca34..5e5e075 100644 --- a/libraries/irrlicht-1.8/include/EMaterialTypes.h +++ b/libraries/irrlicht-1.8/include/EMaterialTypes.h | |||
@@ -1,234 +1,234 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __E_MATERIAL_TYPES_H_INCLUDED__ | 5 | #ifndef __E_MATERIAL_TYPES_H_INCLUDED__ |
6 | #define __E_MATERIAL_TYPES_H_INCLUDED__ | 6 | #define __E_MATERIAL_TYPES_H_INCLUDED__ |
7 | 7 | ||
8 | namespace irr | 8 | namespace irr |
9 | { | 9 | { |
10 | namespace video | 10 | namespace video |
11 | { | 11 | { |
12 | 12 | ||
13 | //! Abstracted and easy to use fixed function/programmable pipeline material modes. | 13 | //! Abstracted and easy to use fixed function/programmable pipeline material modes. |
14 | enum E_MATERIAL_TYPE | 14 | enum E_MATERIAL_TYPE |
15 | { | 15 | { |
16 | //! Standard solid material. | 16 | //! Standard solid material. |
17 | /** Only first texture is used, which is supposed to be the | 17 | /** Only first texture is used, which is supposed to be the |
18 | diffuse material. */ | 18 | diffuse material. */ |
19 | EMT_SOLID = 0, | 19 | EMT_SOLID = 0, |
20 | 20 | ||
21 | //! Solid material with 2 texture layers. | 21 | //! Solid material with 2 texture layers. |
22 | /** The second is blended onto the first using the alpha value | 22 | /** The second is blended onto the first using the alpha value |
23 | of the vertex colors. This material is currently not implemented in OpenGL. | 23 | of the vertex colors. This material is currently not implemented in OpenGL. |
24 | */ | 24 | */ |
25 | EMT_SOLID_2_LAYER, | 25 | EMT_SOLID_2_LAYER, |
26 | 26 | ||
27 | //! Material type with standard lightmap technique | 27 | //! Material type with standard lightmap technique |
28 | /** There should be 2 textures: The first texture layer is a | 28 | /** There should be 2 textures: The first texture layer is a |
29 | diffuse map, the second is a light map. Dynamic light is | 29 | diffuse map, the second is a light map. Dynamic light is |
30 | ignored. */ | 30 | ignored. */ |
31 | EMT_LIGHTMAP, | 31 | EMT_LIGHTMAP, |
32 | 32 | ||
33 | //! Material type with lightmap technique like EMT_LIGHTMAP. | 33 | //! Material type with lightmap technique like EMT_LIGHTMAP. |
34 | /** But lightmap and diffuse texture are added instead of modulated. */ | 34 | /** But lightmap and diffuse texture are added instead of modulated. */ |
35 | EMT_LIGHTMAP_ADD, | 35 | EMT_LIGHTMAP_ADD, |
36 | 36 | ||
37 | //! Material type with standard lightmap technique | 37 | //! Material type with standard lightmap technique |
38 | /** There should be 2 textures: The first texture layer is a | 38 | /** There should be 2 textures: The first texture layer is a |
39 | diffuse map, the second is a light map. Dynamic light is | 39 | diffuse map, the second is a light map. Dynamic light is |
40 | ignored. The texture colors are effectively multiplied by 2 | 40 | ignored. The texture colors are effectively multiplied by 2 |
41 | for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */ | 41 | for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */ |
42 | EMT_LIGHTMAP_M2, | 42 | EMT_LIGHTMAP_M2, |
43 | 43 | ||
44 | //! Material type with standard lightmap technique | 44 | //! Material type with standard lightmap technique |
45 | /** There should be 2 textures: The first texture layer is a | 45 | /** There should be 2 textures: The first texture layer is a |
46 | diffuse map, the second is a light map. Dynamic light is | 46 | diffuse map, the second is a light map. Dynamic light is |
47 | ignored. The texture colors are effectively multiplyied by 4 | 47 | ignored. The texture colors are effectively multiplyied by 4 |
48 | for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */ | 48 | for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */ |
49 | EMT_LIGHTMAP_M4, | 49 | EMT_LIGHTMAP_M4, |
50 | 50 | ||
51 | //! Like EMT_LIGHTMAP, but also supports dynamic lighting. | 51 | //! Like EMT_LIGHTMAP, but also supports dynamic lighting. |
52 | EMT_LIGHTMAP_LIGHTING, | 52 | EMT_LIGHTMAP_LIGHTING, |
53 | 53 | ||
54 | //! Like EMT_LIGHTMAP_M2, but also supports dynamic lighting. | 54 | //! Like EMT_LIGHTMAP_M2, but also supports dynamic lighting. |
55 | EMT_LIGHTMAP_LIGHTING_M2, | 55 | EMT_LIGHTMAP_LIGHTING_M2, |
56 | 56 | ||
57 | //! Like EMT_LIGHTMAP_4, but also supports dynamic lighting. | 57 | //! Like EMT_LIGHTMAP_4, but also supports dynamic lighting. |
58 | EMT_LIGHTMAP_LIGHTING_M4, | 58 | EMT_LIGHTMAP_LIGHTING_M4, |
59 | 59 | ||
60 | //! Detail mapped material. | 60 | //! Detail mapped material. |
61 | /** The first texture is diffuse color map, the second is added | 61 | /** The first texture is diffuse color map, the second is added |
62 | to this and usually displayed with a bigger scale value so that | 62 | to this and usually displayed with a bigger scale value so that |
63 | it adds more detail. The detail map is added to the diffuse map | 63 | it adds more detail. The detail map is added to the diffuse map |
64 | using ADD_SIGNED, so that it is possible to add and substract | 64 | using ADD_SIGNED, so that it is possible to add and substract |
65 | color from the diffuse map. For example a value of | 65 | color from the diffuse map. For example a value of |
66 | (127,127,127) will not change the appearance of the diffuse map | 66 | (127,127,127) will not change the appearance of the diffuse map |
67 | at all. Often used for terrain rendering. */ | 67 | at all. Often used for terrain rendering. */ |
68 | EMT_DETAIL_MAP, | 68 | EMT_DETAIL_MAP, |
69 | 69 | ||
70 | //! Look like a reflection of the environment around it. | 70 | //! Look like a reflection of the environment around it. |
71 | /** To make this possible, a texture called 'sphere map' is | 71 | /** To make this possible, a texture called 'sphere map' is |
72 | used, which must be set as the first texture. */ | 72 | used, which must be set as the first texture. */ |
73 | EMT_SPHERE_MAP, | 73 | EMT_SPHERE_MAP, |
74 | 74 | ||
75 | //! A reflecting material with an optional non reflecting texture layer. | 75 | //! A reflecting material with an optional non reflecting texture layer. |
76 | /** The reflection map should be set as first texture. */ | 76 | /** The reflection map should be set as first texture. */ |
77 | EMT_REFLECTION_2_LAYER, | 77 | EMT_REFLECTION_2_LAYER, |
78 | 78 | ||
79 | //! A transparent material. | 79 | //! A transparent material. |
80 | /** Only the first texture is used. The new color is calculated | 80 | /** Only the first texture is used. The new color is calculated |
81 | by simply adding the source color and the dest color. This | 81 | by simply adding the source color and the dest color. This |
82 | means if for example a billboard using a texture with black | 82 | means if for example a billboard using a texture with black |
83 | background and a red circle on it is drawn with this material, | 83 | background and a red circle on it is drawn with this material, |
84 | the result is that only the red circle will be drawn a little | 84 | the result is that only the red circle will be drawn a little |
85 | bit transparent, and everything which was black is 100% | 85 | bit transparent, and everything which was black is 100% |
86 | transparent and not visible. This material type is useful for | 86 | transparent and not visible. This material type is useful for |
87 | particle effects. */ | 87 | particle effects. */ |
88 | EMT_TRANSPARENT_ADD_COLOR, | 88 | EMT_TRANSPARENT_ADD_COLOR, |
89 | 89 | ||
90 | //! Makes the material transparent based on the texture alpha channel. | 90 | //! Makes the material transparent based on the texture alpha channel. |
91 | /** The final color is blended together from the destination | 91 | /** The final color is blended together from the destination |
92 | color and the texture color, using the alpha channel value as | 92 | color and the texture color, using the alpha channel value as |
93 | blend factor. Only first texture is used. If you are using | 93 | blend factor. Only first texture is used. If you are using |
94 | this material with small textures, it is a good idea to load | 94 | this material with small textures, it is a good idea to load |
95 | the texture in 32 bit mode | 95 | the texture in 32 bit mode |
96 | (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha | 96 | (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha |
97 | ref is used, which can be manipulated using | 97 | ref is used, which can be manipulated using |
98 | SMaterial::MaterialTypeParam. This value controls how sharp the | 98 | SMaterial::MaterialTypeParam. This value controls how sharp the |
99 | edges become when going from a transparent to a solid spot on | 99 | edges become when going from a transparent to a solid spot on |
100 | the texture. */ | 100 | the texture. */ |
101 | EMT_TRANSPARENT_ALPHA_CHANNEL, | 101 | EMT_TRANSPARENT_ALPHA_CHANNEL, |
102 | 102 | ||
103 | //! Makes the material transparent based on the texture alpha channel. | 103 | //! Makes the material transparent based on the texture alpha channel. |
104 | /** If the alpha channel value is greater than 127, a | 104 | /** If the alpha channel value is greater than 127, a |
105 | pixel is written to the target, otherwise not. This | 105 | pixel is written to the target, otherwise not. This |
106 | material does not use alpha blending and is a lot faster | 106 | material does not use alpha blending and is a lot faster |
107 | than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing | 107 | than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing |
108 | stuff like leafes of plants, because the borders are not | 108 | stuff like leafes of plants, because the borders are not |
109 | blurry but sharp. Only first texture is used. If you are | 109 | blurry but sharp. Only first texture is used. If you are |
110 | using this material with small textures and 3d object, it | 110 | using this material with small textures and 3d object, it |
111 | is a good idea to load the texture in 32 bit mode | 111 | is a good idea to load the texture in 32 bit mode |
112 | (video::IVideoDriver::setTextureCreationFlag()). */ | 112 | (video::IVideoDriver::setTextureCreationFlag()). */ |
113 | EMT_TRANSPARENT_ALPHA_CHANNEL_REF, | 113 | EMT_TRANSPARENT_ALPHA_CHANNEL_REF, |
114 | 114 | ||
115 | //! Makes the material transparent based on the vertex alpha value. | 115 | //! Makes the material transparent based on the vertex alpha value. |
116 | EMT_TRANSPARENT_VERTEX_ALPHA, | 116 | EMT_TRANSPARENT_VERTEX_ALPHA, |
117 | 117 | ||
118 | //! A transparent reflecting material with an optional additional non reflecting texture layer. | 118 | //! A transparent reflecting material with an optional additional non reflecting texture layer. |
119 | /** The reflection map should be set as first texture. The | 119 | /** The reflection map should be set as first texture. The |
120 | transparency depends on the alpha value in the vertex colors. A | 120 | transparency depends on the alpha value in the vertex colors. A |
121 | texture which will not reflect can be set as second texture. | 121 | texture which will not reflect can be set as second texture. |
122 | Please note that this material type is currently not 100% | 122 | Please note that this material type is currently not 100% |
123 | implemented in OpenGL. */ | 123 | implemented in OpenGL. */ |
124 | EMT_TRANSPARENT_REFLECTION_2_LAYER, | 124 | EMT_TRANSPARENT_REFLECTION_2_LAYER, |
125 | 125 | ||
126 | //! A solid normal map renderer. | 126 | //! A solid normal map renderer. |
127 | /** First texture is the color map, the second should be the | 127 | /** First texture is the color map, the second should be the |
128 | normal map. Note that you should use this material only when | 128 | normal map. Note that you should use this material only when |
129 | drawing geometry consisting of vertices of type | 129 | drawing geometry consisting of vertices of type |
130 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into | 130 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into |
131 | this format using IMeshManipulator::createMeshWithTangents() | 131 | this format using IMeshManipulator::createMeshWithTangents() |
132 | (See SpecialFX2 Tutorial). This shader runs on vertex shader | 132 | (See SpecialFX2 Tutorial). This shader runs on vertex shader |
133 | 1.1 and pixel shader 1.1 capable hardware and falls back to a | 133 | 1.1 and pixel shader 1.1 capable hardware and falls back to a |
134 | fixed function lighted material if this hardware is not | 134 | fixed function lighted material if this hardware is not |
135 | available. Only two lights are supported by this shader, if | 135 | available. Only two lights are supported by this shader, if |
136 | there are more, the nearest two are chosen. */ | 136 | there are more, the nearest two are chosen. */ |
137 | EMT_NORMAL_MAP_SOLID, | 137 | EMT_NORMAL_MAP_SOLID, |
138 | 138 | ||
139 | //! A transparent normal map renderer. | 139 | //! A transparent normal map renderer. |
140 | /** First texture is the color map, the second should be the | 140 | /** First texture is the color map, the second should be the |
141 | normal map. Note that you should use this material only when | 141 | normal map. Note that you should use this material only when |
142 | drawing geometry consisting of vertices of type | 142 | drawing geometry consisting of vertices of type |
143 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into | 143 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into |
144 | this format using IMeshManipulator::createMeshWithTangents() | 144 | this format using IMeshManipulator::createMeshWithTangents() |
145 | (See SpecialFX2 Tutorial). This shader runs on vertex shader | 145 | (See SpecialFX2 Tutorial). This shader runs on vertex shader |
146 | 1.1 and pixel shader 1.1 capable hardware and falls back to a | 146 | 1.1 and pixel shader 1.1 capable hardware and falls back to a |
147 | fixed function lighted material if this hardware is not | 147 | fixed function lighted material if this hardware is not |
148 | available. Only two lights are supported by this shader, if | 148 | available. Only two lights are supported by this shader, if |
149 | there are more, the nearest two are chosen. */ | 149 | there are more, the nearest two are chosen. */ |
150 | EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR, | 150 | EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR, |
151 | 151 | ||
152 | //! A transparent (based on the vertex alpha value) normal map renderer. | 152 | //! A transparent (based on the vertex alpha value) normal map renderer. |
153 | /** First texture is the color map, the second should be the | 153 | /** First texture is the color map, the second should be the |
154 | normal map. Note that you should use this material only when | 154 | normal map. Note that you should use this material only when |
155 | drawing geometry consisting of vertices of type | 155 | drawing geometry consisting of vertices of type |
156 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into | 156 | S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into |
157 | this format using IMeshManipulator::createMeshWithTangents() | 157 | this format using IMeshManipulator::createMeshWithTangents() |
158 | (See SpecialFX2 Tutorial). This shader runs on vertex shader | 158 | (See SpecialFX2 Tutorial). This shader runs on vertex shader |
159 | 1.1 and pixel shader 1.1 capable hardware and falls back to a | 159 | 1.1 and pixel shader 1.1 capable hardware and falls back to a |
160 | fixed function lighted material if this hardware is not | 160 | fixed function lighted material if this hardware is not |
161 | available. Only two lights are supported by this shader, if | 161 | available. Only two lights are supported by this shader, if |
162 | there are more, the nearest two are chosen. */ | 162 | there are more, the nearest two are chosen. */ |
163 | EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA, | 163 | EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA, |
164 | 164 | ||
165 | //! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping. | 165 | //! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping. |
166 | /** Looks a lot more realistic. This only works when the | 166 | /** Looks a lot more realistic. This only works when the |
167 | hardware supports at least vertex shader 1.1 and pixel shader | 167 | hardware supports at least vertex shader 1.1 and pixel shader |
168 | 1.4. First texture is the color map, the second should be the | 168 | 1.4. First texture is the color map, the second should be the |
169 | normal map. The normal map texture should contain the height | 169 | normal map. The normal map texture should contain the height |
170 | value in the alpha component. The | 170 | value in the alpha component. The |
171 | IVideoDriver::makeNormalMapTexture() method writes this value | 171 | IVideoDriver::makeNormalMapTexture() method writes this value |
172 | automatically when creating normal maps from a heightmap when | 172 | automatically when creating normal maps from a heightmap when |
173 | using a 32 bit texture. The height scale of the material | 173 | using a 32 bit texture. The height scale of the material |
174 | (affecting the bumpiness) is being controlled by the | 174 | (affecting the bumpiness) is being controlled by the |
175 | SMaterial::MaterialTypeParam member. If set to zero, the | 175 | SMaterial::MaterialTypeParam member. If set to zero, the |
176 | default value (0.02f) will be applied. Otherwise the value set | 176 | default value (0.02f) will be applied. Otherwise the value set |
177 | in SMaterial::MaterialTypeParam is taken. This value depends on | 177 | in SMaterial::MaterialTypeParam is taken. This value depends on |
178 | with which scale the texture is mapped on the material. Too | 178 | with which scale the texture is mapped on the material. Too |
179 | high or low values of MaterialTypeParam can result in strange | 179 | high or low values of MaterialTypeParam can result in strange |
180 | artifacts. */ | 180 | artifacts. */ |
181 | EMT_PARALLAX_MAP_SOLID, | 181 | EMT_PARALLAX_MAP_SOLID, |
182 | 182 | ||
183 | //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. | 183 | //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. |
184 | /** Using EMT_TRANSPARENT_ADD_COLOR as base material. */ | 184 | /** Using EMT_TRANSPARENT_ADD_COLOR as base material. */ |
185 | EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR, | 185 | EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR, |
186 | 186 | ||
187 | //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. | 187 | //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. |
188 | /** Using EMT_TRANSPARENT_VERTEX_ALPHA as base material. */ | 188 | /** Using EMT_TRANSPARENT_VERTEX_ALPHA as base material. */ |
189 | EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA, | 189 | EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA, |
190 | 190 | ||
191 | //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC ) | 191 | //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC ) |
192 | /** Using only first texture. Generic blending method. */ | 192 | /** Using only first texture. Generic blending method. */ |
193 | EMT_ONETEXTURE_BLEND, | 193 | EMT_ONETEXTURE_BLEND, |
194 | 194 | ||
195 | //! This value is not used. It only forces this enumeration to compile to 32 bit. | 195 | //! This value is not used. It only forces this enumeration to compile to 32 bit. |
196 | EMT_FORCE_32BIT = 0x7fffffff | 196 | EMT_FORCE_32BIT = 0x7fffffff |
197 | }; | 197 | }; |
198 | 198 | ||
199 | //! Array holding the built in material type names | 199 | //! Array holding the built in material type names |
200 | const char* const sBuiltInMaterialTypeNames[] = | 200 | const char* const sBuiltInMaterialTypeNames[] = |
201 | { | 201 | { |
202 | "solid", | 202 | "solid", |
203 | "solid_2layer", | 203 | "solid_2layer", |
204 | "lightmap", | 204 | "lightmap", |
205 | "lightmap_add", | 205 | "lightmap_add", |
206 | "lightmap_m2", | 206 | "lightmap_m2", |
207 | "lightmap_m4", | 207 | "lightmap_m4", |
208 | "lightmap_light", | 208 | "lightmap_light", |
209 | "lightmap_light_m2", | 209 | "lightmap_light_m2", |
210 | "lightmap_light_m4", | 210 | "lightmap_light_m4", |
211 | "detail_map", | 211 | "detail_map", |
212 | "sphere_map", | 212 | "sphere_map", |
213 | "reflection_2layer", | 213 | "reflection_2layer", |
214 | "trans_add", | 214 | "trans_add", |
215 | "trans_alphach", | 215 | "trans_alphach", |
216 | "trans_alphach_ref", | 216 | "trans_alphach_ref", |
217 | "trans_vertex_alpha", | 217 | "trans_vertex_alpha", |
218 | "trans_reflection_2layer", | 218 | "trans_reflection_2layer", |
219 | "normalmap_solid", | 219 | "normalmap_solid", |
220 | "normalmap_trans_add", | 220 | "normalmap_trans_add", |
221 | "normalmap_trans_vertexalpha", | 221 | "normalmap_trans_vertexalpha", |
222 | "parallaxmap_solid", | 222 | "parallaxmap_solid", |
223 | "parallaxmap_trans_add", | 223 | "parallaxmap_trans_add", |
224 | "parallaxmap_trans_vertexalpha", | 224 | "parallaxmap_trans_vertexalpha", |
225 | "onetexture_blend", | 225 | "onetexture_blend", |
226 | 0 | 226 | 0 |
227 | }; | 227 | }; |
228 | 228 | ||
229 | } // end namespace video | 229 | } // end namespace video |
230 | } // end namespace irr | 230 | } // end namespace irr |
231 | 231 | ||
232 | 232 | ||
233 | #endif // __E_MATERIAL_TYPES_H_INCLUDED__ | 233 | #endif // __E_MATERIAL_TYPES_H_INCLUDED__ |
234 | 234 | ||