Class GorgonSamplerState
Describes how texture sampling should be performed when a texture is sampled in a shader.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonSamplerState : IEquatable<GorgonSamplerState>
Remarks
This will define how a texture is sampled inside of a shader when rendering. Filtering, addressing, etc... are all defined in this state.
The sampler state contains 4 common samplers used by applications: Default (bilinear filtering), PointFiltering (point or "pixelated" filtering), AnisotropicFiltering, and Wrapping.
A sampler state is an immutable object, and as such can only be created by using a GorgonSamplerStateBuilder.
Fields
| Edit this page View SourceAnisotropicFiltering
A sampler state that provides anisotropic filtering for the complete texture.
Declaration
public static readonly GorgonSamplerState AnisotropicFiltering
Field Value
Type | Description |
---|---|
GorgonSamplerState |
See Also
| Edit this page View SourceDefault
A default sampler state.
Declaration
public static readonly GorgonSamplerState Default
Field Value
Type | Description |
---|---|
GorgonSamplerState |
See Also
| Edit this page View SourcePointFiltering
A sampler state that provides point filtering for the complete texture.
Declaration
public static readonly GorgonSamplerState PointFiltering
Field Value
Type | Description |
---|---|
GorgonSamplerState |
See Also
| Edit this page View SourcePointFilteringWrapping
A sampler state that turns on texture wrapping when texture coordinates exceed the range of the texture size.
Declaration
public static readonly GorgonSamplerState PointFilteringWrapping
Field Value
Type | Description |
---|---|
GorgonSamplerState |
See Also
| Edit this page View SourceWrapping
A sampler state that turns on texture wrapping when texture coordinates exceed the range of the texture size.
Declaration
public static readonly GorgonSamplerState Wrapping
Field Value
Type | Description |
---|---|
GorgonSamplerState |
See Also
Properties
| Edit this page View SourceBorderColor
Property to return the color to use when using border addressing.
Declaration
public GorgonColor BorderColor { get; }
Property Value
Type | Description |
---|---|
GorgonColor |
Remarks
This value defines the color to use when the WrapU, WrapV or WrapW is set to Border
. When those address modes are defined, the renderer
will draw a border in the color specified when the addressing exceeds 0.0f and 1.0f.
The default value is Transparent.
See Also
| Edit this page View SourceComparisonFunction
Property to return the function to compare sampled data.
Declaration
public Comparison ComparisonFunction { get; }
Property Value
Type | Description |
---|---|
Comparison |
Remarks
This sets how a comparison between current sampled data and existing sampled data is handled.
The default value is Never.
See Also
| Edit this page View SourceFilter
Property to return the type of filtering to apply to the texture.
Declaration
public SampleFilter Filter { get; }
Property Value
Type | Description |
---|---|
SampleFilter |
Remarks
This applies a filter when the texture is zoomed in, or out so that edges appear more smooth when magnified, and have less shimmer effect when minified. Filters can be applied to mip levels as well as the overall texture.
Click this link for a full description of each filter type.
The default value is MinMagMipLinear.
Exceptions
Type | Condition |
---|---|
GorgonException | Thrown if the state has been assigned to a sampler slot. |
See Also
| Edit this page View SourceID
Property to return the state ID.
Declaration
public int ID { get; }
Property Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceMaxAnisotropy
Property to return the value used to clamp an anisotropic texture filter.
Declaration
public int MaxAnisotropy { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This is used to clamp the Filter of the texture when it is set to an anisotropic value.
The default value is 1.
See Also
| Edit this page View SourceMaximumLevelOfDetail
Property to return the minimum mip level of detail to use.
Declaration
public float MaximumLevelOfDetail { get; }
Property Value
Type | Description |
---|---|
float |
Remarks
This defines the upper end of the mip map range to clamp access to. If this value is 0, then the largest and most detailed mip level is used, and any value higher results in less detailed mip levels.
This value should be greater than MinimumLevelOfDetail, if it is not, then Gorgon will swap these values upon state creation.
The default value is MinValue (-3.40282346638528859e+38).
See Also
| Edit this page View SourceMinimumLevelOfDetail
Property to return the minimum mip level of detail to use.
Declaration
public float MinimumLevelOfDetail { get; }
Property Value
Type | Description |
---|---|
float |
Remarks
This defines the lower end of the mip map range to clamp access to. If this value is 0, then the largest and most detailed mip level is used, and any value higher results in less detailed mip levels.
The default value is MinValue (-3.40282346638528859e+38).
See Also
| Edit this page View SourceMipLevelOfDetailBias
Property to return the offset for a calculated mip map level.
Declaration
public float MipLevelOfDetailBias { get; }
Property Value
Type | Description |
---|---|
float |
Remarks
This adds the specified value to the mip map level that was calculated by the renderer.
The default value is 0.0f.
See Also
| Edit this page View SourceWrapU
Property to return the horizontal-U direction wrapping mode for a texture.
Declaration
public TextureWrap WrapU { get; }
Property Value
Type | Description |
---|---|
TextureWrap |
Remarks
This tells the sampler how to resolve texture data outside of the 0..1.0f range.
The default value is Clamp
.
See Also
| Edit this page View SourceWrapV
Property to return the verical-V direction wrapping mode for a texture.
Declaration
public TextureWrap WrapV { get; }
Property Value
Type | Description |
---|---|
TextureWrap |
Remarks
This tells the sampler how to resolve texture data outside of the 0..1.0f range.
The default value is Clamp
.
See Also
| Edit this page View SourceWrapW
Property to return the depth-W direction wrapping mode for a texture.
Declaration
public TextureWrap WrapW { get; }
Property Value
Type | Description |
---|---|
TextureWrap |
Remarks
This tells the sampler how to resolve texture data outside of the 0..1.0f range.
The default value is Clamp
.
See Also
Methods
| Edit this page View SourceEquals(GorgonSamplerState)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonSamplerState other)
Parameters
Type | Name | Description |
---|---|---|
GorgonSamplerState | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
See Also
| Edit this page View SourceEquals(object)
Indicates whether the current object is equal to another object of the same type.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Overrides
See Also
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |