aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-06-21 13:38:24 -0400
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-06-21 13:38:24 -0400
commit37c6087206c933143e9f2cd2b369532493a46740 (patch)
treed700cd6af34a16ad4976b937b994e1cdf9cddf9c /src
parent9d13d403934bcbf1e8fe0d008a65f0984f2245d7 (diff)
Use only the z component of the distance vector
The length of the vector should give us more precise fogs, but ancient OpenGL only uses the z component, so that's what we need to use here as well.
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index f3f1b5a2..757d5874 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1564,7 +1564,7 @@ var LibraryGL = {
' gl_Position = u_projection * ecPosition; \n' +
(hasTextures ? 'v_texCoord = a_texCoord0; \n' : '') +
(colorSize ? 'v_color = a_color; \n' : 'v_color = u_color; \n') +
- (GLEmulation.fogEnabled ? 'v_fogFragCoord = ffog(length(ecPosition));\n' : '') +
+ (GLEmulation.fogEnabled ? 'v_fogFragCoord = ffog(ecPosition.z);\n' : '') +
'} \n');
Module.ctx.compileShader(this.vertexShader);