Sampler

Manage the properties, settings, and parameters to use for a specific Texture Asset. A sampler basically creates a bridge between the local texture definition and the one maintained in GPU memory.

See Also

Static Variables


Name Description
asset Parent Asset where the Sampler is defined.
target Specifies the TextureTarget of the active Sampler.
texture_id Unique Texture id maintained by the GPU.
internal_format Specifies the internal format of the Texture uploaded on GPU.
format Specifies the format of the Texture uploaded on GPU.
type Specifies the data type of the Texmap data.

Variables


Name Description
wrap_r Specifies the WrapMode to use on the Z axis.
wrap_s Specifies the WrapMode to use on the X axis.
wrap_t Specifies the WrapMode to use on the Y axis.
filter_min The minifying Filter function to use whenever the texel being textured mapped is an area greater than one texture element.
filter_mag The magnifying Filter function to use whenever the texel being textured mapped is less than or equal to an area to one texture element.
base_level Specifies the highest level of detail to use.
max_level Specifies the lowest level of detail to use.
anisotropy Specifies the anisotropic filtering factor to use on the various mipmap levels of the Sampler.
mip_level Amount of mip maps available in the Texmap texel data.

Functions


Name Description
Update Update and apply the new Sampler settings to its parent Texture.
Reload Manually reload the Sampler.

Filter


Available filtering types that can be applied on the various mipmap level the Sampler may contain (either for minification or magnification of the texel samples).

  • kNearest: Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
  • kLinear: Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured.
  • kNearestMipmapNearest: Chooses the mipmap that most closely matches the size of the pixel being textured and uses the kNearest criterion (the texture element nearest to the center of the pixel) to produce a texture value.
  • kLinearMipmapNearest: Chooses the mipmap that most closely matches the size of the pixel being textured and uses the kLinear criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
  • kNearestMipmapLinear: Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the kNearest criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
  • kLinearMipmapLinear: Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the kLinear criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.

WrapMode


Defines the various strategies available when wrapping UVs.

  • kRepeat: Causes the integer part of the coordinate to be ignored.
  • kClampToEdge: Causes the coordinates to be clamped to the nearest Texture edge in the direction of clamping.
  • kMirroredRepeat: Causes the coordinate to be set to the fractional part of the Texture coordinate to be mirrored.




NRG - API 2022.2.380740 - Wed Jun 8 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA