class_rdsamplerstate.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RDSamplerState.xml.
  6. .. _class_RDSamplerState:
  7. RDSamplerState
  8. ==============
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Sampler state (used by :ref:`RenderingDevice<class_RenderingDevice>`).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This object is used by :ref:`RenderingDevice<class_RenderingDevice>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  21. | :ref:`float<class_float>` | :ref:`anisotropy_max<class_RDSamplerState_property_anisotropy_max>` | ``1.0`` |
  22. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  23. | :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` | :ref:`border_color<class_RDSamplerState_property_border_color>` | ``2`` |
  24. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  25. | :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` | :ref:`compare_op<class_RDSamplerState_property_compare_op>` | ``7`` |
  26. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`enable_compare<class_RDSamplerState_property_enable_compare>` | ``false`` |
  28. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`lod_bias<class_RDSamplerState_property_lod_bias>` | ``0.0`` |
  30. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  31. | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`mag_filter<class_RDSamplerState_property_mag_filter>` | ``0`` |
  32. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`max_lod<class_RDSamplerState_property_max_lod>` | ``1e+20`` |
  34. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  35. | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`min_filter<class_RDSamplerState_property_min_filter>` | ``0`` |
  36. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  37. | :ref:`float<class_float>` | :ref:`min_lod<class_RDSamplerState_property_min_lod>` | ``0.0`` |
  38. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  39. | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`mip_filter<class_RDSamplerState_property_mip_filter>` | ``0`` |
  40. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  41. | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_u<class_RDSamplerState_property_repeat_u>` | ``2`` |
  42. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  43. | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_v<class_RDSamplerState_property_repeat_v>` | ``2`` |
  44. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  45. | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_w<class_RDSamplerState_property_repeat_w>` | ``2`` |
  46. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  47. | :ref:`bool<class_bool>` | :ref:`unnormalized_uvw<class_RDSamplerState_property_unnormalized_uvw>` | ``false`` |
  48. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  49. | :ref:`bool<class_bool>` | :ref:`use_anisotropy<class_RDSamplerState_property_use_anisotropy>` | ``false`` |
  50. +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_RDSamplerState_property_anisotropy_max:
  57. .. rst-class:: classref-property
  58. :ref:`float<class_float>` **anisotropy_max** = ``1.0``
  59. .. rst-class:: classref-property-setget
  60. - void **set_anisotropy_max** **(** :ref:`float<class_float>` value **)**
  61. - :ref:`float<class_float>` **get_anisotropy_max** **(** **)**
  62. Maximum anisotropy that can be used when sampling. Only effective if :ref:`use_anisotropy<class_RDSamplerState_property_use_anisotropy>` is ``true``. Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics hardware only supports values up to ``16.0``.
  63. If :ref:`anisotropy_max<class_RDSamplerState_property_anisotropy_max>` is ``1.0``, forcibly disables anisotropy even if :ref:`use_anisotropy<class_RDSamplerState_property_use_anisotropy>` is ``true``.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_RDSamplerState_property_border_color:
  67. .. rst-class:: classref-property
  68. :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` **border_color** = ``2``
  69. .. rst-class:: classref-property-setget
  70. - void **set_border_color** **(** :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` value **)**
  71. - :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` **get_border_color** **(** **)**
  72. The border color that will be returned when sampling outside the sampler's bounds and the :ref:`repeat_u<class_RDSamplerState_property_repeat_u>`, :ref:`repeat_v<class_RDSamplerState_property_repeat_v>` or :ref:`repeat_w<class_RDSamplerState_property_repeat_w>` modes have repeating disabled.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_RDSamplerState_property_compare_op:
  76. .. rst-class:: classref-property
  77. :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` **compare_op** = ``7``
  78. .. rst-class:: classref-property-setget
  79. - void **set_compare_op** **(** :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` value **)**
  80. - :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` **get_compare_op** **(** **)**
  81. The compare operation to use. Only effective if :ref:`enable_compare<class_RDSamplerState_property_enable_compare>` is ``true``.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_RDSamplerState_property_enable_compare:
  85. .. rst-class:: classref-property
  86. :ref:`bool<class_bool>` **enable_compare** = ``false``
  87. .. rst-class:: classref-property-setget
  88. - void **set_enable_compare** **(** :ref:`bool<class_bool>` value **)**
  89. - :ref:`bool<class_bool>` **get_enable_compare** **(** **)**
  90. If ``true``, returned values will be based on the comparison operation defined in :ref:`compare_op<class_RDSamplerState_property_compare_op>`. This is a hardware-based approach and is therefore faster than performing this manually in a shader. For example, compare operations are used for shadow map rendering by comparing depth values from a shadow sampler.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_RDSamplerState_property_lod_bias:
  94. .. rst-class:: classref-property
  95. :ref:`float<class_float>` **lod_bias** = ``0.0``
  96. .. rst-class:: classref-property-setget
  97. - void **set_lod_bias** **(** :ref:`float<class_float>` value **)**
  98. - :ref:`float<class_float>` **get_lod_bias** **(** **)**
  99. The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, while negative values will make the sampler sharper at a given distance (at the risk of looking grainy). Recommended values are between ``-0.5`` and ``0.0``. Only effective if the sampler has mipmaps available.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_RDSamplerState_property_mag_filter:
  103. .. rst-class:: classref-property
  104. :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **mag_filter** = ``0``
  105. .. rst-class:: classref-property-setget
  106. - void **set_mag_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
  107. - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_mag_filter** **(** **)**
  108. The sampler's magnification filter.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_RDSamplerState_property_max_lod:
  112. .. rst-class:: classref-property
  113. :ref:`float<class_float>` **max_lod** = ``1e+20``
  114. .. rst-class:: classref-property-setget
  115. - void **set_max_lod** **(** :ref:`float<class_float>` value **)**
  116. - :ref:`float<class_float>` **get_max_lod** **(** **)**
  117. The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_RDSamplerState_property_min_filter:
  121. .. rst-class:: classref-property
  122. :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **min_filter** = ``0``
  123. .. rst-class:: classref-property-setget
  124. - void **set_min_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
  125. - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_min_filter** **(** **)**
  126. .. container:: contribute
  127. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_RDSamplerState_property_min_lod:
  131. .. rst-class:: classref-property
  132. :ref:`float<class_float>` **min_lod** = ``0.0``
  133. .. rst-class:: classref-property-setget
  134. - void **set_min_lod** **(** :ref:`float<class_float>` value **)**
  135. - :ref:`float<class_float>` **get_min_lod** **(** **)**
  136. The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_RDSamplerState_property_mip_filter:
  140. .. rst-class:: classref-property
  141. :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **mip_filter** = ``0``
  142. .. rst-class:: classref-property-setget
  143. - void **set_mip_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
  144. - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_mip_filter** **(** **)**
  145. The filtering method to use for mipmaps.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_RDSamplerState_property_repeat_u:
  149. .. rst-class:: classref-property
  150. :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_u** = ``2``
  151. .. rst-class:: classref-property-setget
  152. - void **set_repeat_u** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
  153. - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_u** **(** **)**
  154. The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_RDSamplerState_property_repeat_v:
  158. .. rst-class:: classref-property
  159. :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_v** = ``2``
  160. .. rst-class:: classref-property-setget
  161. - void **set_repeat_v** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
  162. - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_v** **(** **)**
  163. The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_RDSamplerState_property_repeat_w:
  167. .. rst-class:: classref-property
  168. :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_w** = ``2``
  169. .. rst-class:: classref-property-setget
  170. - void **set_repeat_w** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
  171. - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_w** **(** **)**
  172. The repeat mode to use along the W axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. Only effective for 3D samplers.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_RDSamplerState_property_unnormalized_uvw:
  176. .. rst-class:: classref-property
  177. :ref:`bool<class_bool>` **unnormalized_uvw** = ``false``
  178. .. rst-class:: classref-property-setget
  179. - void **set_unnormalized_uvw** **(** :ref:`bool<class_bool>` value **)**
  180. - :ref:`bool<class_bool>` **get_unnormalized_uvw** **(** **)**
  181. .. container:: contribute
  182. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_RDSamplerState_property_use_anisotropy:
  186. .. rst-class:: classref-property
  187. :ref:`bool<class_bool>` **use_anisotropy** = ``false``
  188. .. rst-class:: classref-property-setget
  189. - void **set_use_anisotropy** **(** :ref:`bool<class_bool>` value **)**
  190. - :ref:`bool<class_bool>` **get_use_anisotropy** **(** **)**
  191. If ``true``, perform anisotropic sampling. See :ref:`anisotropy_max<class_RDSamplerState_property_anisotropy_max>`.
  192. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  193. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  194. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  195. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  196. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  197. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  198. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`