function processTexture(
  shaderBuilder,
  uniformMap,
  textureReader,
  uniformName,
  defineName,
  defaultTexture,
) {
  // Add a uniform for the texture itself
  shaderBuilder.addUniform(
    "sampler2D",
    uniformName,
    ShaderDestination.FRAGMENT,
  );
  uniformMap[uniformName] = function () {
    return textureReader.texture ?? defaultTexture;
  };

  // Add a #define directive to enable using the texture in the shader
  const textureDefine = `HAS_${defineName}_TEXTURE`;
  shaderBuilder.addDefine(textureDefine, undefined, ShaderDestination.FRAGMENT);

  // Add a #define to tell the shader which texture coordinates varying to use.
  const texCoordIndex = textureReader.texCoord;
  const texCoordVarying = `v_texCoord_${texCoordIndex}`;
  const texCoordDefine = `TEXCOORD_${defineName}`;
  shaderBuilder.addDefine(
    texCoordDefine,
    texCoordVarying,
    ShaderDestination.FRAGMENT,
  );

  // Some textures have matrix transforms (e.g. for texture atlases). Add those
  // to the shader if present.
  const textureTransform = textureReader.transform;
  if (
    defined(textureTransform) &&
    !Matrix3.equals(textureTransform, Matrix3.IDENTITY)
  ) {
    processTextureTransform(
      shaderBuilder,
      uniformMap,
      textureReader,
      uniformName,
      defineName,
    );
  }

  const { scale } = textureReader;
  if (defined(scale) && scale !== 1.0) {
    processTextureScale(
      shaderBuilder,
      uniformMap,
      textureReader,
      uniformName,
      defineName,
    );
  }
}
Process a single texture and add it to the shader and uniform map.

@param {ShaderBuilder} shaderBuilder The shader builder to modify
@param {Object<string, Function>} uniformMap The uniform map to modify.
@param {ModelComponents.TextureReader} textureReader The texture to add to the shader
@param {string} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>
@param {string} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, "BASE_COLOR" or "EMISSIVE"

@private