Ive been playing with lightning and shadow volumes, but shadow volumes can be very low if you have many lights.
My question is, Is it worth the trouble? I mean, if you have 4 lights, you will have to draw 8 times the scene (2 per light) and you also have to calc the silhouete for the vector of the light in the objects coordinates. This is very expensive!
Another problem with the GL lights is that objects dont block it…
imagine a heighfield and in the middle a small cabin. Outside there would be only the moonlight and inside a torch or a candle. Now, how do I “stop” the light from getting out through the walls, but not windows?
I did search google… but couldnt find anything about this particular problem… maybe I look in the wrong places.
Thanks in advance
This is correct, but all four lights do not illuminate the entire scene. It is possible to process the scene such that each lighting pass (or combination) only renders those parts of the scene that cast shadows from the light or are potentially illuminated. This takes some clever software but is exactly the kind of thing that will differentiate one piece of rendering software from another.
Yes OpenGL lights don’t cast shadows, that’s why people spend so much effort trying to figure this out. It is a difficult problem and cannot be efficiently solved in the naive OpenGL rendering paradigm. It takes additional software and algorithms to implement it efficiently on todays hardware…
And for many cases you’re right, it’s not worth it. You can, for example, compute the correct lighting into a texture and use that instead of opengl lighting. It all depends on how dynamic and accurate you need your shadows to be.
Maybe Per Pixel Lighting…?
I think i once saw a demo of Per Pixel Lighting with shadows
the problem is that my card doesn support the required extensions :\
To know what when the light is visible to a model involves a litle of math (plane equations and sutff right?)
My shadows dont need to be very accurate, they just need to look nice