Jump to content
  • Advertisement
Sign in to follow this  
duskndreamz

Texture + material problem with D3DRS_LIGHTING

This topic is 2945 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 am trying to render a scene with 2 walls of the same texture.

I am getting the following problem in rendering.

http://img801.imageshack.us/i/errorme.jpg/

I have the following settings on
 
DXUTGetD3D9Device()->SetRenderState(D3DRS_LIGHTING, TRUE);
DXUTGetD3D9Device()->LightEnable ( 0, TRUE );
DXUTGetD3D9Device()->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
DXUTGetD3D9Device()->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
DXUTGetD3D9Device()->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
DXUTGetD3D9Device()->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
DXUTGetD3D9Device()->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);



The texture is getting lit up facing a particular direction.
If i turn D3DRS_LIGHTING False. this texture problem corrects, but objects which only have material applied on them dont render their material colour.

http://img268.imageshack.us/i/error2oq.jpg/

. I am stuck at this for some tim enow, any help would be great.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
The texture is getting lit up facing a particular direction.

That's what lighting is supposed to do. You can setup various types of lights - directional, spot, etc., to light things as you like.

Did you set up a light when you created the device?
Quote:
but objects which only have material applied on them dont render their material colour.

If you're using the fixed function pipeline, and if you don't have a diffuse color component in your vertex structure, add one. When you create your wall, just set the diffuse color to 0xffffffff.

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!