Jump to content
  • Advertisement
Sign in to follow this  
n0ob

Warning! Noob wants to do shadows in DX9!!

This topic is 4885 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

Yeah, I'm an uber noob with D3D, so I'm wondering what the easiest way to put shadows into my little game would be. I could just.. uh.. put little shadow circles under all my objects, but I was hoping to get shadow mapping or something in so I could have semi-real shadows. Now, I was looking at the example included with the DX9 SDK, but *h0rk* they're doing some crazy stuff in there that I have not learned.. I think I have an idea what the basic process is (har). First they render the scene from the light's (let's assume I have 1 eep) viewpoint and store the Z values. Then when the scene is rendered from the camera, the shadow map is projected onto the scene, and stuff is tested so that things that weren't rendered to the shadow map are not illuminated... Blart.. So anyway, I was wondering if there was an EASY way to doing this besides using .fx files and having all these crazy vertex declarations.. ShadowVolume looks even harder... If there is no easier way, I shall.. attempt to learn this the hard way lol. Thanks for any help and tips!

Share this post


Link to post
Share on other sites
Advertisement
If I were you, I'd just "cheat" and put little shadow circles under the feet or whatever...

Shadows are pretty tricky to get working right, imo... I'm still trying to get them working in my own game lol

If you really want to have "real" shadows though, then I'd prolly go with shadow volumes instead of shadow mapping, since you said you don't want to mess around with .fx files. Afaik, shadow mapping pretty much requires shaders to work. However, you can do shadow volumes w/o shaders, check the D3D SDK sample for some code on how to do this. (The one w/ a biplane flying around over a terrain)

Good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by MikeyO
Just out of curiosity, why wouldn't you want to use shaders?


They're a bit much for someone who admits they're an "uber noob". Easing into things at a comfortable rate is not a bad idea.

For what it's worth, World of Warcraft uses little shadow circles. ;)

Share this post


Link to post
Share on other sites
Well, easing into things at a comfortable rate isn't a bad idea at all, but I consider shadow volumes to be more difficult than shadow mapping to get working correctly these days.

Basically, all you have to do is learn the code/API side of things n0ob, as you have the algorithm for shadow maps pretty much spot on. Even if you do use shaders you can often get away with very simple ones so it's not that bad once you've learned the basics.

-Mezz

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!