class_fixedmaterial.rst 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_FixedMaterial:
  4. FixedMaterial
  5. =============
  6. **Inherits:** :ref:`Material<class_material>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Simple Material with a fixed parameter set.
  11. Member Functions
  12. ----------------
  13. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`bool<class_bool>` | :ref:`get_fixed_flag<class_FixedMaterial_get_fixed_flag>` **(** :ref:`int<class_int>` flag **)** const |
  15. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`get_light_shader<class_FixedMaterial_get_light_shader>` **(** **)** const |
  17. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`get_parameter<class_FixedMaterial_get_parameter>` **(** :ref:`int<class_int>` param **)** const |
  19. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_point_size<class_FixedMaterial_get_point_size>` **(** **)** const |
  21. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_texcoord_mode<class_FixedMaterial_get_texcoord_mode>` **(** :ref:`int<class_int>` param **)** const |
  23. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Texture<class_texture>` | :ref:`get_texture<class_FixedMaterial_get_texture>` **(** :ref:`int<class_int>` param **)** const |
  25. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Transform<class_transform>` | :ref:`get_uv_transform<class_FixedMaterial_get_uv_transform>` **(** **)** const |
  27. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_fixed_flag<class_FixedMaterial_set_fixed_flag>` **(** :ref:`int<class_int>` flag, :ref:`bool<class_bool>` value **)** |
  29. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_light_shader<class_FixedMaterial_set_light_shader>` **(** :ref:`int<class_int>` shader **)** |
  31. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_parameter<class_FixedMaterial_set_parameter>` **(** :ref:`int<class_int>` param, :ref:`Variant<class_variant>` value **)** |
  33. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_point_size<class_FixedMaterial_set_point_size>` **(** :ref:`float<class_float>` size **)** |
  35. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_texcoord_mode<class_FixedMaterial_set_texcoord_mode>` **(** :ref:`int<class_int>` param, :ref:`int<class_int>` mode **)** |
  37. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_texture<class_FixedMaterial_set_texture>` **(** :ref:`int<class_int>` param, :ref:`Texture<class_texture>` texture **)** |
  39. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_uv_transform<class_FixedMaterial_set_uv_transform>` **(** :ref:`Transform<class_transform>` transform **)** |
  41. +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  42. Numeric Constants
  43. -----------------
  44. - **PARAM_DIFFUSE** = **0** --- Diffuse Lighting (light scattered from surface).
  45. - **PARAM_DETAIL** = **1** --- Detail Layer for diffuse lighting.
  46. - **PARAM_SPECULAR** = **2** --- Specular Lighting (light reflected from the surface).
  47. - **PARAM_EMISSION** = **3** --- Emission Lighting (light emitted from the surface).
  48. - **PARAM_SPECULAR_EXP** = **4** --- Specular Exponent (size of the specular dot).
  49. - **PARAM_GLOW** = **5** --- Glow (Visible emitted scattered light).
  50. - **PARAM_NORMAL** = **6** --- Normal Map (irregularity map).
  51. - **PARAM_SHADE_PARAM** = **7**
  52. - **PARAM_MAX** = **8** --- Maximum amount of parameters.
  53. - **TEXCOORD_UV** = **0** --- Read texture coordinates from the UV array.
  54. - **TEXCOORD_UV_TRANSFORM** = **1** --- Read texture coordinates from the UV array and transform them by uv_xform.
  55. - **TEXCOORD_UV2** = **2** --- Read texture coordinates from the UV2 array.
  56. - **TEXCOORD_SPHERE** = **3**
  57. - **FLAG_USE_ALPHA** = **0**
  58. - **FLAG_USE_COLOR_ARRAY** = **1**
  59. - **FLAG_USE_POINT_SIZE** = **2**
  60. - **FLAG_DISCARD_ALPHA** = **3**
  61. - **LIGHT_SHADER_LAMBERT** = **0**
  62. - **LIGHT_SHADER_WRAP** = **1**
  63. - **LIGHT_SHADER_VELVET** = **2**
  64. - **LIGHT_SHADER_TOON** = **3**
  65. Description
  66. -----------
  67. FixedMaterial is a simple type of material :ref:`Resource<class_resource>`, which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to :ref:`ShaderMaterial<class_shadermaterial>` for most simple use cases.
  68. Member Function Description
  69. ---------------------------
  70. .. _class_FixedMaterial_get_fixed_flag:
  71. - :ref:`bool<class_bool>` **get_fixed_flag** **(** :ref:`int<class_int>` flag **)** const
  72. .. _class_FixedMaterial_get_light_shader:
  73. - :ref:`int<class_int>` **get_light_shader** **(** **)** const
  74. .. _class_FixedMaterial_get_parameter:
  75. - void **get_parameter** **(** :ref:`int<class_int>` param **)** const
  76. Return a parameter, parameters are defined in the PARAM\_\* enum. The type of each parameter may change, so it's best to check the enum.
  77. .. _class_FixedMaterial_get_point_size:
  78. - :ref:`float<class_float>` **get_point_size** **(** **)** const
  79. .. _class_FixedMaterial_get_texcoord_mode:
  80. - :ref:`int<class_int>` **get_texcoord_mode** **(** :ref:`int<class_int>` param **)** const
  81. Return the texture coordinate mode. Each texture param (from the PARAM\_\* enum) has one. It defines how the textures are mapped to the object.
  82. .. _class_FixedMaterial_get_texture:
  83. - :ref:`Texture<class_texture>` **get_texture** **(** :ref:`int<class_int>` param **)** const
  84. Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see :ref:`set_texcoord_mode<class_FixedMaterial_set_texcoord_mode>`).
  85. .. _class_FixedMaterial_get_uv_transform:
  86. - :ref:`Transform<class_transform>` **get_uv_transform** **(** **)** const
  87. Returns the special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.
  88. .. _class_FixedMaterial_set_fixed_flag:
  89. - void **set_fixed_flag** **(** :ref:`int<class_int>` flag, :ref:`bool<class_bool>` value **)**
  90. .. _class_FixedMaterial_set_light_shader:
  91. - void **set_light_shader** **(** :ref:`int<class_int>` shader **)**
  92. .. _class_FixedMaterial_set_parameter:
  93. - void **set_parameter** **(** :ref:`int<class_int>` param, :ref:`Variant<class_variant>` value **)**
  94. Set a parameter, parameters are defined in the PARAM\_\* enum. The type of each parameter may change, so it's best to check the enum.
  95. .. _class_FixedMaterial_set_point_size:
  96. - void **set_point_size** **(** :ref:`float<class_float>` size **)**
  97. .. _class_FixedMaterial_set_texcoord_mode:
  98. - void **set_texcoord_mode** **(** :ref:`int<class_int>` param, :ref:`int<class_int>` mode **)**
  99. Set the texture coordinate mode. Each texture param (from the PARAM\_\* enum) has one. It defines how the textures are mapped to the object.
  100. .. _class_FixedMaterial_set_texture:
  101. - void **set_texture** **(** :ref:`int<class_int>` param, :ref:`Texture<class_texture>` texture **)**
  102. Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see :ref:`set_texcoord_mode<class_FixedMaterial_set_texcoord_mode>`).
  103. .. _class_FixedMaterial_set_uv_transform:
  104. - void **set_uv_transform** **(** :ref:`Transform<class_transform>` transform **)**
  105. Sets a special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.