scg3  0.6
texture2d_modulate.glsl
Go to the documentation of this file.
1 /**
2  * \file texture2d_modulate.glsl
3  * \brief Determine fragment color with 2D texture modulation,
4  * provides external function applyTexture() to fragment shader.
5  */
6 
7 #version 150
8 
9 uniform sampler2D texture0;
10 
11 
12 vec4 applyTexture(const in vec4 texCoord, const in vec4 emissionAmbientDiffuse,
13  const in vec4 specular) {
14  vec4 texColor = texture(texture0, texCoord.st);
15  return clamp(emissionAmbientDiffuse * texColor + specular, 0., 1.);
16 }