Page 1 of 3

Reflection visibility on the other objects

Posted: Thu May 09, 2019 10:11 am
by simowlabrim
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?

Re: Reflection visibility on the other objects

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

Wish it was possible though!

Re: Reflection visibility on the other objects

Posted: Thu May 09, 2019 6:53 pm
by milanm
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

Re: Reflection visibility on the other objects

Posted: Thu May 09, 2019 8:01 pm
by mitchino
Didn't know that - will check it out - sounds very handy.

Re: Reflection visibility on the other objects

Posted: Thu May 09, 2019 9:17 pm
by simowlabrim
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.

Re: Reflection visibility on the other objects

Posted: Thu May 09, 2019 11:49 pm
by milanm
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 16241 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_R ... urse21.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/mzzuu96rsr1ul ... D14EkwhYQA
https://www.youtube.com/watch?v=1e13oLq ... dex=7&t=0s

Regards
Milan

Re: Reflection visibility on the other objects

Posted: Fri May 10, 2019 9:08 am
by calus
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

Re: Reflection visibility on the other objects

Posted: Fri May 10, 2019 9:34 pm
by simowlabrim
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 573 times
Insall the LiveDB Material: Copy and Past here C:\Users\YourPcName\AppData\Roaming\OctaneRender\localDb

Re: Reflection visibility on the other objects

Posted: Fri May 10, 2019 9:38 pm
by calus
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.

Re: Reflection visibility on the other objects

Posted: Fri May 10, 2019 10:57 pm
by milanm
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