Page 1 of 1

Cloner instances with transparency based on camera distance

Posted: Wed Dec 16, 2015 6:19 am
by xcaseyx
Hello,

Im hoping there may be a render time solution that octane may have that Im not seeing.

Is it possible with an octane shader to adjust the opacity/transparency of an object base on its distance to another object?

example:

Camera as object A
Cubve as object B

When the camera gets close to object B its becomes completely transparent, when it moves away its completely opaque.

I can do this is cinemas native render engine in about a dozen different ways, but I can't seem to get a good SMOOTH methodology solved for octane.


One thing that does work, although its terribly awkward, is to make the cloner editable and use an xpresso script to change the display tag, visibility %.

Re: Cloner instances with transparency based on camera distance

Posted: Wed Dec 16, 2015 10:42 pm
by xcaseyx
figured it out,

mograph color in the opacity channel, use a shader effector with a box/sphere falloff as a child of the camera.

Re: Cloner instances with transparency based on camera distance

Posted: Thu Dec 17, 2015 4:29 pm
by milanm
Hi, Casey! Big fan of your work ;)

Sorry I've been extremely busy these days so I couldn't post earlier.. :(

I got this working with render instances using Octane gradient with Perspective projection linked to camera.
Theoretically it should work with scatter, xp or any other Octane instances regardless of mograph.
BUT.. I couldn't figure out how to stop gradient from repeating. Still, with careful adjustments it could be useful.
You can control the falloff with S.X value. Also, I'm not sure but it could probably be linked to anything, not just a camera.

Node setup:
Nodes.png
Camera to Opacity.jpg
And if we change projection to 'Spherical' after that we get an interesting effect and it's still linked to Camera!
Projection.png
Projection.png (15.1 KiB) Viewed 4487 times
Camera to Opacity Spherical.jpg
Scene files:
Camera to Opacity.zip
(127.66 KiB) Downloaded 235 times
Camera to Opacity Spherical.zip
(201.04 KiB) Downloaded 210 times
I hope this helps in any way.

Regards
Milan

Re: Cloner instances with transparency based on camera distance

Posted: Fri Dec 18, 2015 8:40 pm
by xcaseyx
holy cow! THAT WORKS AWESOME!

Re: Cloner instances with transparency based on camera distance

Posted: Tue Apr 20, 2021 10:29 am
by Hightechmech
Hi Milan, your method was very interesting. Is there a new workaround for this? I just need a cloner grid to fade out gradually with a 3d gradient. Is there an easier way for this in the latest version of Octane?