Class GorgonSamplerStateBuilder
A builder for a GorgonSamplerState.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonSamplerStateBuilder : GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>, IGorgonFluentBuilder<GorgonSamplerStateBuilder, GorgonSamplerState>, IGorgonGraphicsObject
Remarks
Use this builder to create a new immutable GorgonSamplerState to pass to a GorgonPipelineState. This object provides a fluent interface to help build up a sampler state.
This will define how a texture is sampled inside of a shader when rendering. Filtering, addressing, etc... are all defined in this state.
A sampler state is an immutable object, and as such can only be created by using this object.
Unlike the other state builders, this builder does not offer the optional use of a GorgonStateBuilderPoolAllocator<T>. This is because the state is cached internally and does not need an allocator pool.
Constructors
| Edit this page View SourceGorgonSamplerStateBuilder(GorgonGraphics)
Initializes a new instance of the GorgonSamplerStateBuilder class.
Declaration
public GorgonSamplerStateBuilder(GorgonGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
GorgonGraphics | graphics | The graphics interface used to build sampler states. |
See Also
Properties
| Edit this page View SourceGraphics
Property to return the graphics interface that built this object.
Declaration
public GorgonGraphics Graphics { get; }
Property Value
Type | Description |
---|---|
GorgonGraphics |
See Also
Methods
| Edit this page View SourceComparisonFunction(Comparison)
Function to set the function to compare sampled data.
Declaration
public GorgonSamplerStateBuilder ComparisonFunction(Comparison compare)
Parameters
Type | Name | Description |
---|---|---|
Comparison | compare | The function used for comparison. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceFilter(SampleFilter)
Function to set the type of filtering to apply to the texture.
Declaration
public GorgonSamplerStateBuilder Filter(SampleFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SampleFilter | filter | The filter to apply. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceMaxAnisotropy(int)
Function to set the value used to clamp an anisotropic texture filter.
Declaration
public GorgonSamplerStateBuilder MaxAnisotropy(int maxAnisotropy)
Parameters
Type | Name | Description |
---|---|---|
int | maxAnisotropy | The maximum anisotropy value. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceMipLevelOfDetail(float?, float?, float?)
Function to set the minimum/maximum mip level of detail to use.
Declaration
public GorgonSamplerStateBuilder MipLevelOfDetail(float? min = null, float? max = null, float? mipLodBias = null)
Parameters
Type | Name | Description |
---|---|---|
float? | min | [Optional] The lower end of the mip map range to clamp access to |
float? | max | [Optional] the higher end of the mip map range to clamp access to |
float? | mipLodBias | [Optional] The mip map level of detail bias value. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
Remarks
If all parameters are set to null (i.e. omitted), then the corresponding values will be reset to their defaults.
See Also
| Edit this page View SourceOnClearState()
Function to clear the working state for the builder.
Declaration
protected override GorgonSamplerStateBuilder OnClearState()
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnCreateState()
Function to update the properties of the state from the working copy to the final copy.
Declaration
protected override GorgonSamplerState OnCreateState()
Returns
Type | Description |
---|---|
GorgonSamplerState | The new render state. |
Overrides
See Also
| Edit this page View SourceOnResetTo(GorgonSamplerState)
Function to reset the builder to the specified state.
Declaration
protected override GorgonSamplerStateBuilder OnResetTo(GorgonSamplerState state)
Parameters
Type | Name | Description |
---|---|---|
GorgonSamplerState | state | The state to copy from. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceWrapping(TextureWrap?, TextureWrap?, TextureWrap?, in GorgonColor?)
Function to set the wrapping mode for a texture.
Declaration
public GorgonSamplerStateBuilder Wrapping(TextureWrap? wrapU = null, TextureWrap? wrapV = null, TextureWrap? wrapW = null, in GorgonColor? borderColor = null)
Parameters
Type | Name | Description |
---|---|---|
TextureWrap? | wrapU | [Optional] The horizontal wrapping type. |
TextureWrap? | wrapV | [Optional] The vertical wrapping type. |
TextureWrap? | wrapW | [Optional] The depth wrapping type. |
GorgonColor? | borderColor | [Optional] The color of the border when the wrapping type for any axis is set to Border. |
Returns
Type | Description |
---|---|
GorgonSamplerStateBuilder | The fluent builder interface. |
Remarks
If all parameters are set to null (i.e. omitted), then the corresponding values will be reset to their defaults.