Jump to content
  • Advertisement
Sign in to follow this  
xsirxx

Deferred Lighting, How do I pass the world coords of the objects?

This topic is 4846 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 have another thread about this, *SORTA*. Not getting a response I think do to its another question. So that said, On deferred lighting/shading, How do I pass the world coords from the objects in the pre shading to the post shading? I tried putting them in a texture but that seems to clamp them to 0 through 1. So Since I cannot get that to work, what are some other ways to do it? I see examples where ppl take SOMEHOW the coords of the screen aligned quad and then take the invViewProj matrix to put it back into world coords. I tried this put it definitly didnt work, and I cant seem to understand how they do get it to work.. unless for their examples are just to see the representation of what a light does. The final question is, What are some ways in deferred lighting/shading to pass the world coords from the Pre-Pass to the Post-Pass? Thanks much everyone, Brad

Share this post


Link to post
Share on other sites
Advertisement
IIRC, if you use 32bit-textures, you could either store the depth into a D3DFMT_R32F texture and calculate the position from it in the pixel shader or you could use two D3DFMT_G16R16F textures to store x/y and z/w separately, each component as a half. At least that's what I've written, I have never done deferred shading.

Regards,
Andre

Share this post


Link to post
Share on other sites
Quote:
Original post by VizOne
IIRC, if you use 32bit-textures, you could either store the depth into a D3DFMT_R32F texture and calculate the position from it in the pixel shader or you could use two D3DFMT_G16R16F textures to store x/y and z/w separately, each component as a half. At least that's what I've written, I have never done deferred shading.

Regards,
Andre


I did that, but my screen kept coming up with all black and weird gliches everywhere. Something wrong with using floats in the targets. I used 2 D3DFMT_G16R16F targets. My depth is set to 16 because I cant get it to 32 so I imagine that is the problem.

I have 2 geforce 6000gts in SLI mode. I thought it could do 32bit depth?

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!