diff options
Diffstat (limited to 'src/extras/shaders/es2/normaldiffusemap.frag')
-rw-r--r-- | src/extras/shaders/es2/normaldiffusemap.frag | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/extras/shaders/es2/normaldiffusemap.frag b/src/extras/shaders/es2/normaldiffusemap.frag deleted file mode 100644 index 0bf4c5630..000000000 --- a/src/extras/shaders/es2/normaldiffusemap.frag +++ /dev/null @@ -1,34 +0,0 @@ -#define FP highp - -varying FP vec3 worldPosition; -varying FP vec3 worldNormal; -varying FP vec4 worldTangent; -varying FP vec2 texCoord; - -uniform sampler2D diffuseTexture; -uniform sampler2D normalTexture; - -// TODO: Replace with a struct -uniform FP vec4 ka; // Ambient reflectivity -uniform FP vec4 ks; // Specular reflectivity -uniform FP float shininess; // Specular shininess factor - -uniform FP vec3 eyePosition; - -#pragma include phong.inc.frag -#pragma include coordinatesystems.inc - -void main() -{ - // Sample the textures at the interpolated texCoords - FP vec4 diffuseTextureColor = texture2D( diffuseTexture, texCoord ); - FP vec3 tNormal = 2.0 * texture2D( normalTexture, texCoord ).rgb - vec3( 1.0 ); - - FP mat3 tangentMatrix = calcWorldSpaceToTangentSpaceMatrix(worldNormal, worldTangent); - FP mat3 invertTangentMatrix = transpose(tangentMatrix); - - FP vec3 wNormal = normalize(invertTangentMatrix * tNormal); - FP vec3 worldView = normalize(eyePosition - worldPosition); - - gl_FragColor = phongFunction(ka, diffuseTextureColor, ks, shininess, worldPosition, worldView, wNormal); -} |