Skip to main content
gamedev.net
🔒 Locked

Lighting problem..

Started by FogGobbler 3 replies 300+ views
Original Post
FogGobbler
FogGobbler
Hi! I´ve got a problem with Jim´s lighting system. I can´t get any kind of light to work, only the ambient light.
  
  // in BOOL cApp::Init()

  m_Graphics.EnableLighting(TRUE);
  m_Spot.SetRange(1000.0f);
  m_Spot.SetType(D3DLIGHT_POINT);
  m_Spot.SetDiffuseColor(50,230,90);
  m_Spot.SetAttenuation0(1.0f);
  m_Spot.SetAmbientColor(55,50,0);
  m_Spot.Move(-631.281f, 10.0f, -330.671f);
  m_Graphics.SetLight(0,&m_Spot);
  m_Graphics.EnableLight(0,TRUE);
  
I´ve loaded a x-file and checked the normals in my 3d-program. They are all pointing outwards. What´s wrong? Michael
Wreakon
Wreakon
It looks like your ambient is dark green, and the spot light is slightly less green/red Note that these colors would be heard to differentiate on a model, try bright colors like yellow, pink. Make sure that your light is on the same side as the camera, not behind the model, etc.

-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: http://students.washington.edu/andrey
-------Homepage: http://www.pclx.com
Psybr
Psybr
Make sure you''ve initialized the light, because I killed a lot of brain cells figuring that out
tok_junior
tok_junior
I don''t really know how that lighting system works, but usually the colours ranges from 0.0f-1.0f...


--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
FogGobbler
FogGobbler
Thanks for all your answers!
Bye,
Michael

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.