OSL | Raytype = Magic

Forums: OSL | Raytype = Magic
Sub forum for help and tutorials.

Moderator: aoktar

Re: OSL | Raytype = Magic

Postby milanm » Thu Jun 14, 2018 2:27 pm

milanm Thu Jun 14, 2018 2:27 pm
Thanks Frank!

Ok guys I think Material Previews are to be blamed for CUDA errors. I had them disabled after working on a project and they were off while I was working on that scene with animated lights. After turning them on I can now see the same CUDA error after frame 5! Apologies for that. :oops:

Could you please try disabling both of these two options in Live Viewer before opening the scene and see if that fixes anything?

MatPrev.jpg
MatPrev.jpg (55.66 KiB) Viewed 7755 times



UPDATE: In the meantime, this issue was fixed in the latest 4.00 XB3 released a few hours ago! No more CUDA errors with material previews on here! That's our Ahmet ladies and gentlemen! In retrospect, these are uncharted territories, we're breaking new ground here in terms of how C4DOctane can be used so some turbulence was to be expected along our flight I guess. (and I'm probably the king of bad puns) ;)

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: OSL | Raytype = Magic

Postby frankmci » Mon Jun 18, 2018 2:03 pm

frankmci Mon Jun 18, 2018 2:03 pm
milanm wrote:Could you please try disabling both of these two options in Live Viewer before opening the scene and see if that fixes anything?


Milan,
Yup, that fixed, or at least disabled the problem. I can now move past frame five and everything keeps working/rendering. I'll have to see if it's just been the previews causing my instability issues working with OSL/3.08.1 in C4D. Thanks for digging further into it!

This Raytype trick could let us use more of those tried 'n true, quick 'n dirty render tricks that have made biased renders fast and flexible over the years, while still having the render power of Octane. It's been hard to get some of our animation team's old dogs to embrace Octane's unbiased engine.

- Frank
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 821
Joined: Fri May 26, 2017 2:00 pm

Re: OSL | Raytype = Magic

Postby aoktar » Thu Jul 05, 2018 4:45 pm

aoktar Thu Jul 05, 2018 4:45 pm
frankmci wrote:
milanm wrote:Could you please try disabling both of these two options in Live Viewer before opening the scene and see if that fixes anything?


Milan,
Yup, that fixed, or at least disabled the problem. I can now move past frame five and everything keeps working/rendering. I'll have to see if it's just been the previews causing my instability issues working with OSL/3.08.1 in C4D. Thanks for digging further into it!

This Raytype trick could let us use more of those tried 'n true, quick 'n dirty render tricks that have made biased renders fast and flexible over the years, while still having the render power of Octane. It's been hard to get some of our animation team's old dogs to embrace Octane's unbiased engine.

- Frank

It looks like a crash in material previews. Which is as a crash comes from SDK. Let me know if it's still crashing while not having Live Viewer renders. Or with disabled previews.
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
User avatar
aoktar
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 15957
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye

Re: OSL | Raytype = Magic

Postby milanm » Sun Nov 18, 2018 3:23 am

milanm Sun Nov 18, 2018 3:23 am
Here's a quick and dirty example of how Raytype can be used to switch between two different environment maps. Basically, that will allow you to use a different HDRI for refractions/reflections and even diffuse light.

When I experimented with this for the first time, I think I reached a point where I had about 5-6 different HDR maps for different things reflected or refracted in other things and, at that point, I completely lost track of what was reflected/refracted/visible where and what reflection is showing what diffuse HDRI... (taking a breath) So. Hopefully, that gives you an idea about the possibilities here...

Oh, did I mention that all of those maps can be fully procedurally generated OSL 'light studios'? Yup.

Usage:
Here Raytype OSL is used to control the 'Amount' value of MixTexture. Depending on what type of ray hits the Env. map, MixTexture will show one HDR map or the other.

Here's a quick demo.


C4D file:
RaytypeEnvironmentC4D.zip
(3.65 MiB) Downloaded 401 times

ORBX:
RaytypeEnvironment.orbx
(3.8 MiB) Downloaded 362 times


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

Re: OSL | Raytype = Magic

Postby Studio21 » Tue Nov 20, 2018 7:34 am

Studio21 Tue Nov 20, 2018 7:34 am
Thats awesome! thx millan!
Studio21
Licensed Customer
Licensed Customer
 
Posts: 212
Joined: Wed Nov 16, 2016 11:14 am

Re: OSL | Raytype = Magic

Postby frankmci » Tue Nov 20, 2018 11:08 pm

frankmci Tue Nov 20, 2018 11:08 pm
Milan, the things you do make my head hurt, but in a good way. :)

It's too bad we can't see Environmental texture node networks in the Node Editor. Am I reading the youtube vid correctly, in that you are doing the equivalent of this? I've applied it as a full material to some geometry as a more tangible implementation of the Octane Sky object in hopes of getting a more intuitive understanding of what's going on.

Thanks again for sharing your experiments in OSL.
Attachments
Screen Shot 2018-11-20 at 5.59.38 PM.png
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 821
Joined: Fri May 26, 2017 2:00 pm

Re: OSL | Raytype = Magic

Postby milanm » Wed Nov 21, 2018 8:44 am

milanm Wed Nov 21, 2018 8:44 am
frankmci wrote:It's too bad we can't see Environmental texture node networks in the Node Editor


Amen to that. :roll:

Sorry about the headache! Yes, that's exactly the setup I used in the video, If we pretend that the purple emission node is the environment texture input, of course.

My setup is actually more complicated than it should be but I did it that way for three reasons:

  • To better show how this works in Live Viewer.
  • To show that, no matter how complex/simple the node setup is, it is just a click away once you save it in the content browser.
  • To show that complex setups can be used there instead of just HDR maps.

Edit: Using OSL directly instead of MixTexture should work (and it works just fine in the Standalone) but after doing some more testing, it seams there might be a corner case where it might cause a cuda crash in C4D so it's best to use the setup as it is in the video and the node graph in the post above.

Also, it would be interesting to try this setup on emissive geometry and combine that with light include/exclude in V4. I didn't test that yet but it should work in theory.

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

Re: OSL | Raytype = Magic

Postby KeeWe » Wed Nov 21, 2018 12:24 pm

KeeWe Wed Nov 21, 2018 12:24 pm
I wonder if all this OSL stuff make it one time into the renderer itself to give us a standardized workflow and UID.

Obviously theres so much potential in OSL but to fully utilize it as a designer, for me it has to be build in.

In this particular cas it would be awesome to simply have one sky object with several HDRi slots right away.
6850k // 32 GB // 1080, 1080 Ti, 2080 Ti // Win 10 // C4D 19.068
User avatar
KeeWe
Licensed Customer
Licensed Customer
 
Posts: 279
Joined: Wed Nov 27, 2013 11:32 am

Re: OSL | Raytype = Magic

Postby Kalua » Sat Jan 12, 2019 7:00 pm

Kalua Sat Jan 12, 2019 7:00 pm
This script is really good! But I noticed is not working properly in V 2018.1
Anyone could confirm a weird behavior and perhaps upgrade it's code?
Cheers!
C4D 25.117 Octane 2022.1.2 R4, <<2 X 3090 + NVlink>>, Windows 10, X399, AMD TR 1950X, 128 GB RAM, NVIDIA SD 536.67
https://www.behance.net/PaperArchitect
Kalua
Licensed Customer
Licensed Customer
 
Posts: 481
Joined: Fri Oct 11, 2013 2:13 am
Location: Caribbean Sea

Re: OSL | Raytype = Magic

Postby amitvb89 » Wed Dec 08, 2021 5:59 am

amitvb89 Wed Dec 08, 2021 5:59 am
This script has stop working in octane 2021.1-R4 update for CINEMA 4D, can someone help me with this?
amitvb89
Licensed Customer
Licensed Customer
 
Posts: 7
Joined: Fri Feb 19, 2021 9:01 am
Previous

Return to Help / Tutorials


Who is online

Users browsing this forum: No registered users and 6 guests

Thu Apr 18, 2024 1:42 pm [ UTC ]