Jump to content
  • Advertisement
Sign in to follow this  
slyprid

[.net] Lighting on Sprite class

This topic is 4834 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 wondering if it is possible to use the lighting routines like you would for 3D applications but on a sprite. I've created a lighting effect using alpha blending but I think it would be a bit nicer to have use of the lighting routines. Reason why is using the alpha blending leaves a decent light radius effect, but it is blocky and would like to create a smooth circular light around the character. Here is a pic of what I have right now using alpha blending. I've tried using the lighting routines before, but can't seem to get them to show up. Can't figure if i'm just positioning the lights wrong, or what. http://www.forgottenstar.com/EE/3d-ss8.jpg Thanks Slyprid

Share this post


Link to post
Share on other sites
Advertisement
Absolutly, though you need to be using D3D rather than DirectDraw to use the D3d light concepts.

Craig did it in his engine here.
http://dotnet.org.za/craig/archive/2004/11/29/8265.aspx

Alternativly you can use a mask with rounded edges and continue your tranparancy rather than covers the whole square.

Share this post


Link to post
Share on other sites
Well I got the lighting to work with creating my own primitives and tiles, but was still wondering if its possible to add lighting to d3dx.sprite class. The main reason was since my program already uses the class already, and don't want to go back through and write a new class for it all, but if I have to I will. Even though using masking and alpha blending will do the trick, I figured since the lighting routines were already there I should be able to use them. Sorry keep asking about this, but i'm still new to the whole 3D aspect of programming and trying to learn. I did find out that you have to assign a material to an object in order for it to have lighting on it, so is there a way to assign a material to a sprite class? Once again, thanks for your time.

slyprid

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!