Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/assets/shaders/GLSL/fboPreview.glsl

Diff revisions: vs.
  @@ -39,11 +39,10 @@
39 39
40 40 uniform sampler2DArray tex;
41 41 uniform int layer;
42 + uniform vec2 dvd_zPlanes;
42 43
43 44 void main()
44 45 {
45 - float fLayer = layer;
46 - vec3 tex_coord = vec3(_texCoord, fLayer);
47 - _colorOut = texture(tex, tex_coord);
48 - _colorOut.a = 0;
46 + float linearDepth = (2 * dvd_zPlanes.x) / (dvd_zPlanes.y + dvd_zPlanes.x - texture(tex, vec3(_texCoord, layer)).x * (dvd_zPlanes.y - dvd_zPlanes.x));
47 + _colorOut = vec4(linearDepth, linearDepth, linearDepth, 0.0);
49 48 }