OSL raytype contribution

Forums: OSL raytype contribution
Post, discuss and share handy resources like textures, models and HDRI maps in this forum.
Forum rules
Please do not post any material that is copyrighted or restricted from public use in any way. OTOY NZ LTD and it's forum members are not liable for any copyright infringements on material in this forum. Please contact us if this is the case and we will remove the material in question.

OSL raytype contribution

Postby calus » Fri May 10, 2019 8:49 am

calus Fri May 10, 2019 8:49 am
This is a super simple but very powerful Octane OSl texture shader,
kind of a "live compositing" node, allowing to precisely control the contribution of each ray type :
Plugged in the opacity of a material it allows to lower visibility or hide an object in reflection, refraction, AO ,shadow , diffuse or camera.
Or can be used for example, as "amount" attribute of a mix texture/ mix material node, or in emission texture, ect ...

raytype_contrib.zip
(410 Bytes) Downloaded 125 times



> The blue sphere is not visible in reflection and refraction
octane_2019-05-11_01-03-50.png

Raytype_Contrib.orbx
(278.38 KiB) Downloaded 87 times




Code: Select all
shader raytype_contribution(
   float cam = 1 [[string label = "Camera", float min=0, float max=1]],
   float shad = 1 [[string label = "Shadow", float min=0, float max=1]],
   float AO = 1 [[string label = "Ambient occlusion", float min=0, float max=1]],
   float diff = 1 [[string label = "Diffuse", float min=0, float max=1]],
   float refl = 1 [[string label = "Reflection", float min=0, float max=1]],
   float refr = 1 [[string label = "Refraction", float min=0, float max=1]],
   output color c = 0
    )
{
    c = cam*raytype("camera") + shad*raytype("shadow") + AO*raytype("AO")
    + diff*raytype("diffuse") + refl*raytype("reflection") + refr*raytype("refraction");
}



EDIT: sorry there was a last minute bug in the script, this is fixed thanks to Milanm.
The shader seems to works just fine now.
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: 1295
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: OSL raytype contribution

Postby frankmci » Sat May 11, 2019 7:49 pm

frankmci Sat May 11, 2019 7:49 pm
As much as I love Milan's RayType scripts, I've had very little success getting the animators I support to use them on their own. I think this one will be more intuitive for them, and resolve a lot of complaints they have about rendering with an unbiased engine. It will also save a lot of time setting up multi-pass renders and fixing things in the composite.

Many thanks!
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 309
Joined: Fri May 26, 2017 2:00 pm

Re: OSL raytype contribution

Postby calus » Sat May 11, 2019 9:46 pm

calus Sat May 11, 2019 9:46 pm
frankmci wrote:As much as I love Milan's RayType scripts, I've had very little success getting the animators I support to use them on their own. I think this one will be more intuitive for them, and resolve a lot of complaints they have about rendering with an unbiased engine. It will also save a lot of time setting up multi-pass renders and fixing things in the composite.

Indeed both scripts are complementary, Milan' raytype.osl is a switch between ray types, while this one is a modulator for each ray type.
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: 1295
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: OSL raytype contribution

Postby frankmci » Tue May 14, 2019 12:32 pm

frankmci Tue May 14, 2019 12:32 pm
calus wrote:Indeed both scripts are complementary, Milan' raytype.osl is a switch between ray types, while this one is a modulator for each ray type.


Yes, indeed. I don't mean to belittle Milan's wonderful contributions! I've already put them to good use many times. While it's certainly possible to get the same functionality with his great tool, often a simple on/off is what the doctor ordered, greatly simplifying the compositing phase.

While a big part of my job is helping solve other people's problems, they're not always thrilled with the solutions I offer. There's something to be said for simplicity, especially when trying to introduce new things to people already under deadline pressures. :)

Many thanks to all those who put in the time and effort, then go the extra mile to share their expertise with the community!
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 309
Joined: Fri May 26, 2017 2:00 pm

Re: OSL raytype contribution

Postby fantome » Wed Jun 05, 2019 11:11 pm

fantome Wed Jun 05, 2019 11:11 pm
Thanks for the great shader it is very useful for reflection pass.

I think i have encounter a bug with the refraction.
- take a bunch of sphere with specular shader
- put an environment
- activate reflection and refraction pass
- plug the osl node in opacity

When you set :
- reflection to 0 in osl node -> it works you get the exact same thing without object reflections
- refraction to 0 in osl node -> it doesn't work, in fact the environment position is not the same and it is inverted
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 122
Joined: Wed Dec 16, 2015 3:38 pm

Re: OSL raytype contribution

Postby Antoncromas » Wed Jun 19, 2019 3:56 pm

Antoncromas Wed Jun 19, 2019 3:56 pm
This is fantastic, thank you!
Antoncromas
Licensed Customer
Licensed Customer
 
Posts: 9
Joined: Fri Oct 05, 2018 3:53 pm

Re: OSL raytype contribution

Postby HHbomb » Thu Jun 27, 2019 8:46 am

HHbomb Thu Jun 27, 2019 8:46 am
Otoy team should make this node as native... :!:
| seven 64 | i7 5930K + titanX + 1050 for video | i7 3970 + 4 x titan | i7 5960 + 4 x titanX | 3dsmax 2018 |
HHbomb
Licensed Customer
Licensed Customer
 
Posts: 876
Joined: Wed Jun 30, 2010 8:45 pm

Re: OSL raytype contribution

Postby Goldorak » Thu Jun 27, 2019 9:14 am

Goldorak Thu Jun 27, 2019 9:14 am
HHbomb wrote:Otoy team should make this node as native... :!:


Agreed
User avatar
Goldorak
OctaneRender Team
OctaneRender Team
 
Posts: 1926
Joined: Sun Apr 22, 2012 8:09 pm

Re: OSL raytype contribution

Postby HHbomb » Fri Jun 28, 2019 5:50 am

HHbomb Fri Jun 28, 2019 5:50 am
Cool !! Thanks :mrgreen:
| seven 64 | i7 5930K + titanX + 1050 for video | i7 3970 + 4 x titan | i7 5960 + 4 x titanX | 3dsmax 2018 |
HHbomb
Licensed Customer
Licensed Customer
 
Posts: 876
Joined: Wed Jun 30, 2010 8:45 pm

Re: OSL raytype contribution

Postby Iceman9 » Sat Jul 13, 2019 8:27 pm

Iceman9 Sat Jul 13, 2019 8:27 pm
I like the shadow catcher as it currently is. So please don't eliminate the existing option, just add alternatives.
Iceman9
Licensed Customer
Licensed Customer
 
Posts: 179
Joined: Sun Jun 09, 2013 1:22 am

Return to Resources and Sharing


Who is online

Users browsing this forum: No registered users and 1 guest

Fri Oct 18, 2019 11:17 am [ UTC ]