reconstruct position for local light (deffered)

Started by
2 comments, last by joeblack 14 years, 1 month ago
Hi , I am using deffered shading and have problem with local lights. I thing problem is in reconstructing of position in PS. I'm using camPos+ cameraRay*depth. This works fine for fullscreen lights but in case of local lights (you render light geometry on screen) it simply doesn't work. Is there any fast way to reconstruct position also in this case ? Or i need to use "old" way ? (using inverse projMat). But i have only linear depth right now... Please help me :)
Advertisement
Using inverse view projection matrix to reconstruct the position is the "default" way to do it as far as I know.

I'd recommend using mjp's method though if you're using linear depth since it's faster:
http://mynameismjp.wordpress.com/2009/03/10/reconstructing-position-from-depth/
This post shows you how to do it for light volumes.
thanks all,
now it pretends its working :)

This topic is closed to new replies.

Advertisement