aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/test_fshader.glsl
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-09 12:02:27 -0800
committerNivesh Rajbhandari2012-02-09 12:02:27 -0800
commita9b1a1f2642841c4165ede69d131b1deb6238622 (patch)
tree2076dc497fbde041283af8b0082b0f4e24c9e1c6 /assets/shaders/test_fshader.glsl
parent31e2eb0d0da9b032116ad073918ca36ec11dac45 (diff)
parentce81a3f4387d80f9ac406e73b843fb5dbe9cf432 (diff)
downloadninja-a9b1a1f2642841c4165ede69d131b1deb6238622.tar.gz
Merge branch 'refs/heads/ninja-internal' into SnapManagerFixes
Conflicts: js/helper-classes/RDGE/Materials/FlatMaterial.js Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'assets/shaders/test_fshader.glsl')
-rw-r--r--assets/shaders/test_fshader.glsl25
1 files changed, 12 insertions, 13 deletions
diff --git a/assets/shaders/test_fshader.glsl b/assets/shaders/test_fshader.glsl
index 3a0af39f..629d1878 100644
--- a/assets/shaders/test_fshader.glsl
+++ b/assets/shaders/test_fshader.glsl
@@ -4,7 +4,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */ 5</copyright> */
6 6
7
8#ifdef GL_ES 7#ifdef GL_ES
9precision highp float; 8precision highp float;
10#endif 9#endif
@@ -15,18 +14,18 @@ uniform vec4 u_light0Diff;
15uniform vec4 u_light0Amb; 14uniform vec4 u_light0Amb;
16 15
17// diffuse map 16// diffuse map
18uniform sampler2D colMap; 17uniform sampler2D u_colMap;
19 18
20// environment map 19// environment map
21uniform sampler2D envMap; 20uniform sampler2D envMap;
22 21
23// normal map 22// normal map
24uniform sampler2D normalMap; 23uniform sampler2D u_normalMap;
25 24
26// glow map 25// specular map
27uniform sampler2D glowMap; 26uniform sampler2D u_glowMap;
28 27
29// glow map 28// depth map
30uniform sampler2D depthMap; 29uniform sampler2D depthMap;
31 30
32//material uniforms 31//material uniforms
@@ -45,7 +44,7 @@ varying vec4 vShadowCoord;
45varying vec2 vEnvTexCoord; 44varying vec2 vEnvTexCoord;
46varying float vDiffuseIntensity; 45varying float vDiffuseIntensity;
47 46
48#ifdef PC 47#if defined( PC )
49 48
50void main() 49void main()
51{ 50{
@@ -57,14 +56,14 @@ void main()
57 56
58 vec4 colMapTexel = vec4(0); 57 vec4 colMapTexel = vec4(0);
59 if (u_renderGlow <= 0.5) { 58 if (u_renderGlow <= 0.5) {
60 colMapTexel = vec4(texture2D(colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); 59 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0);
61 } else { 60 } else {
62 colMapTexel = vec4(texture2D(glowMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); 61 colMapTexel = vec4(texture2D(u_glowMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0);
63 } 62 }
64 63
65 // normal mapping 64 // normal mapping
66 vec3 normal = normalize(vNormal.xyz); 65 vec3 normal = normalize(vNormal.xyz);
67 vec3 mapNormal = texture2D(normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0; 66 vec3 mapNormal = texture2D(u_normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0;
68 mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal); 67 mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal);
69 68
70 // create envmap coordinates 69 // create envmap coordinates
@@ -108,15 +107,15 @@ void main()
108 107
109#endif 108#endif
110 109
111#ifdef DEVICE 110#if defined( DEVICE )
112 111
113void main() 112void main()
114{ 113{
115 vec4 colMapTexel = vec4(texture2D(colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); 114 vec4 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0);
116 115
117// // normal mapping 116// // normal mapping
118 vec3 normal = normalize(vNormal.xyz); 117 vec3 normal = normalize(vNormal.xyz);
119// vec3 mapNormal = texture2D(normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0; 118// vec3 mapNormal = texture2D(u_normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0;
120// mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal); 119// mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal);
121// 120//
122// // create envmap coordinates 121// // create envmap coordinates