Underwater caustics

Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)
milanm
Licensed Customer
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

Yep, good old circular noise.

You can actually use the surface of the water as a "gobo". Back in V2 I used dirt in opacity but that produces a glich since V3 so I guess noise should do the trick for now.

Also, with raytype you can make the noise visible to shadow rays only . You can get some lovely caustics even in Ambient Occlusion mode.

256 samples only:
Image
Nodes.PNG
Btw. for the quick "fog" setup I just used a small plane in front of the camera and oriented towards the camera with this material: specular with no refraction + scattering medium. It's hard to see in the gif but there are some god rays there too. Super easy to setup and if you use emission instead of scattering it renders realtime on a single gtx780 in 1080p.

Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Whispermode
Licensed Customer
Posts: 136
Joined: Thu Aug 11, 2016 11:27 pm

milanm wrote:Yep, good old circular noise.

You can actually use the surface of the water as a "gobo". Back in V2 I used dirt in opacity but that produces a glich since V3 so I guess noise should do the trick for now.

Also, with raytype you can make the noise visible to shadow rays only . You can get some lovely caustics even in Ambient Occlusion mode.

Btw. for the quick "fog" setup I just used a small plane in front of the camera and oriented towards the camera with this material: specular with no refraction + scattering medium. It's hard to see in the gif but there are some god rays there too. Super easy to setup and if you use emission instead of scattering it renders realtime on a single gtx780 in 1080p.

Cheers
Milan
Thanks, Milan - this looks really good.

Just clarify some things for me, please:

1. On your first point, are you actually using the surface as a gobo, or just saying it can be done?
2. Is the method specific to OSL/C4D (the node setup is a C4D screenshot, right?)
3. Would you mind describing the lighting and surface setup?

Thanks in advance.
milanm
Licensed Customer
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

1. Yup, the surface of the water in that gif does have a texture in opacity just like the one from linograndiotoy.
2. It's just a node. Works everywhere where Octane is integrated (even in other engines that support OSL) The shader is from here.
3. It's just a daylight/sun. The water itself is casting shadows in the shape of the noise texture.

Here's how that might work in Blender.
It looks like the UI menu is replaced with integer numbers in the demo I'm using, If this is the same in the latest version you should complain to the plugin developer about that. The OSL script will work just fine regardless of UI and these are the settings I used:
BlenderNodes.PNG
Just for reference, the Ray input options are:
0 - Camera
1 - Shadow
2 - AO
3 - Diffuse
4 - Reflection
5 - Refraction

And it looks like the checkbox input is inverted compared to Standalone.

Water is animated so I didn't post an orbx example as usual--it would be huge. I'll see if I can reduce it to a single frame and post.

Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Whispermode
Licensed Customer
Posts: 136
Joined: Thu Aug 11, 2016 11:27 pm

milanm wrote:1. Yup, the surface of the water in that gif does have a texture in opacity just like the one from linograndiotoy.
2. It's just a node. Works everywhere where Octane is integrated (even in other engines that support OSL) The shader is from here.
3. It's just a daylight/sun. The water itself is casting shadows in the shape of the noise texture.

Here's how that might work in Blender.
It looks like the UI menu is replaced with integer numbers in the demo I'm using, If this is the same in the latest version you should complain to the plugin developer about that. The OSL script will work just fine regardless of UI and these are the settings I used:
BlenderNodes.PNG
Just for reference, the Ray input options are:
0 - Camera
1 - Shadow
2 - AO
3 - Diffuse
4 - Reflection
5 - Refraction

And it looks like the checkbox input is inverted compared to Standalone.

Water is animated so I didn't post an orbx example as usual--it would be huge. I'll see if I can reduce it to a single frame and post.

Cheers
Milan
This is awesome - much appreciated.

So, in layman's terms - because I know nothing about OSL/gobos/life in general - the following is happening:

Sunlight is being projected at a plane. The plane has holes in it in the shape of the noise pattern as it is plugged into opacity, therefore light hits the bottom of the pool in the desired pattern. How does the raytype node help?
milanm
Licensed Customer
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

Yup that's correct.

Raytype just makes sure that the surface of the water doesn't look like Swiss cheese. ;)

Cheers
Milan
Last edited by milanm on Tue Mar 19, 2019 2:57 pm, edited 2 times in total.
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
linograndiotoy
OctaneRender Team
Posts: 1353
Joined: Thu Feb 01, 2018 7:10 pm

Very cool!

milanm wrote:Yep, good old circular noise.

You can actually use the surface of the water as a "gobo". Back in V2 I used dirt in opacity but that produces a glich since V3 so I guess noise should do the trick for now.

Also, with raytype you can make the noise visible to shadow rays only . You can get some lovely caustics even in Ambient Occlusion mode.

256 samples only:
Image
Nodes.PNG
Btw. for the quick "fog" setup I just used a small plane in front of the camera and oriented towards the camera with this material: specular with no refraction + scattering medium. It's hard to see in the gif but there are some god rays there too. Super easy to setup and if you use emission instead of scattering it renders realtime on a single gtx780 in 1080p.

Cheers
Milan
Whispermode
Licensed Customer
Posts: 136
Joined: Thu Aug 11, 2016 11:27 pm

milanm wrote:Yup that's correct.

Raytype just makes sure that the surface of the water doesn't look like Swiss cheese. ;)

Cheers
Milan
Ah, of course.

I'll try this out later. Just read your other thread on Raytype. Great work you've done here. Thanks so much.
duskstudio
Licensed Customer
Posts: 20
Joined: Tue Jan 10, 2017 1:38 pm

Hey, sorry to pull this up after almost a year, but looking for some help.

Im trying to recreate the underwater setup in C4D and the caustics are working, but im struggling to get the reflections that can be seen on the underside of the surface? Any tips on how to achieve this and the raytype osl caustics at the same time?

Thanks!
Post Reply

Return to “Blender”