Class Sampler
Texture sampler properties for filtering and wrapping modes.
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast.Schema", "glTFast", null)]
public class Sampler : NamedObject
Constructors
Sampler()
Parameter-less constructor
Declaration
public Sampler()
Sampler(FilterMode, TextureWrapMode, TextureWrapMode)
Constructs a Sampler with filter and wrap modes.
Declaration
public Sampler(FilterMode filterMode, TextureWrapMode wrapModeU, TextureWrapMode wrapModeV)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterMode | filterMode | Unity texture filter mode |
| TextureWrapMode | wrapModeU | Unity texture wrap mode (horizontal) |
| TextureWrapMode | wrapModeV | Unity texture wrap mode (vertical) |
Properties
AdditionalProperties
Additional properties on glTF JSON objects. Those properties may have been added by a new, unsupported version of the glTF specification. For extending glTF, please use extensions or extras instead.
Declaration
[JsonIgnore]
public ReadOnlyProperties AdditionalProperties { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyProperties |
Extensions
JSON object with extension-specific objects.
Declaration
[JsonPropertyName("extensions")]
public SamplerExtensions Extensions { get; set; }
Property Value
| Type | Description |
|---|---|
| SamplerExtensions |
See Also
Extras
Application-specific data.
Declaration
[JsonPropertyName("extras")]
[JsonConverter(typeof(ExtrasConverter))]
public ExtrasContainer Extras { get; set; }
Property Value
| Type | Description |
|---|---|
| ExtrasContainer |
See Also
FilterMode
Declaration
[JsonIgnore]
public FilterMode FilterMode { get; }
Property Value
| Type | Description |
|---|---|
| FilterMode |
MagFilter
Magnification filter.
Valid values correspond to WebGL enums: 9728 (NEAREST) and 9729 (LINEAR).
Declaration
[JsonPropertyName("magFilter")]
public MagFilterMode MagFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| MagFilterMode |
MinFilter
Minification filter. All valid values correspond to WebGL enums.
Declaration
[JsonPropertyName("minFilter")]
public MinFilterMode MinFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| MinFilterMode |
WrapS
s wrapping mode. All valid values correspond to WebGL enums.
Declaration
[JsonIgnore]
public WrapMode WrapS { get; set; }
Property Value
| Type | Description |
|---|---|
| WrapMode |
WrapT
t wrapping mode. All valid values correspond to WebGL enums.
Declaration
[JsonIgnore]
public WrapMode WrapT { get; set; }
Property Value
| Type | Description |
|---|---|
| WrapMode |
WrapU
Unity texture wrap mode (horizontal), derived from glTF's WrapS value.
Declaration
[JsonIgnore]
public TextureWrapMode WrapU { get; }
Property Value
| Type | Description |
|---|---|
| TextureWrapMode |
WrapV
Unity texture wrap mode (vertical), derived from glTF's WrapT value.
Declaration
[JsonIgnore]
public TextureWrapMode WrapV { get; }
Property Value
| Type | Description |
|---|---|
| TextureWrapMode |
Methods
Apply(Texture2D, MinFilterMode, MagFilterMode)
Applies the Sampler's settings to a Unity texture.
Declaration
public void Apply(Texture2D image, MinFilterMode defaultMinFilter = MinFilterMode.Linear, MagFilterMode defaultMagFilter = MagFilterMode.Linear)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | image | Texture to apply the settings to |
| MinFilterMode | defaultMinFilter | Fallback minification filter |
| MagFilterMode | defaultMagFilter | Fallback magnification filter |