Jump to content
  • Advertisement
Sign in to follow this  

[SOLVEDISH] gl_DepthRange.far not right?

This topic is 3655 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!