When Lights is OFF
When I turn lighting off, I notice strange color effects which changing whenever I change position of camera.
When I turn it on, everything works well. So I may be missing some required calls, but still couldn''t find the right way to disable the lighting. In some cases it is necessary.
I use
d3d->SetRenderState( D3DRS_LIGHTING, FALSE );
do I need to change some more settings to turn it off ?
Thanks
I really dont know but just a thought. Maybe it has something to do with the ambient/diffuse/specular settings of the materials.
What are your TextureStageStates set to ?
They control where colours are fetched from and passed on for rasterising the triangles...
...for your realtime lit polygons your TSS is probably set up to do a CURRENT MODULATE TEXTURE or DIFFUSE MODULATE TEXTURE (in stage0 those both mean the same thing)...
...when you turn the lighting off, if you haven''t changed your TSS settings then you''re still telling D3D that one colour input will come from per vertex colour OR realtime lighting* - if neither are present/defined, the result is umm...UNDEFINED. Undefined means random colours for some people, black polygons for others, maybe a full crash for others etc!
Other possibilities:
- SPECULARENABLE
- bad fog parameters
- bad FVF (such as telling D3D to fetch normals as colours)
[*]<br><br>–<br>Simon O''Connor<br>Creative Asylum Ltd<br><A HREF="http://www.creative-asylum.com">www.creative-asylum.com</A>
They control where colours are fetched from and passed on for rasterising the triangles...
...for your realtime lit polygons your TSS is probably set up to do a CURRENT MODULATE TEXTURE or DIFFUSE MODULATE TEXTURE (in stage0 those both mean the same thing)...
...when you turn the lighting off, if you haven''t changed your TSS settings then you''re still telling D3D that one colour input will come from per vertex colour OR realtime lighting* - if neither are present/defined, the result is umm...UNDEFINED. Undefined means random colours for some people, black polygons for others, maybe a full crash for others etc!
Other possibilities:
- SPECULARENABLE
- bad fog parameters
- bad FVF (such as telling D3D to fetch normals as colours)
[*]<br><br>–<br>Simon O''Connor<br>Creative Asylum Ltd<br><A HREF="http://www.creative-asylum.com">www.creative-asylum.com</A>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement