Cloner instances with transparency based on camera distance

Forums: Cloner instances with transparency based on camera distance
Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderator: aoktar

Cloner instances with transparency based on camera distance

Postby xcaseyx » Wed Dec 16, 2015 6:19 am

xcaseyx Wed Dec 16, 2015 6:19 am
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 %.
xcaseyx
Licensed Customer
Licensed Customer
 
Posts: 115
Joined: Wed Feb 18, 2015 9:04 pm

Re: Cloner instances with transparency based on camera distance

Postby xcaseyx » Wed Dec 16, 2015 10:42 pm

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

mograph color in the opacity channel, use a shader effector with a box/sphere falloff as a child of the camera.
xcaseyx
Licensed Customer
Licensed Customer
 
Posts: 115
Joined: Wed Feb 18, 2015 9:04 pm

Re: Cloner instances with transparency based on camera distance

Postby milanm » Thu Dec 17, 2015 4:29 pm

milanm Thu Dec 17, 2015 4:29 pm
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 4129 times


Camera to Opacity Spherical.jpg


Scene files:
Camera to Opacity.zip
(127.66 KiB) Downloaded 200 times

Camera to Opacity Spherical.zip
(201.04 KiB) Downloaded 177 times


I hope this helps in any way.

Regards
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
milanm
Licensed Customer
Licensed Customer
 
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

Re: Cloner instances with transparency based on camera distance

Postby xcaseyx » Fri Dec 18, 2015 8:40 pm

xcaseyx Fri Dec 18, 2015 8:40 pm
holy cow! THAT WORKS AWESOME!
xcaseyx
Licensed Customer
Licensed Customer
 
Posts: 115
Joined: Wed Feb 18, 2015 9:04 pm

Re: Cloner instances with transparency based on camera distance

Postby Hightechmech » Tue Apr 20, 2021 10:29 am

Hightechmech Tue Apr 20, 2021 10:29 am
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?
Hightechmech
Licensed Customer
Licensed Customer
 
Posts: 36
Joined: Sat Dec 23, 2017 5:35 pm

Return to Maxon Cinema 4D


Who is online

Users browsing this forum: No registered users and 25 guests

Sat Apr 27, 2024 4:14 am [ UTC ]