Download

Underwater lighting fx?

I’d like to add a rippling lighting fx to lakebeds when the player is underwater, like can be seen here:

Anyone know of any techniques of how this can be done? Thanks in advance.

That effect is called “water caustics”, that should help your search.
I found this video right away https://www.youtube.com/watch?v=B40yYDiVVXE

I think there’s an example of a caustics material in one of the UDK example levels. It’s the level with a jungle temple and a waterfall, and if you play the level, there’s a matinee sequence that does camera changes, lighting changes, and weather changes.

I don’t know off the top of my head how caustics were handled in that material, but this is what I would do:

  • Make some tiled voronoi noise textures. (If you don’t have something that can do that, let me know and I’ll make one for you, 'cause we’re old school UDK bros who help each other out like that.) Pack some different voronoi noise options into the RGB channels of your texture.
  • Make some copies of the voronoi texture in your material, hook a panner into them, take the red channel from one and add it to the green channel of another. That might be enough, but you could pan it in four different directions, and take one channel from each (RGBA) and add them all together.
  • That might be enough randomness, but if you want more, you can take a separate perlin noise texture, pan that, add it to a texture coordinate (probably multiplying it down first, probably to 0.1 or something like that because a little noise in the texture coordinate goes a long way), and plug that into the texture coordinates of the panners for your voronoi.
  • With panning tiled perlin noise plus a texture coordinate plugged into panning tiled voronoi noise, you should have a very interesting noise pattern that looks like underwater caustics. Use the resulting noise to lerp between a whitish electric blue color and a dark blue-black, and plug that into your emissive.
  • Get the world position X and Y coordinates (stored in the RG channels) to tile the the textures so that the caustics are connected across all the meshes that have caustics on them.
  • Decide on a Z value where you’re going to have your water plane. Use the world position’s Z (stored in the B channel) to decide whether or not to add caustics to the emissive, so that way you can have rocks poking out of the water that don’t have caustics, but the underwater portion does.

I think that’s all doable. If any of those steps end up being harder than I suggested, let me know and I’ll see if I can figure it out.

Thanks for the response guys. I’ve followed that tutorial video (very simple steps), but applying the caustic material to a scenes dominant directional light’s light function doesn’t appear to do anything for me (even on just the default UDK map). Not sure what i’m doing wrong.

Ah, i just needed to tick the box for “Used As Light Function” in the material.

Just for fun, I thought I would try it out.

Not too bad, I think, but it could use some tweaking.

Edit: I can get it to work by adding a new DDL to a scene and applying the lighting function.

However applying it to an existing DDL (such as the default one that spawns with the default maps) seems to have no effect.

Anyone know why? As I’d like to avoid removing my existing DDL.