JeGX HackLAB


Archive for February, 2009

Back To Past: Cirrus Logic VLB CL-GD5428 with… 1Mb of Graphics Memory!

with 4 comments

Written by JeGX

February 18th, 2009 at 10:24 am

Posted in Hardware

Tagged with , , ,

How To Linearize the Depth Value

without comments

Here is a GLSL code snippet to convert the exponential depth to a linear value:

float f=1000.0;
float n = 0.1;
float z = (2 * n) / (f + n - texture2D( texture0, texCoord ).x * (f - n));

where:
- f = camera far plane
- n = camera near plane
- texture0 = depth map.

[source]

Written by JeGX

February 6th, 2009 at 1:20 pm

Posted in OpenGL

Tagged with , , ,