Jump to content
  • Advertisement

Archived

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

red_sodium

Software lighting on 2D sprites

This topic is 5293 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 am interested in doing my own simple dynamic lighting to light up 2D sprites (using the ID3DXSprite interface for my sprites). How would I go about directly accessing the pixels/texels of a surface of a texture through Direct3D? Also, if I did implement my own lighting, how many milliseconds do you reckon it would take? If I, for example, did a quick (dynamic) per-pixel lighting (see how far sprite is from light source and light pixel/texel accordingly) on about 20 sprites. I''m assuming this will be slow, if at all possible, so are there any shortcuts (remembering that I would like dynamic lighting)? I may also wish to bump map, but that''ll probably be even more hassle. For my lighting function, for each pixel I would check the square of the distance from a point (the light source), then +/- RGB values accordingly. Stay Clausal, Red Sodium

Share this post


Link to post
Share on other sites
Advertisement

  • 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!