1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __E_MATERIAL_TYPES_H_INCLUDED__
\r
6 #define __E_MATERIAL_TYPES_H_INCLUDED__
\r
13 //! Abstracted and easy to use fixed function/programmable pipeline material modes.
\r
14 enum E_MATERIAL_TYPE
\r
16 //! Standard solid material.
\r
17 /** Only first texture is used, which is supposed to be the
\r
18 diffuse material. */
\r
21 //! Solid material with 2 texture layers.
\r
22 /** The second is blended onto the first using the alpha value
\r
23 of the vertex colors. This material is currently not implemented in OpenGL.
\r
27 //! Material type with standard lightmap technique
\r
28 /** There should be 2 textures: The first texture layer is a
\r
29 diffuse map, the second is a light map. Dynamic light is
\r
33 //! Material type with lightmap technique like EMT_LIGHTMAP.
\r
34 /** But lightmap and diffuse texture are added instead of modulated. */
\r
37 //! Material type with standard lightmap technique
\r
38 /** There should be 2 textures: The first texture layer is a
\r
39 diffuse map, the second is a light map. Dynamic light is
\r
40 ignored. The texture colors are effectively multiplied by 2
\r
41 for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */
\r
44 //! Material type with standard lightmap technique
\r
45 /** There should be 2 textures: The first texture layer is a
\r
46 diffuse map, the second is a light map. Dynamic light is
\r
47 ignored. The texture colors are effectively multiplied by 4
\r
48 for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */
\r
51 //! Like EMT_LIGHTMAP, but also supports dynamic lighting.
\r
52 EMT_LIGHTMAP_LIGHTING,
\r
54 //! Like EMT_LIGHTMAP_M2, but also supports dynamic lighting.
\r
55 EMT_LIGHTMAP_LIGHTING_M2,
\r
57 //! Like EMT_LIGHTMAP_M4, but also supports dynamic lighting.
\r
58 EMT_LIGHTMAP_LIGHTING_M4,
\r
60 //! Detail mapped material.
\r
61 /** The first texture is diffuse color map, the second is added
\r
62 to this and usually displayed with a bigger scale value so that
\r
63 it adds more detail. The detail map is added to the diffuse map
\r
64 using ADD_SIGNED, so that it is possible to add and subtract
\r
65 color from the diffuse map. For example a value of
\r
66 (127,127,127) will not change the appearance of the diffuse map
\r
67 at all. Often used for terrain rendering. */
\r
70 //! Look like a reflection of the environment around it.
\r
71 /** To make this possible, a texture called 'sphere map' is
\r
72 used, which must be set as the first texture. */
\r
75 //! A reflecting material with an optional non reflecting texture layer.
\r
76 /** The reflection map should be set as first texture. */
\r
77 EMT_REFLECTION_2_LAYER,
\r
79 //! A transparent material.
\r
80 /** Only the first texture is used. The new color is calculated
\r
81 by simply adding the source color and the dest color. This
\r
82 means if for example a billboard using a texture with black
\r
83 background and a red circle on it is drawn with this material,
\r
84 the result is that only the red circle will be drawn a little
\r
85 bit transparent, and everything which was black is 100%
\r
86 transparent and not visible. This material type is useful for
\r
87 particle effects. */
\r
88 EMT_TRANSPARENT_ADD_COLOR,
\r
90 //! Makes the material transparent based on the texture alpha channel.
\r
91 /** The final color is blended together from the destination
\r
92 color and the texture color, using the alpha channel value as
\r
93 blend factor. Only first texture is used. If you are using
\r
94 this material with small textures, it is a good idea to load
\r
95 the texture in 32 bit mode
\r
96 (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha
\r
97 ref is used, which can be manipulated using
\r
98 SMaterial::MaterialTypeParam. This value controls how sharp the
\r
99 edges become when going from a transparent to a solid spot on
\r
101 EMT_TRANSPARENT_ALPHA_CHANNEL,
\r
103 //! Makes the material transparent based on the texture alpha channel.
\r
104 /** If the alpha channel value is greater than 127, a
\r
105 pixel is written to the target, otherwise not. This
\r
106 material does not use alpha blending and is a lot faster
\r
107 than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
\r
108 stuff like leaves of plants, because the borders are not
\r
109 blurry but sharp. Only first texture is used. If you are
\r
110 using this material with small textures and 3d object, it
\r
111 is a good idea to load the texture in 32 bit mode
\r
112 (video::IVideoDriver::setTextureCreationFlag()). */
\r
113 EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
\r
115 //! Makes the material transparent based on the vertex alpha value.
\r
116 EMT_TRANSPARENT_VERTEX_ALPHA,
\r
118 //! A transparent reflecting material with an optional additional non reflecting texture layer.
\r
119 /** The reflection map should be set as first texture. The
\r
120 transparency depends on the alpha value in the vertex colors. A
\r
121 texture which will not reflect can be set as second texture.*/
\r
122 EMT_TRANSPARENT_REFLECTION_2_LAYER,
\r
124 //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC )
\r
125 /** Using only first texture. Generic blending method.
\r
126 The blend function is set to SMaterial::MaterialTypeParam with
\r
127 pack_textureBlendFunc (for 2D) or pack_textureBlendFuncSeparate (for 3D). */
\r
128 EMT_ONETEXTURE_BLEND,
\r
130 //! This value is not used. It only forces this enumeration to compile to 32 bit.
\r
131 EMT_FORCE_32BIT = 0x7fffffff
\r
134 //! Array holding the built in material type names
\r
135 const char* const sBuiltInMaterialTypeNames[] =
\r
144 "lightmap_light_m2",
\r
145 "lightmap_light_m4",
\r
148 "reflection_2layer",
\r
151 "trans_alphach_ref",
\r
152 "trans_vertex_alpha",
\r
153 "trans_reflection_2layer",
\r
154 "onetexture_blend",
\r
158 } // end namespace video
\r
159 } // end namespace irr
\r
162 #endif // __E_MATERIAL_TYPES_H_INCLUDED__
\r