Jump to content
  • Advertisement

Archived

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

bltiger

How to draw a static scene's shadow?

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

I have read some articles, it suggest me to use stencil buffer, but stencil buffer need hardware support, How can I draw the shadow? Can anybody give some sample code?

Share this post


Link to post
Share on other sites
Advertisement
quote:

How to draw a static scene''s shadow?



if it''s a truly static scene (nothing will ever move in it) then you should just precalculate everything using some kind of raytracing and use light maps.

Share this post


Link to post
Share on other sites
You could knife you geometry where the shadows fall, and burn the shadow colour into the approperate verts colour.

(Watch out for gourard effects though - usually solved with more sub division)

Share this post


Link to post
Share on other sites
Thanks for your help,

My scene is a truly static scene (nothing will ever move in it) ,

I do not know how can i calc the lightmap,

Can I get some sample code about lightmap?

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!