Jump to content
  • Advertisement
Sign in to follow this  
Danny Gilbert

Lighting a Mesh with texture and Material.

This topic is 4235 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 use DirectX 9.0 (doing all my stuff with the Pipeline, no PS or VS). I have a mesh that represent a wall-floor-top (corridor) with some textures. I try to use a light (like flashlight) to see the scene but even if the light is ON and my mesh has normal, I don't see any light on wall. I found many exemples with light and material but nothing with a texture. I can do it by myself with material (with diffuse color) but it does not work when I add texture. Can someone send me a link or a very simple example with only a small mesh, with texture and some lights. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Your texture stage states must say to use both texture and lighting.

Assuming you just have the 1 texture stage, set these values:

Set D3DTSS_COLOROP to D3DTOP_MODULATE (multiply)
Set D3DTSS_COLORARG1 to D3DTA_TEXTURE (your texture)
Set D3DTSS_COLORARG2 to D3DTA_DIFFUSE (by lighting)

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!