Jump to content
  • Advertisement


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


Help with DirectX lighting system

This topic is 6293 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 people, I''ve been studying the new DirectX 8.0 API but I didn''t find out how to do dynamic lighting on textured polygons using the API''s lighting system. I can get dynamic lights working on a polygon with custom vertexes that don''t have uv cordinates for textures nor color, but if I add the uv cordinates and apply a texture to the polygon, the lighting don''t seem to work anymore. Does anyone knows what I''m doing wrong? Thanks in advance for any help and forgive my english.

Share this post

Link to post
Share on other sites

I haven''t got any dx8 code here, so the function calls etc might be wrong, but I''m guessing that your problem is that you''ve set the TSS_COLOR thingie to D3DTSS_TEXTURE, and are using a SELECT_ARG1 or something, which means that only the texture''s own color is used in the final color calculation.

What you need to do is use the MODULATE (ie blending) of D3DTSS_TEXTURE and D3DTSS_DIFFUSE, which will give you shaded texture mapping..

Hope this helps!


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.

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!