Jump to content
  • Advertisement


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


Lighting ala Diablo, 2d lighting w/o 3d do i have it right?

This topic is 5956 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 was curious about how to do 2d lighting around say your main character like in diablo 2. I have seen and searched the forum for other posts, but i guess nothing answers my question. I think I know how to do lighting but just want to say how I think its done here so people can correct me if I am wrong, here it goes... I have my alpha blending working, I can draw any sprite i want alpha blended 50/50 or alpha blended 0-255 (This came from the "For begginners: MMX alpha blending") So I was curious, if I wanted to lighthing do I make a radial gradient of say white and my color key (black) and then just draw that alphablended to make it look light its lighting up the floor around my character? Or am I missing something, I havely suspect it does have to do with alpha blending. Any help would be great, and yes I know questions about 2d lighting was posted 1million times before, I am just asking for a quick clarification/answer if I am wrong. Thanks again. _Shane

Share this post

Link to post
Share on other sites
Well technically, natural lighting would be more likely to make things "less black" than "more white" if you see what I mean. You probably want it so things near the light source are approximately their ''normal'' colour (assuming a white light), fading to black the further from the light they are.

I''m not sure why you mention the colour key though, either... I would have thought the gradient in question would affect the amount of blending, not the colour to be blended. I''m no expert though.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files ]

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!