getTexture method

  1. @override
dynamic getTexture(
  1. dynamic textureProperty,
  2. dynamic uvSnippet, [
  3. dynamic biasSnippet,
  4. dynamic shaderStage,
])
override

Implementation

@override
getTexture(textureProperty, uvSnippet, [biasSnippet, shaderStage]) {
  shaderStage ??= this.shaderStage;

  if (shaderStage == 'fragment') {
    return """textureSample( ${textureProperty}, ${textureProperty}_sampler, ${uvSnippet} )""";
  } else {
    this._include('repeatWrapping');

    var dimension = """textureDimensions( ${textureProperty}, 0 )""";

    return """textureLoad( ${textureProperty}, repeatWrapping( ${uvSnippet}, ${dimension} ), 0 )""";
  }
}