PDA

View Full Version : Using cookies on directional lights?


danshewan
08-14-2010, 10:35 AM
One of the key lights in my scene is motivated by a light source outside of the scene - in this case, an underwater light effect shining through portholes in a corridor.

I was thinking about using a dominant directional light to simulate the sun's rays casting through the water and into the scene from outside the vessel, and it occurred to me that a subtle god-ray effect may reveal the faceting that would otherwise be hidden by surrounding geometry.

A quick Max grab to illustrate what I mean - just think multiple instances of the low-poly wall geometry.


http://a.imageshack.us/img683/2932/lightre.jpg


I'm hoping to simulate the passage of the light through the water and into the scene, and even though the light effect would be quite subtle, it's quite important to the scene in terms of color balance.

Firstly, would a single dominant directional light be the best approach for this type of effect? I'd presumed that it would be in order to realistically simulate a single light source (as this light effect has to be consistent elsewhere in the scene, albeit through larger windows of a different shape), and that the god-ray and any secondary caustic effect would be handled by post-processing. Would such faceting even be noticeable? Would multiple lights of another type be better suited for this?

Secondly, if a dominant directional light is the best approach, would it be possible to use cookies to disguise the faceting of the porthole's low-poly geometry, or would I have to increase the density of the window geometry to make the hole appear rounder? Or is there a simpler solution?

Looking forward to hearing what you guys think, and thanks in advance for any suggestions.

Gilgamesh
08-14-2010, 11:24 AM
You can use alpha based lighting on directional lights as far as I can remember, there is a way to assign a material to lights so that it 'projects' the image.

http://udn.epicgames.com/Three/LightingReference.html

Might help a bit more.

Froyok
08-16-2010, 12:55 PM
This could help you : http://www.chrisalbeluhn.com/UT3_Cloud_Shadows.html

Note that in the GDC map the underwater effect on the ground is juste an effect added directly on the texture, not by the dominant light. The advantage of the dominant light is that affect all objects under the light.

For the godray, I think the bets solution is to make a water effect translucent, but add an unlit effect (like on the ground) who can block the rays. In this way, the rays can be moved with your water shader.

danshewan
08-16-2010, 01:02 PM
Thanks for the replies, guys - definitely a lot of interesting stuff to start experimenting with! Hopefully I'll be posting some initial tests in my thread in P&P within the next week or so.

Thanks again.

haiddasalami
08-16-2010, 01:23 PM
Saw this when I was looking for some stuff for the stereoscopic thread.

http://udn.epicgames.com/Three/MaterialExamples.html#Moving%20Dust%20in%20Water

Might be useful since you're doing an underwater scene...

danshewan
08-16-2010, 01:55 PM
Awesome - thanks, man. I was wondering how to go about creating that effect, even though I'm a ways off yet. Very useful, thanks.