diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-06-21 13:40:47 -0400 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-06-21 13:40:47 -0400 |
commit | 3d8cea93d0b23b5ecafd155dcf403e4d11488650 (patch) | |
tree | 9a8017d5ec5b67dd2acc8e576c360f4858a38b3d /src/library_gl.js | |
parent | 37c6087206c933143e9f2cd2b369532493a46740 (diff) |
Compute the color involving the shader first and then apply the fog
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 757d5874..cbec1bc5 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1579,9 +1579,9 @@ var LibraryGL = { ) : '') + 'void main() \n' + '{ \n' + - (GLEmulation.fogEnabled ? 'vec4 color = vec4(mix(vec3(u_fogColor), vec3(v_color), v_fogFragCoord), 1.0); \n' : '') + - (hasTextures ? 'gl_FragColor = color * texture2D( u_texture, v_texCoord );\n' : - 'gl_FragColor = color;\n') + + (hasTextures ? 'gl_FragColor = v_color * texture2D( u_texture, v_texCoord );\n' : + 'gl_FragColor = v_color;\n') + + (GLEmulation.fogEnabled ? 'gl_FragColor = vec4(mix(vec3(u_fogColor), vec3(gl_FragColor), v_fogFragCoord), gl_FragColor.a); \n' : '') + '} \n'); Module.ctx.compileShader(this.fragmentShader); |