Dirk Reiners skrev:
>       Hi Tiago,
> 
> On Sat, 2006-07-15 at 16:33 +0100, Tiago Coelho wrote:
>> Hi,
>> Does the glsl built-in uniform gl_DepthRange have the right values? in
>> which coordinate-space?
> 
> Hm, no clue. I don't have my yellow book handy to look it up right now.
> I found one comment on the web that indicated they might be clamped to
> 0..1, which could be a bug in the driver.

It might be a misunderstanding on Tiego's part:

Depth values are stored normalized in 0..1, as per the gl spec (I'm 
fairly sure glDepthRange() takes clampd values). It is those values with 
DepthRange reflects, not the one you set up with the projection matrix.

I've done some stuff with shaders and offsetting & computing depth the 
last weeks. Not that I'm an expert on it, but to write the correct value 
to gl_FragDepth from an eye-space coordinate you need to:

  - Apply perspective transform
  - Perform w division
  - Apply depth range normalization

These steps (with mathematical details) are outlined in the OpenGL specs 
and I managed to get some good results from them.

/Marcus


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to