Jump to content
  • Advertisement

Archived

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

Codejoy

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

This topic is 6037 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
Advertisement
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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!