| OLD | NEW |
| (Empty) |
| 1 // shared fragment shader should succeed. | |
| 2 precision mediump float; | |
| 3 varying vec4 v_position; | |
| 4 varying vec2 v_texCoord; | |
| 5 varying vec3 v_surfaceToLight; | |
| 6 | |
| 7 // #fogUniforms | |
| 8 | |
| 9 vec4 lit(float l ,float h, float m) { | |
| 10 return vec4(1.0, | |
| 11 max(l, 0.0), | |
| 12 (l > 0.0) ? pow(max(0.0, h), m) : 0.0, | |
| 13 1.0); | |
| 14 } | |
| 15 void main() { | |
| 16 vec4 normalSpec = vec4(0,0,0,0); // #noNormalMap | |
| 17 vec4 reflection = vec4(0,0,0,0); // #noReflection | |
| 18 vec3 surfaceToLight = normalize(v_surfaceToLight); | |
| 19 vec4 skyColor = vec4(0.5,0.5,1,1); // #noReflection | |
| 20 | |
| 21 vec3 halfVector = normalize(surfaceToLight); | |
| 22 vec4 litR = lit(1.0, 1.0, 10.0); | |
| 23 vec4 outColor = vec4(mix( | |
| 24 skyColor, | |
| 25 vec4(1,2,3,4) * (litR.y + litR.z * normalSpec.a), | |
| 26 1.0 - reflection.r).rgb, | |
| 27 1.0); | |
| 28 // #fogCode | |
| 29 gl_FragColor = outColor; | |
| 30 } | |
| 31 | |
| OLD | NEW |