Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5252 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 have a problem. i''m a direct3d n00b and i''m exploring the tutorials in the dx9 sdk ive redone all tuts for d3d graphics and if i code a program with lights ( pointlights, spots, or directional) it works. and if i do the same with the other tut about lighing it works too, but if i combine the two tuts the light went out and the scene is rendered normally as i would only use the code from the texturing tutorial... after some hours i''m frustrated and i need your (!!) help!! a friend of mine meaned i have to use pixel shaders for this but i don''t know if he is right... (HEEEELP !!!) yours Christoph (sorry for my bad english -> i''m german)

Share this post

Link to post
Share on other sites
I dont understand the problem.. you''re just trying to get fixed-function lighting (ie, no shaders) working with textures? That definitely doesnt need a pixel shader.

The chances are that the renderstates or texture blending states are wrong, and so the lighting isnt being used. Here are some of the states that you need set to combine diffuse lighting with texturing.


To set up the lighting, make sure you are calling both SetLight and LightEnable for each light in the scene.

And some misc render states..


If your vertices have a colour component then use this..




and remember to set up a material.


Share this post

Link to post
Share on other sites
thanks for your fast reply. i''m at school now, but in the evening i''ll try it. thx a lot. i think this will work know because there are some more things then in my code!


Share this post

Link to post
Share on other sites

  • 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!