Archived

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

Slaughter

Help with DirectX lighting system

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

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!

Magnus

Share this post


Link to post
Share on other sites