Jump to content
  • Advertisement
Sign in to follow this  
cippyboy

GL_ARB_depth_texture

This topic is 4947 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

I wanted to use this extension to make shadows, got really confused, and I`m trying to sort it out, but... for now I don`t know why I`m getting a very white depth texture, and I thought of scaling this ussing glPollygonOffset() but It`s completly useless(I wasn`t able to figure out any good values). The thing is that if I have 2 boxes in front of me at about 10-20 meters each, the depth texture will probably see the begining of the first one, and everything else is completely white(probably because precision ?) although 16-24-32 bit still works the same. Oh and... is there no other way to project the shadow texture without using the glTexGen ? eventually through some vertex/fragment programs ?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by cippyboy
I wanted to use this extension to make shadows, got really confused, and I`m trying to sort it out, but... for now I don`t know why I`m getting a very white depth texture, and I thought of scaling this ussing glPollygonOffset() but It`s completly useless(I wasn`t able to figure out any good values). The thing is that if I have 2 boxes in front of me at about 10-20 meters each, the depth texture will probably see the begining of the first one, and everything else is completely white(probably because precision ?) although 16-24-32 bit still works the same.


a couple of screen shots highlighting the problem + setup code would be handy...

Quote:

Oh and... is there no other way to project the shadow texture without using the glTexGen ? eventually through some vertex/fragment programs ?


yep, you can do it via vertex and fragment program/shaders, but keep in mind then you have todo ALL the work (generation of texture coords etc), however that isnt that hard.

Share this post


Link to post
Share on other sites
hi, you have the exact same "problem" i had, i quoted problem because its not a problem :-) its simply that the Z Buffer isnt linearly stored, so stuff really close to the ZNear plane maps to a visible grayscale range, while stuff way down the back (near ZFar) are depth values like 0.988f (ie, really close to white!)

this should be fine for shadowmapping, because you're just comparing the Z values (lookup table of sorts), not really using them for visualisation on screen.

here's my thread, should answer a few more questions [opens in new window]

Share this post


Link to post
Share on other sites
Aha, I thought to myself that outta do it but... I`ve put 1.0f for zNear and just 10 for zFar, guess what ? almost nothing changed. To see what i`m talking about see again those 2 pictures, theyre slightly modifyed, the gray color is my clearvalue to see that the zFar is 10 and no more(making the world really crappy)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!