Jump to content
  • Advertisement
Sign in to follow this  
yo1dog

DirectX 2D Lighting

This topic is 3315 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

Is it possible to have lighting in 2D? I assume so but is it possible to light simple lines? I have a buffer or lines drawn with:
d3ddev->DrawPrimitive(D3DPT_LINELIST, 0, nl/2)
Is it possible to apply lighting to this? If so if someone could point me in the right direction to a beginner's tutorial/explanation I would be very thankful. Thanks for your time, - Mike

Share this post


Link to post
Share on other sites
Advertisement
If you are using the fixed function pipeline, then your vertices will need to have normals, but I don't know if that will work for lines or not. If not, then I think you need to write a shader to do it. This won't be any different from writing a shader for lighting triangles, and there are plenty of tutorials available on that topic.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!