Jump to content
  • Advertisement


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

Junk Detector

When Lights is OFF

This topic is 5579 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

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

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
I really dont know but just a thought. Maybe it has something to do with the ambient/diffuse/specular settings of the materials.

Share this post

Link to post
Share on other sites
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:

- bad fog parameters
- bad FVF (such as telling D3D to fetch normals as colours)

[* you can combine the two with the MATERIALSOURCE states, but that''s off topic and not supported properly on all chips]

Simon O''Connor
Creative Asylum Ltd

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!