EMaterialTypes.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "irrTypes.h"
  6. namespace irr
  7. {
  8. namespace video
  9. {
  10. //! Abstracted and easy to use fixed function/programmable pipeline material modes.
  11. enum E_MATERIAL_TYPE
  12. {
  13. //! Standard solid material.
  14. /** Only first texture is used, which is supposed to be the
  15. diffuse material. */
  16. EMT_SOLID = 0,
  17. //! Makes the material transparent based on the texture alpha channel.
  18. /** The final color is blended together from the destination
  19. color and the texture color, using the alpha channel value as
  20. blend factor. Only first texture is used. If you are using
  21. this material with small textures, it is a good idea to load
  22. the texture in 32 bit mode
  23. (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha
  24. ref is used, which can be manipulated using
  25. SMaterial::MaterialTypeParam. This value controls how sharp the
  26. edges become when going from a transparent to a solid spot on
  27. the texture. */
  28. EMT_TRANSPARENT_ALPHA_CHANNEL,
  29. //! Makes the material transparent based on the texture alpha channel.
  30. /** If the alpha channel value is greater than 127, a
  31. pixel is written to the target, otherwise not. This
  32. material does not use alpha blending and is a lot faster
  33. than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
  34. stuff like leaves of plants, because the borders are not
  35. blurry but sharp. Only first texture is used. If you are
  36. using this material with small textures and 3d object, it
  37. is a good idea to load the texture in 32 bit mode
  38. (video::IVideoDriver::setTextureCreationFlag()). */
  39. EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
  40. //! Makes the material transparent based on the vertex alpha value.
  41. EMT_TRANSPARENT_VERTEX_ALPHA,
  42. //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC )
  43. /** Using only first texture. Generic blending method.
  44. The blend function is set to SMaterial::MaterialTypeParam with
  45. pack_textureBlendFunc (for 2D) or pack_textureBlendFuncSeparate (for 3D). */
  46. EMT_ONETEXTURE_BLEND,
  47. //! This value is not used. It only forces this enumeration to compile to 32 bit.
  48. EMT_FORCE_32BIT = 0x7fffffff
  49. };
  50. //! Array holding the built in material type names
  51. const char *const sBuiltInMaterialTypeNames[] = {
  52. "solid",
  53. "trans_alphach",
  54. "trans_alphach_ref",
  55. "trans_vertex_alpha",
  56. "onetexture_blend",
  57. 0,
  58. };
  59. constexpr u32 numBuiltInMaterials =
  60. sizeof(sBuiltInMaterialTypeNames) / sizeof(char *) - 1;
  61. } // end namespace video
  62. } // end namespace irr