Jump to content
  • Advertisement
Sign in to follow this  
Dancin_Fool

Jagged Spot Light

This topic is 4918 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'm working on a top down deathmatch style of game using DirectX. (Basically redoing Halo as a top down multiplayer game, right now planned to have blood gulch and a few weapons) My problem is I have my character centered in the screen and I only want them to be able to see a certain distance in front of them. Right now I have a spot light set up that is projected from the center of the character. It works fairly well, the only problem is that it creates really jagged lines based on the complexity of the geometry it hits. I was wondering if there was anyway to smooth this jagged line out, or if anyone has a better idea for this. I was thinking about applying a big texture to the screen with the cone set up in the alpha channel and just rotate that around, but we plan on having grenades which can light up circular portions of the screen where they go off, so I'm not sure if I would somehow have to draw circles on to that big texture where the grenade went off.

Share this post


Link to post
Share on other sites
Advertisement
I would seem your problem is because of the vertex count in the levels. Your options are to look into per-pixel lighting, or to use a higher vertex count. DirectX can do the later for you with the PatchMesh class.

Share this post


Link to post
Share on other sites
Yeah the problem is with the vertex count of the level, the only problem with upping the number of vertices in the level is a big hit to the speed, I'm currently implementing a quadtree so hopefully that speeds up performance a fair bit.

Share this post


Link to post
Share on other sites
If you want to have limited viewing one easy way of doing it simply creating a cylinder around your player, which will cause nothing outside of it beeing rendered... this won't create any nice smooth edges, but razor sharp.

EDIT: One other way of doing is the method I discussed in another thread, which allows you to draw two worlds, one where everything happens, and one where only certain things happens (no players, only world etc)... this is very simpel to accomplish but can however be a little messy if you want a very fast implementation as you should generally exclude the cylinder from the outer map when drawing to save time... but a straight on implementation is very easily done.

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.

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!