aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/test_fshader.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'assets/shaders/test_fshader.glsl')
-rwxr-xr-xassets/shaders/test_fshader.glsl18
1 files changed, 9 insertions, 9 deletions
diff --git a/assets/shaders/test_fshader.glsl b/assets/shaders/test_fshader.glsl
index d2b3bd40..1fa78e44 100755
--- a/assets/shaders/test_fshader.glsl
+++ b/assets/shaders/test_fshader.glsl
@@ -40,7 +40,7 @@ uniform vec4 u_light0Amb;
40// diffuse map 40// diffuse map
41uniform sampler2D u_colMap; 41uniform sampler2D u_colMap;
42 42
43// environment map 43// environment map
44uniform sampler2D envMap; 44uniform sampler2D envMap;
45 45
46// normal map 46// normal map
@@ -72,12 +72,12 @@ varying float vDiffuseIntensity;
72 72
73void main() 73void main()
74{ 74{
75 vec4 rgba_depth = texture2D(depthMap, vShadowCoord.xy/vShadowCoord.w, -32.0); 75 vec4 rgba_depth = texture2D(depthMap, vShadowCoord.xy/vShadowCoord.w, -32.0);
76 const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0); 76 const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
77 float dist = vShadowCoord.w/200.0; 77 float dist = vShadowCoord.w/200.0;
78 float d = dot(rgba_depth, bit_shift); 78 float d = dot(rgba_depth, bit_shift);
79 float shadowCoef = (dist > d + 0.00779) ? (0.6) : (1.0); 79 float shadowCoef = (dist > d + 0.00779) ? (0.6) : (1.0);
80 80
81 vec4 colMapTexel = vec4(0); 81 vec4 colMapTexel = vec4(0);
82 if (u_renderGlow <= 0.5) { 82 if (u_renderGlow <= 0.5) {
83 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); 83 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0);
@@ -120,7 +120,7 @@ void main()
120 vec4 diffuse = u_matDiffuse * (colMapTexel + envMapTexel)*shadowCoef; 120 vec4 diffuse = u_matDiffuse * (colMapTexel + envMapTexel)*shadowCoef;
121 121
122 if (u_renderGlow <= 0.5) { 122 if (u_renderGlow <= 0.5) {
123 diffuse *= u_light0Diff; 123 diffuse *= u_light0Diff;
124 } 124 }
125 125
126 vec4 specular = 2.0 * pf * envMapTexel; 126 vec4 specular = 2.0 * pf * envMapTexel;
@@ -138,7 +138,7 @@ void main()
138 vec4 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0); 138 vec4 colMapTexel = vec4(texture2D(u_colMap, vec2(vNormal.w, vECPos.w)).rgb, 1.0);
139 139
140// // normal mapping 140// // normal mapping
141 vec3 normal = normalize(vNormal.xyz); 141 vec3 normal = normalize(vNormal.xyz);
142// vec3 mapNormal = texture2D(u_normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0; 142// vec3 mapNormal = texture2D(u_normalMap, vec2(vNormal.w, vECPos.w)).xyz * 2.0 - 1.0;
143// mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal); 143// mapNormal = normalize(mapNormal.x*vec3(normal.z, 0.0, -normal.x) + vec3(0.0, mapNormal.y, 0.0) + mapNormal.z*normal);
144// 144//