SamplerObject

SamplerObject

Creates a sampler object to be used on a texture whehn reading in a shader

Constructor

new SamplerObject(settings)

Parameters:
Name Type Description
settings Object

Sampler settings

Properties
Name Type Attributes Default Description
wrapS string <optional>
'Repeat'

possible values:


  • 'Repeat' = Repeat texture (ignore integer part of texture coords)
  • 'MirroredRepeat' = Repeat with reversed direction on odd integer part of texture coords
  • 'EdgeClamp' = Clamp texture coord range to 0..1 and use edge color

wrapT string <optional>
'Repeat'

possible values:


  • 'Repeat' = Repeat texture (ignore integer part of texture coords)
  • 'MirroredRepeat' = Repeat with reversed direction on odd integer part of texture coords
  • 'EdgeClamp' = Clamp texture coord range to 0..1 and use edge color

wrapR string <optional>
'Repeat'

possible values:


  • 'Repeat' = Repeat texture (ignore integer part of texture coords)
  • 'MirroredRepeat' = Repeat with reversed direction on odd integer part of texture coords
  • 'EdgeClamp' = Clamp texture coord range to 0..1 and use edge color

magFilter string <optional>
'Bilinear'

possible values:


  • 'NearestNeighbor' =
  • 'Bilinear' =

minFilter string <optional>
'TriLinear'

possible values:


  • 'NearestNeighborNoMipMaps' =
  • 'NearestNeighborNearestMipMap' =
  • 'NearestNeighborLinearMipMap' =
  • 'BilinearNoMipMaps' =
  • 'BilinearNearestMipMap' =
  • 'Trilinear' =

compareFunc string <optional>
'LEqual'

possible values:


  • 'LEqual' =
  • 'GEqual' =
  • 'Less' =
  • 'Greater' =
  • 'Equal' =
  • 'NotEqual' =
  • 'Always' =
  • 'Never' =

compareMode string <optional>
'None'

possible values:


  • 'None' =
  • 'CompareRefToTexture' =

maxLod number <optional>
'1000'
minLod number <optional>
'-1000'

Methods

clone() → {SamplerObject}

Returns a clone of this sampler object

compareTo() → {boolean}

Compares two sampler objects and verifies if they are equal

destroy(context)

Releases the allocated sampler

Parameters:
Name Type Description
context WebGLRenderingContext

initialize()

Sets up the sampler given a context with the correct params
based on the settings