PDA

View Full Version : can't do shadow mapping correctly



Sobeit
05-06-2013, 03:21 PM
Hi all,

I've beening trying to do shadow mapping with glsl for a week, But I can't get the correct scene. I guess if it's because I didn't render the depth to texture correctly. and to clamp the coordinates of pixel into [0, 1] for texture look-up, do Ineed to multiply biasMatrix first then divide w or should I divide w then multiply biasMatrix? and can someone provide sample codes that be be built and run? Tnanks.

mobeen
05-06-2013, 06:23 PM
Have u googled for something?
The first 2 hits gave me these which show u everything u need.

http://www.fabiensanglard.net/shadowmapping/index.php
http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/

Sobeit
05-07-2013, 02:10 PM
thanks for attention. but yes, I have searched on the net for a while, either of tutorial you mentioned is using deprecated opengl api or I can't build it in VS2012.

mobeen
05-07-2013, 06:57 PM
OK here is the link to a more modern shadow mapping implementation from chapter 7 of the book OpenGL 4 shading language cookbook
https://github.com/daw42/glslcookbook/tree/master/chapter07

Sobeit
05-09-2013, 11:25 PM
Thanks, I'll try that later.