lights : number of it and infinite number of it

Started by
21 comments, last by killan 17 years, 10 months ago
Quote:Original post by don
There is no restriction imposed by Direct3D on the maximum number of lights when using the fixed-function pipeline (up to the number of lights that can be expressed by a DWORD).


Actually Direct3D states that you may have only 8 lights active at any one time. You can define as many as you'd like, but you will have to activate and deactivate them dynamically. Thanks for pointing out that 4 lights was wrong though, it's been a while since I've messed with a fixed function pipeline.
-----------------------------------Indium Studios, Inc.
Advertisement
Quote:Actually Direct3D states that you may have only 8 lights active at any one time. You can define as many as you'd like, but you will have to activate and deactivate them dynamically. Thanks for pointing out that 4 lights was wrong though, it's been a while since I've messed with a fixed function pipeline.




I'd be interested to know where in the D3D9 SDK docs that it states that you can only have a max of eight active lights so that I can log a doc bug.

What do you think D3DCAPS9::MaxActiveLights is for?

Quote:Actually Direct3D states that you may have only 8 lights active at any one time.


Actually, 8 lights is the minimum number of lights supported, I believe. Depends on the video card for how many more it'll support.
Thats right, you dont have to enable every light of you level. You can have 500 lights and cleverly switch them on and off depending on their visibility fo5 example (that would require some extra-attention on the level designer's side of course, to ensure not too many lights can be visible at the same time)

And in the same scene, you dont have to enable lights to render objects wich are not illiminated by that light. For example imagine a circular room with 8 pillars arround it and 4 spotlights at the bottom of each pillar that are oriented towards the wall of the room. That would be possible if you render each pillar one after each other resetting the active lights after each one.

- Janta
Quote:
Actually, 8 lights is the minimum number of lights supported, I believe. Depends on the video card for how many more it'll support.



And yet killan claims that his card reports 4 lights via the caps. Are you sure about this?

But, most games don't need more than 8 lights at once shining on any one part. There are not that many situations where this is necessary. Just have the 8 closes lights shine on an object, and it will look extremely realistic. Even 8 lights is, in many situations, unnecessarily high.
Quote:Original post by don
Quote:
Actually, 8 lights is the minimum number of lights supported, I believe. Depends on the video card for how many more it'll support.



And yet killan claims that his card reports 4 lights via the caps. Are you sure about this?


I don't know about direct3d, but opengl spec states that at least eight lights must be supported. I'm guessing direct3d probably conforms to this minumum too, since the hardware devs have to conform to the eight light minimum anyway to be up to opengl spec.

i have look again for caps of my cards and it say 8 active lights max.

4 it's maybe for my previous old card, sorry


so if i understand your point of view, in my render, for each objet i determine X lights near the objects (with 8 as maximum) i set them, i render and so one for each object ?

just ?

thanks a lot, i have better comprehention now :)
Killan - www.daaboo.net
Nop. It's not true. I had a scene with hundreds of lights, off course not hardwer supported. As I mentioned before all you need to do is:
-setup and create light
-in render procedure, between BeginScene and EndScene change light coordintes (or any other property of light) and SetLight again.
-do step two as much as you need it.
For example if you have on scene 16 visible lights, use light as much as your graphic card can have. Then reuse them again.
It is slower off course, but you can use as many lights as you want.


but we have talk about 8 light maximum supported, how you do this for 16 lights ?, or i not understand your explanation sorry
Killan - www.daaboo.net

This topic is closed to new replies.

Advertisement