PDA

View Full Version : Distance Falloff Shader?


mustardseed
11-22-2006, 06:53 AM
Is there a shader that can apply colours from a gradient to a surface based on distance from the camera? I'm trying to simulate the way the ocean colour get deeper towards the horizon. The camera is animated from high angle (nearly bird's eye view) down to sea level pointing to horizon.

I've tried the Falloff shader but that doesn't seem to be tied to distance, only vector info...

Thanks in advance!

moka.studio
11-22-2006, 07:27 AM
Is there a shader that can apply colours from a gradient to a surface based on distance from the camera? I'm trying to simulate the way the ocean colour get deeper towards the horizon. The camera is animated from high angle (nearly bird's eye view) down to sea level pointing to horizon.

I've tried the Falloff shader but that doesn't seem to be tied to distance, only vector info...

Thanks in advance!

you can use the gradient shader, setting the Type to: 'Linear',
Start 0 - 0 -0End 0 - (your distance) - 0
and 'Space:' to 'Camera'.
You could also mix this with a fresnel falloff to get an even better effect

edit: This does not exactly do what you want. I think Per's suggestion is much better, using the Falloff plugin / Fresnel, and if needed using an expresso rig to drive the distance parameter

Per-Anders
11-22-2006, 07:28 AM
the ocean gets deeper coloured the deeper it is, for that use the free "distance falloff" shader, (search at the sites listed on plugincafe.com), but you could also be talking about is fresnel, which makes the oceans color become closer to the sky's the more accute the angle between the viewer and the surface (i.e. reflectance) and hence closer towards the horizon the sea would get slightyl lighter, though also mist comes into play there to fully disolve the horizon. of course you might be looking at photos of carribean islands with clear water where you simply see the sand lightening the water to the point where there's nan actual shelf falloff (and that's where it gets quite a lot deeper). if you wanted to just fake it using any 3d gradient from the actual camera you can either make a 3d gradient and use xpresso to set drive one point of the gradient from the cameras position, or you could use a proximal shader in a coloriser with the camera as one of hte proximals targets.

mustardseed
11-22-2006, 08:04 AM
Thanks moka! I can't believe that I've been using gradients without knowing that setting was there all along. I dropped that into my layers in the Color channel and got what I needed.

Per, your method sounds like it'll produce the most controllable and accurate-looking effect. I'll have to give it a go, once I can figure out some of the steps you've pointed out. And yes, I'm actually trying to create the effect where the sea water gets darker as it gets deeper further from shore. With proximal, does that mean I have to assign a null somewhere in the distance?

Would Vreel Skin/Translucent Pro work here as well?

Thank you very much!

moka.studio
11-22-2006, 02:04 PM
I think I would not go with Transluscent on this one, or any other kind of SubSurface shaders.

The distance falloff shader may prove usefull though if you have some object such as an island that are seen through the water, and you would like to show the depth of the water surrounding them.

Post your material setup when you have it, if you can;I would be curious to see what you came with!

ArndtvonKoenigsmarck
11-23-2006, 09:06 AM
Hello,
I just tried to reproduce this effect with Translucen Pro. This is just a cube for the water surface, a landscape object below for the sand and a sphere as environment. I am posting 2 different views of the same scene:

http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean1.jpg
http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean2.jpg

ooo
11-23-2006, 09:17 AM
Hello,
I just tried to reproduce this effect with Translucen Pro. This is just a cube for the water surface, a landscape object below for the sand and a sphere as environment. I am posting 2 different views of the same scene:

http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean1.jpg
http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean2.jpg

That's looking great Arndt! Any chance of posting the file or settings?

Thanks,

odo

ArndtvonKoenigsmarck
11-23-2006, 09:36 AM
That's looking great Arndt! Any chance of posting the file or settings?

Thanks,

odo

Sure, no problem:

http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean.c4d.zip

ooo
11-23-2006, 09:40 AM
Thanks Arndt! Much appreciated. :)

odo

Katachi
11-23-2006, 11:06 AM
Hi,

This effect is due to aerial perspective and it can be simulated physically correct within DPIT V4 (www.dpit2.de V4preview).

See this and the attached image:
http://www.dpit2.de/preview_imgs/footage/smallislands.jpg

The plugin is not yet available though.

moka.studio
11-23-2006, 11:47 AM
Hello,
I just tried to reproduce this effect with Translucen Pro. This is just a cube for the water surface, a landscape object below for the sand and a sphere as environment. I am posting 2 different views of the same scene:

http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean1.jpg
http://www.vreel-3d.de/vreel/plugins/Translucent_Doku/Ocean2.jpg

Hi,
This effect is due to aerial perspective and it can be simulated physically correct within DPIT V4 (www.dpit2.de (http://www.dpit2.de/) V4preview).
See this and the attached image:
http://www.dpit2.de/preview_imgs/footage/smallislands.jpg

The plugin is not yet available though.

nice exemples

mustardseed
11-24-2006, 08:12 AM
Arndt's and Kataachi's look great!

Here's what I've managed so far with just Gradients and Falloffs layered in the Colour and Transparency channels. I did a test on r10 demo, and it looks better with SPD or Normals. On my 9.1 core, the closeup of the bump doesn't look too good.

CGTalk Moderation
11-24-2006, 08:12 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.