Recently I started using directX9 instead since I found this cool water-code snippet on this forum that required directx9 instead.
Now the lightning kinda gives full 100% light with a certain reach. And after that it's completely 100% dark. How do I get smooth lightning with dx?
I found the setAmbientLight function and it helped a little with dx, but the light-points themselves still behave the same way. And somehow ambient light only worked on my terrains, not on the characters. So the characters were pitch-dark with only ambient light.
DX9 without ambient
Code: Select all
scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(400,350,400),video::SColorf(1.0f,1.0f,1.0f,1.0f), 400.0f);
DX9 with ambient
Code: Select all
device->getSceneManager()->setAmbientLight(video::SColorf(128, 128, 128, 1));
scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(400,350,400),video::SColorf(1.0f,1.0f,1.0f,1.0f), 400.0f);
OpenGL
Code: Select all
scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(400,350,400),video::SColorf(1.0f,1.0f,1.0f,1.0f), 250.0f);