Global, Dynamic Lighting System
Currently I have a class for each type of a light, a static class used for global communication with no externs and no instantiantions. I can manage a dynamic list of lights stored within d3d's SetLight parameters and enable them as needed by objects, the world, or just always...given the max
From here since each light will have its own unique id in a master class I can relay that ID to building class' for example which need to light themselves.
So a few questions:
- Does D3D have a max when it comes to SetLight?
I know it does with LightEnable, the max can be found in the caps.
Re: Global, Dynamic Lighting System
Hardware based lighting I know goes upto 8 lights on many cards. Software lighting is unlimited.
Re: Global, Dynamic Lighting System
How do games have dynamic lighting with >8 lights affecting a model in realtime?
Re: Global, Dynamic Lighting System
8 lights Jacob????
Well D3DCAPS9 shows MaxActiveLights on my system to be 0....
Which makes no sense since I am using several programs as tutorials to aid my light quest, and they all work fine...with lots of lights.
Now, I have found out one thing:
IDirect3DDevice9->SetLight(...) can be used for ANY number of lights, since everytime you call SetLight the appropriate ammount of memory is allocated on the system. So you can SetLight until you run out of memory.
IDirect3DDevice9->LightEnabled(...) can be only used for a certain number of lights, now this max is suppose to be in the CAPS but for me it shows a 0, which makes NO SENSE. Even in apps where multiple lights are at work the caps show MaxActiveLights = 0x00000000;
Re: Global, Dynamic Lighting System
Any place where I have set ambient, diffuse, specular...etc.
My material, my lights.
It is always 1.0f all the way so I get white light.
Yet anything my lights touch turn RED....
Re: Global, Dynamic Lighting System
Games usually have premultiplied lights, such as Half-Life and that. Their dynamic lighting really consists of premultiplied lightmaps being superimposed at certain degrees of translucency. Where you'll see the "dynamic lighting" is on the gun you're holding in your hands, which may have a green glow under it with a yellow one above.
And remember the (stupid) principles of lights on computers: anything that is 0 will be black no matter what. It's really a LDR problem, though, which is a whole 'nother ballgame.