# Sandbox.Rendering.SamplerState

Represents a sampler state used to control how textures are sampled in shaders.
Example usage: 

```csharp
SamplerState mySampler < Attribute("sampler"); >;
```



C# binding:

```csharp
var sampler = new SamplerState
{
    Filter = FilterMode.Trilinear,
    AddressModeU = TextureAddressMode.Wrap,
    AddressModeV = TextureAddressMode.Wrap,
    AddressModeW = TextureAddressMode.Clamp,
    MaxAnisotropy = 4
};
            
Graphics.Attributes.Set("sampler", sampler);
```

- Kind: struct
- Namespace: `Sandbox.Rendering`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Constructors

- [`SamplerState`](/api/Sandbox.Rendering.SamplerState/.ctor)

## Properties

- [`AddressModeU`](/api/Sandbox.Rendering.SamplerState/AddressModeU): The addressing mode used for the U (X) texture coordinate.
- [`AddressModeV`](/api/Sandbox.Rendering.SamplerState/AddressModeV): The addressing mode used for the V texture coordinate.
- [`AddressModeW`](/api/Sandbox.Rendering.SamplerState/AddressModeW): The addressing mode used for the W texture coordinate.
- [`BorderColor`](/api/Sandbox.Rendering.SamplerState/BorderColor): Border color to use if [Sandbox.Rendering.TextureAddressMode.Border](/api/Sandbox.Rendering.TextureAddressMode/Border) is specified for AddressU, AddressV, or AddressW.
- [`Filter`](/api/Sandbox.Rendering.SamplerState/Filter): The texture filtering mode used for sampling (e.g., point, bilinear, trilinear).
- [`Index`](/api/Sandbox.Rendering.SamplerState/Index): Bindless index for this sampler state, for use with `Bindless::GetSampler( int nIndex )` in shaders.
- [`MaxAnisotropy`](/api/Sandbox.Rendering.SamplerState/MaxAnisotropy): The maximum anisotropy level used for anisotropic filtering. Higher values improve texture quality at oblique viewing angles.
- [`MipLodBias`](/api/Sandbox.Rendering.SamplerState/MipLodBias): The bias applied to the calculated mip level during texture sampling. Positive values make textures appear blurrier; negative values sharpen.
