Table of Contents

Class RDSamplerState

Sampler state (used by RenderingDevice).

Inheritance
RDSamplerState

Remarks

This object is used by RenderingDevice.

Properties

anisotropy_max

Maximum anisotropy that can be used when sampling. Only effective if 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 anisotropy_max is 1.0, forcibly disables anisotropy even if use_anisotropy is true.

var anisotropy_max : float = 1.0

Property Value

float

Remarks

  • void set_anisotropy_max(float value)
  • float get_anisotropy_max

border_color

The border color that will be returned when sampling outside the sampler's bounds and the repeat_u, repeat_v or repeat_w modes have repeating disabled.

var border_color : int = 2

Property Value

int

Remarks

  • void set_border_color(int value)
  • int get_border_color

compare_op

The compare operation to use. Only effective if enable_compare is true.

var compare_op : int = 7

Property Value

int

Remarks

  • void set_compare_op(int value)
  • int get_compare_op

enable_compare

If true, returned values will be based on the comparison operation defined in 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.

var enable_compare : bool = false

Property Value

bool

Remarks

  • void set_enable_compare(bool value)
  • bool get_enable_compare

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.

var lod_bias : float = 0.0

Property Value

float

Remarks

  • void set_lod_bias(float value)
  • float get_lod_bias

mag_filter

The sampler's magnification filter. It is the filtering method used when sampling texels that appear bigger than on-screen pixels.

var mag_filter : int = 0

Property Value

int

Remarks

  • void set_mag_filter(int value)
  • int get_mag_filter

max_lod

The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available.

var max_lod : float = 1e+20

Property Value

float

Remarks

min_filter

The sampler's minification filter. It is the filtering method used when sampling texels that appear smaller than on-screen pixels.

var min_filter : int = 0

Property Value

int

Remarks

  • void set_min_filter(int value)
  • int get_min_filter

min_lod

The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available.

var min_lod : float = 0.0

Property Value

float

Remarks

mip_filter

The filtering method to use for mipmaps.

var mip_filter : int = 0

Property Value

int

Remarks

  • void set_mip_filter(int value)
  • int get_mip_filter

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.

var repeat_u : int = 2

Property Value

int

Remarks

  • void set_repeat_u(int value)
  • int get_repeat_u

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.

var repeat_v : int = 2

Property Value

int

Remarks

  • void set_repeat_v(int value)
  • int get_repeat_v

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.

var repeat_w : int = 2

Property Value

int

Remarks

  • void set_repeat_w(int value)
  • int get_repeat_w

unnormalized_uvw

If true, the texture will be sampled with coordinates ranging from 0 to the texture's resolution. Otherwise, the coordinates will be normalized and range from 0 to 1.

var unnormalized_uvw : bool = false

Property Value

bool

Remarks

  • void set_unnormalized_uvw(bool value)
  • bool get_unnormalized_uvw

use_anisotropy

If true, perform anisotropic sampling. See anisotropy_max.

var use_anisotropy : bool = false

Property Value

bool

Remarks

  • void set_use_anisotropy(bool value)
  • bool get_use_anisotropy