[SOLVEDISH] gl_DepthRange.far not right?

Started by
-1 comments, last by cherryyosh 15 years, 4 months ago
Hi again, I have a feeling im making a lot of threads LOL, but hey im learning a lot.. + if I ask, someone else doesn't have to ( as long as they look ) :P When looking at how to get the depth for a deference render I came across oZone3D, which told me what I needed. ' float z = 1.0 - (gl_FragCoord.z / gl_FragCoord.w) / 4000.0; ' where 4000 is your far. This code works GREAT ( when I replace the 4000 for my 1000 ). But like any good programmer I want it to be portable, and done what something as simple as changing the far to mess everything up. Enter gl_DepthRange.. I figure easy fix.. yet it does NOTHING.. It actully seems to me as if its being set to 1.0 as multiplying it by 1000.0 produces the same ( at least I cant see anything diffrent ) effect as just diving it by 1000.0. I know I could just have a attribute value and pass in the data, but if I can use something that is built into GLSL, why not? Any ideas? EDIT: so its clamped to [0, 1], I just pass in a uniform ( thank god they didnt deprecate those in 1.3 -__- ) for the far.. [Edited by - cherryyosh on December 7, 2008 1:59:26 AM]

This topic is closed to new replies.

Advertisement