Archive for the ‘Programming’ Category
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.
The tutorial The Art of Texturing Using the OpenGL Shading Language has been included in OpenGL.org website in OpenGL API OpenGL Shading Language Sample Code & Tutorials section. Rather cool… ![]()

As I said in this news, the release of Catalyst 8.10 BETA comes with a nice bugfix: vertex texture fetching is now operational on Radeon (at least on my Radeon HD 4850). From 2 or 3 months, Catalyst makes it possible to fetch texture from inside a vertex shader. You can see with GPU Caps Viewer how many texture units are exposed in a vertex shader for your Radeon:

But so far, vertex texture fetching in GLSL didn’t work due to a bug in the driver. But now this is an old story, since VTF works well. For more details about vertex displacement mapping, you can read this rather old (2 years!) tutorial: Vertex Displacement Mapping using GLSL.
This very cool news makes me want to create a new benchmark based on VTF!

I’ve only tested the XP version of Catalyst 8.10. If someone has tested the Vista version, feel free to post a comment…
Next step for ATI driver team: enable geometry texture fetching: allows texture fetching inside a geometry shader…
See you soon!
I played with Depth Of Field (DoF) these last days in the upcoming Demoniak3D but I’m not very satisfied because I still have some problem to control the focus (the non blurred part of the field of view). Depth of field is done in a post processing step and uses the scene color and depth maps as only inputs (no multiple render targets). Here is a first preview:

I will continue my experimentations up to get a functional DoF and will add the support of MRT (multiple render targets) in the post processing effects (MRT will allow me to explore another cool effect: SSAO…).






