Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Roquqkie

Steps to draw shadows using shadow mapping

This topic is 5988 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 I would be happy if anyone could explain what steps are needed to draw shadows using the technique described at: http://developer.nvidia.com/view.asp?IO=Shadow_Map I´ve been looking at the sourcecode for some time now, but I find it very confusing that the application is so flexible. I can manage to create a texture from the depth-buffer seen from the light´s point of view, but what should I do next!? -Roq-

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
here''s a little bump - cause im interested too

Share this post


Link to post
Share on other sites
theres a lot of info at the nvidia site

in laymans terms
u have 2 viewpoints
1/ from the camera
2/ from the light

read back the depth info from each viewpoint
for each ''pixel'' from the cameras viewpoint u can find the corresponding ''pixel'' in the lights viewpoint
doing a comparrision u can see if a point can be seen or not (in shadow)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Download the presentation, or the PDF article, it explains it in there... You can''t really learn everything just by looking at the source ( Well, I can''t ).

Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites
To Python_Regious: Thanx! You´ve been a great help (again)
To Zedzeek: Ok, now I have the depth-buffer data from the light´s point of view and the camera´s point of view.

If I understand you correctly, should I then goto every pixel in the two texturemaps and test each pixel with the corresponding pixel in the other texturemap. If then, e.g. pixel (200, 55) has the same RGB values as pixel (200, 55) in the other texturemap, what do I know then?

Well... I´ll look for the .pdf now

Btw. Zedzeek...Nice screenshots! It´s excactly the kind of shadows I´ll create, you have!

Best regards
-Roq-

[edited by - Roquqkie on May 31, 2002 4:50:35 AM]

Share this post


Link to post
Share on other sites
I''ve looked at the screen shots on your website, zed, and I was just wondering if you used this method to create the fantastic shadowing effects you have on Gotterdammerung? I too have been wondering about how to implement shadows...


Movie Quote of the Week:

I love the smell of napalm in the morning...
- Capt. Kilgore, Apocalypse Now.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

Share this post


Link to post
Share on other sites
quote:

If I understand you correctly, should I then goto every pixel in the two texturemaps and test each pixel with the corresponding pixel in the other texturemap. If then, e.g. pixel (200, 55) has the same RGB values as pixel (200, 55) in the other texturemap, what do I know then?


Of course not, that would be incredibly slow.

This is what you do: as mentioned, you readback the depth buffer from the point of view of the lightsource. Now, while rendering your normal scene, you project the depthbuffer onto your geometry, using an additional texture unit. The texcoords (s,t,r) should match the (x,y,z) position of every vertex in lightspace. That''s called projective texture mapping, it sounds a bit complicated but is really easy, have a look at some nVidia presentations, it''s well explained.

Finally, you use a compare operation that compares the projected light depth (the r texcoord) and the corresponding depth value in the light''s depth buffer. Think of it as a z-test in lightspace, what the light can ''see'' is lit, what it can not see is in shadow. This compare is best done via the SGIX_shadow (or ARB_shadow) extensions. It can also be simulated by register combiners, so you can have full shadowmapping on GF2, but the quality is lower.

But all this is very well covered in the nVidia presentation python_regious mentioned.

/ Yann

Share this post


Link to post
Share on other sites
>>I''ve looked at the screen shots on your website, zed, and I was just wondering if you used this method to create the fantastic shadowing effects you have on Gotterdammerung?<<

no im using ''projected textures'' (btw theres uite a bit of discussion over at www.open.org as to wether doom3 is also using this method)

http://uk.geocities.com/mentalmantle btw ive also got a page at uk.geociteis but cant upload anyhing, i thought this was due to it now being a ''pay service''. can u upload stuff to your site?

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Not sure, zed, as I haven''t updated in a while. I''ll try and upload something and get back to you. By the way, I''ll look for some articles on projected textures on my travels around the internet, and that discussion on Doom III at OpenGL.org.

btw, the website''s a little crappy at the moment. Well, no, actually, that''s an understatement. I was going to add quite a few articles on what I was doing in my experiments, demos and 3D engine, but it never really materialised. I just kept programming more, newer stuff... :-)

I''m hoping to post my map maker soon (in VB and OpenGL) soon though...


Movie Quote of the Week:

I love the smell of napalm in the morning...
- Capt. Kilgore, Apocalypse Now.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

Share this post


Link to post
Share on other sites

  • 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!