_phil_ said:
ok,ok ,i admit you can vertex-alpha the shadow volumes (that doesn't goes far
)
And I admit that you still don't have a clue.
D3 does not make shadow by drawing black polygons. Didn't I allready say that? (And no, you can not vertex-alpha the shadow volumes, nor would you want to, since they are drawn to the stencil buffer.)
D3 only adds light to a scene, it never subtracts light. Do you understand?
How to add multiple lights:
1. Clear the screen to black.
Consequence of step 1: The screen will be black
2. add light from light1 to every pixel that can 'see' light1.
Consequence of step 2: The only black pixels are those who can not see light1.
The pixels that can see light1 will have the brightness of the light received from light1.
3. add light from light2 to every pixel that can 'see' light2.
Consequence of step 3: The only black pixels are those who can neither see light1 nor light2.
The pixels that can see light1 but not light2 will have the brightness of the light received from light1.
The pixels that can see light2 but not light1 will have the brightness of the light received from light2.
Those pixels that can see both light1 and light2 will have a brightnes totaling the light received from light1 plus the light received from light2
4. add light from light3 to every pixel that can 'see' light3.
Consequence of step 4: The only black pixels are those who can neither see light1, light2 or light3.
The pixels that can see light1 but not light2 or light3 will have the brightness of the light received from light1.
The pixels that can see light2 but not light1 or light3 will have the brightness of the light received from light2.
The pixels that can see light3 but not light1 or light2 will have the brightness of the light received from light3.
Those pixels that can see both light1 and light2 but not light3 will have a brightnes totaling the light received from light1 plus the light received from light2
Those pixels that can see both light1 and light3 but not light2 will have a brightnes totaling the light received from light1 plus the light received from light3
Those pixels that can see both light2 and light3 but not light1 will have a brightnes totaling the light received from light2 plus the light received from light3
Those pixels that can see all three lights will have a brightnes totaling the light received from light1 plus the light received from light2 plus the light received from light3.
and so on until all lights are added. Notice that all that the engine has to do is what is written right after each number ("add light from lightx to every pixel that can 'see' lightx"). The complicated interplay between the shadows from the different light sources happens completely automatically.