123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RDSamplerState.xml.
- .. _class_RDSamplerState:
- RDSamplerState
- ==============
- **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Sampler state (used by :ref:`RenderingDevice<class_RenderingDevice>`).
- .. rst-class:: classref-introduction-group
- Description
- -----------
- This object is used by :ref:`RenderingDevice<class_RenderingDevice>`.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`anisotropy_max<class_RDSamplerState_property_anisotropy_max>` | ``1.0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` | :ref:`border_color<class_RDSamplerState_property_border_color>` | ``2`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` | :ref:`compare_op<class_RDSamplerState_property_compare_op>` | ``7`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`enable_compare<class_RDSamplerState_property_enable_compare>` | ``false`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`lod_bias<class_RDSamplerState_property_lod_bias>` | ``0.0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`mag_filter<class_RDSamplerState_property_mag_filter>` | ``0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`max_lod<class_RDSamplerState_property_max_lod>` | ``1e+20`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`min_filter<class_RDSamplerState_property_min_filter>` | ``0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`min_lod<class_RDSamplerState_property_min_lod>` | ``0.0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` | :ref:`mip_filter<class_RDSamplerState_property_mip_filter>` | ``0`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_u<class_RDSamplerState_property_repeat_u>` | ``2`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_v<class_RDSamplerState_property_repeat_v>` | ``2`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` | :ref:`repeat_w<class_RDSamplerState_property_repeat_w>` | ``2`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`unnormalized_uvw<class_RDSamplerState_property_unnormalized_uvw>` | ``false`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`use_anisotropy<class_RDSamplerState_property_use_anisotropy>` | ``false`` |
- +--------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_RDSamplerState_property_anisotropy_max:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **anisotropy_max** = ``1.0``
- .. rst-class:: classref-property-setget
- - void **set_anisotropy_max** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_anisotropy_max** **(** **)**
- 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``.
- 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``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_border_color:
- .. rst-class:: classref-property
- :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` **border_color** = ``2``
- .. rst-class:: classref-property-setget
- - void **set_border_color** **(** :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` value **)**
- - :ref:`SamplerBorderColor<enum_RenderingDevice_SamplerBorderColor>` **get_border_color** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_compare_op:
- .. rst-class:: classref-property
- :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` **compare_op** = ``7``
- .. rst-class:: classref-property-setget
- - void **set_compare_op** **(** :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` value **)**
- - :ref:`CompareOperator<enum_RenderingDevice_CompareOperator>` **get_compare_op** **(** **)**
- The compare operation to use. Only effective if :ref:`enable_compare<class_RDSamplerState_property_enable_compare>` is ``true``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_enable_compare:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **enable_compare** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_enable_compare** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_enable_compare** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_lod_bias:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **lod_bias** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_lod_bias** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_lod_bias** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_mag_filter:
- .. rst-class:: classref-property
- :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **mag_filter** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_mag_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
- - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_mag_filter** **(** **)**
- The sampler's magnification filter.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_max_lod:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **max_lod** = ``1e+20``
- .. rst-class:: classref-property-setget
- - void **set_max_lod** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_max_lod** **(** **)**
- The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_min_filter:
- .. rst-class:: classref-property
- :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **min_filter** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_min_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
- - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_min_filter** **(** **)**
- .. container:: contribute
- There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_min_lod:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **min_lod** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_min_lod** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_min_lod** **(** **)**
- The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_mip_filter:
- .. rst-class:: classref-property
- :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **mip_filter** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_mip_filter** **(** :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` value **)**
- - :ref:`SamplerFilter<enum_RenderingDevice_SamplerFilter>` **get_mip_filter** **(** **)**
- The filtering method to use for mipmaps.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_repeat_u:
- .. rst-class:: classref-property
- :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_u** = ``2``
- .. rst-class:: classref-property-setget
- - void **set_repeat_u** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
- - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_u** **(** **)**
- The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_repeat_v:
- .. rst-class:: classref-property
- :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_v** = ``2``
- .. rst-class:: classref-property-setget
- - void **set_repeat_v** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
- - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_v** **(** **)**
- The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_repeat_w:
- .. rst-class:: classref-property
- :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **repeat_w** = ``2``
- .. rst-class:: classref-property-setget
- - void **set_repeat_w** **(** :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` value **)**
- - :ref:`SamplerRepeatMode<enum_RenderingDevice_SamplerRepeatMode>` **get_repeat_w** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_unnormalized_uvw:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **unnormalized_uvw** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_unnormalized_uvw** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_unnormalized_uvw** **(** **)**
- .. container:: contribute
- There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDSamplerState_property_use_anisotropy:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **use_anisotropy** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_use_anisotropy** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_use_anisotropy** **(** **)**
- If ``true``, perform anisotropic sampling. See :ref:`anisotropy_max<class_RDSamplerState_property_anisotropy_max>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|