Sign in to follow this  
Danny Gilbert

Lighting a Mesh with texture and Material.

Recommended Posts

Danny Gilbert    123
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this