Reflection visibility on the other objects

Forums: Reflection visibility on the other objects
Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderator: aoktar

Reflection visibility on the other objects

Postby simowlabrim » Thu May 09, 2019 10:11 am

simowlabrim Thu May 09, 2019 10:11 am
Is there any way to turn off the reflection or refraction visibility of an object
so it doesn't appear on the other objects in octane for C4D?
simowlabrim
Licensed Customer
Licensed Customer
 
Posts: 11
Joined: Sun Jun 10, 2018 9:17 am

Re: Reflection visibility on the other objects

Postby mitchino » Thu May 09, 2019 1:12 pm

mitchino Thu May 09, 2019 1:12 pm
No.

Wish it was possible though!
mitchino
Licensed Customer
Licensed Customer
 
Posts: 270
Joined: Thu Jul 14, 2016 4:49 pm

Re: Reflection visibility on the other objects

Postby milanm » Thu May 09, 2019 6:53 pm

milanm Thu May 09, 2019 6:53 pm
mitchino wrote:No.


Wrong.

This will hide a material from reflections:

  • Add an OSLTexture to Opacity
  • Script category: utils Script presets: Raytype.osl
  • set Ray to: Reflection
  • Swap: check

Same works for refractions, shadows, ambient occlusion, diffuse/caustics and camera by changing the Ray menu to a different option.

Of course, as usual, Alpha shadows option needs to be enabled for opacity to work correctly.

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: Reflection visibility on the other objects

Postby mitchino » Thu May 09, 2019 8:01 pm

mitchino Thu May 09, 2019 8:01 pm
Didn't know that - will check it out - sounds very handy.
mitchino
Licensed Customer
Licensed Customer
 
Posts: 270
Joined: Thu Jul 14, 2016 4:49 pm

Re: Reflection visibility on the other objects

Postby simowlabrim » Thu May 09, 2019 9:17 pm

simowlabrim Thu May 09, 2019 9:17 pm
milanm wrote:
mitchino wrote:No.


Wrong.

This will hide a material from reflections:

  • Add an OSLTexture to Opacity
  • Script category: utils Script presets: Raytype.osl
  • set Ray to: Reflection
  • Swap: check

Same works for refractions, shadows, ambient occlusion, diffuse/caustics and camera by changing the Ray menu to a different option.

Of course, as usual, Alpha shadows option needs to be enabled for opacity to work correctly.

Regards
Milan



Hello Milan, Thank you so much!
you just introduced me to a new world ''The Open Shading Language'', because this method worked fine, I would like if I can exclude them both ''Reflection+Refraction'' but I don't know how yet, Is there any way to do that?
in the meantime, I found this Otoy OSL documentation https://docs.otoy.com/osl/index.html I would love to read-practice it and see what I can do with this. please if there is any other OSL documentation source share it please so I can learn more about it. thanks again.
simowlabrim
Licensed Customer
Licensed Customer
 
Posts: 11
Joined: Sun Jun 10, 2018 9:17 am

Re: Reflection visibility on the other objects

Postby milanm » Thu May 09, 2019 11:49 pm

milanm Thu May 09, 2019 11:49 pm
You can daisy chain multiple raytype nodes together, each with a different Ray option, by connecting them to input A like this:
nodes.png
nodes.png (7.07 KiB) Viewed 857 times


So, basically you can just ctrl-drag that OSLTexture node, connect it in the input A of the first one and change the Ray to Refraction. That will now hide that material in both refractions and reflections.

As for learning OSL, I started by deconstructing the existing scripts and changing some parameters and replacing some values with sliders just to see what happens when I change something. I'm not a programmer at all. So I would highly recommend checking out the presets first and experiment!. When it comes to raytype even almost a year later I'm still finding completely new ways to use it. OSL is really just 95% creativity and 5% coding.

For a good basic introduction, even if you skip all of the boring coding/math parts, here's a few links that really helped me:

If I could go back in time I would give myself this pdf from an old Renderman repository website:
https://github.com/tlanc007/RenderMan_Repository/blob/master/RMR/Publications/sig92.course21.pdf

OSL is a descendant of RSL (most of the code actually works without changes) so I would leave GLSL and Shadertoy for later. This is from '92 but most of the concepts from there are in almost every single shader on shadertoy. It's really fundamental stuff. That entire repository is pure gold.

Also these videos from Zap are a great introduction, especially Lesson-3:
https://www.dropbox.com/s/mzzuu96rsr1uleg/LESSON-3.mp4?dl=0&fbclid=IwAR2D-r7WPj8OHSaQi_rWXVO4w5BZ_wOksLEDfLJwpGlcYxSWbD14EkwhYQA
https://www.youtube.com/watch?v=1e13oLqwy6U&list=PLPKbqsL4CjmTcodA2TY0rMXqc2Q21KSVr&index=7&t=0s

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: Reflection visibility on the other objects

Postby calus » Fri May 10, 2019 9:08 am

calus Fri May 10, 2019 9:08 am
Hi there,
hey Milanm ;)

Just to let you know about another flavor of the raytype osl utility shader, maybe more handy in some cases :
viewtopic.php?f=21&t=71597
Pascal ANDRE
--------------------
Maya 2019, Windows 7, 128 GB RAM
4x GTX 1070, driver 430.39
--------------------

--------------------
Join MAYA OCTANE USERS Skype discussion here :
https://join.skype.com/LXEQaqqfN15w
--------------------
calus
Licensed Customer
Licensed Customer
 
Posts: 1302
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: Reflection visibility on the other objects

Postby simowlabrim » Fri May 10, 2019 9:34 pm

simowlabrim Fri May 10, 2019 9:34 pm
Hello guys,

Thank you Milan for the info you provided I'll check them all on the next days.
I would like to thank also Calus, but unfortunately, the script you provided is not working 100%, it has some Opacity issues to fix yet, but you inspired me to use better the Milan Method...
I created this little Shading network to better Exclude the Refraction and Reflection of an object on the other objects and have more control over them. it is working really well!
is there any chance you fix the opacity issue on your OSL script? or if is there a way to group that shading network in one window and make it with just one output that I can attach to Any Material Opacity?
for now, the LiveDB material I attached here is working fine!
thank you guys.

EnableDisable_ReflectionRefraction.JPG

Disable_Reflection&Refraction.orbx
(29.84 KiB) Downloaded 41 times

Insall the LiveDB Material: Copy and Past here C:\Users\YourPcName\AppData\Roaming\OctaneRender\localDb
simowlabrim
Licensed Customer
Licensed Customer
 
Posts: 11
Joined: Sun Jun 10, 2018 9:17 am

Re: Reflection visibility on the other objects

Postby calus » Fri May 10, 2019 9:38 pm

calus Fri May 10, 2019 9:38 pm
simowlabrim wrote: the script you provided is not working 100%, it has some Opacity issues to fix yet,

Thanks for debugging ! or maybe this is just it has to be used another way, I will check this and try to fix or provide usage example.
Pascal ANDRE
--------------------
Maya 2019, Windows 7, 128 GB RAM
4x GTX 1070, driver 430.39
--------------------

--------------------
Join MAYA OCTANE USERS Skype discussion here :
https://join.skype.com/LXEQaqqfN15w
--------------------
calus
Licensed Customer
Licensed Customer
 
Posts: 1302
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: Reflection visibility on the other objects

Postby milanm » Fri May 10, 2019 10:57 pm

milanm Fri May 10, 2019 10:57 pm
Hey Pascal

That's a great idea, as always! I'm writing this in a hurry so I apologize for not being able to thank you properly.

All you have to do to fix the "issue" is remove the "/6". You don't need it. Also in my tests actually max() operation worked better than +.

I'll be back over the weekend with more stuff and examples. And I have some normal mapping scripts to release that I've been working on for a while. (also I have some answers for that topic from James / baltort).

Thank you so much for taking the time to write that version, not quite what I had in mind when I said "replacing some values with sliders just to see what happens" though :lol:

Cheers
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
Next

Return to Maxon Cinema 4D


Who is online

Users browsing this forum: No registered users and 6 guests

Sat Dec 14, 2019 5:25 am [ UTC ]