Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: Monkeybrother on 2018-04-19, 12:37:12

Title: Exterior windows OSL shader
Post by: Monkeybrother on 2018-04-19, 12:37:12
Hi. Anyone here proficient in OSL? Maybe someone could convert this to work with Corona?, it would be an incredible time saver. I tried myself, but no luck.
https://lesterbanks.com/2017/10/free-windowbox-shader-map-interiors/
Title: Re: Exterior windows OSL shader
Post by: danio1011 on 2018-04-19, 19:45:13
That looks amazing and would be a huge help...
Title: Re: Exterior windows OSL shader
Post by: pokoy on 2018-04-19, 21:12:47
Did you try in max 2019 and it doesn't work with Corona or is this a general request? If a request, have a look here, OSL shader for max 2019: http://forums.cgsociety.org/showthread.php?p=8390295#post8390295 (http://forums.cgsociety.org/showthread.php?p=8390295#post8390295)
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2018-04-20, 07:25:01
Did you try in max 2019 and it doesn't work with Corona or is this a general request? If a request, have a look here, OSL shader for max 2019: http://forums.cgsociety.org/showthread.php?p=8390295#post8390295 (http://forums.cgsociety.org/showthread.php?p=8390295#post8390295)

That's the one I tried, and linked to. It comes with versions for Blender, Arnold and VRay, but none of them do anything in Corona.
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2018-04-20, 07:26:09
That looks amazing and would be a huge help...

Yes, it would save so much work for exterior shots.
Title: Re: Exterior windows OSL shader
Post by: Philip kelly on 2018-04-20, 08:29:03
would be very handy.
Title: Re: Exterior windows OSL shader
Post by: STHA on 2018-05-03, 13:29:11
Has anyone managed to use the OSL shaders in Max2019?.

It seems the compiled 2019 berconmaps keeps crashing , so I just managed to get the OSL noise working, but it only works in the displacement of corona mtl and not the bump?.

Sounds way too technical for me, even after watching Zaps tutorials.

Anyone have a solution it would be appreciated. Thanks.
Title: Re: Exterior windows OSL shader
Post by: pokoy on 2018-05-03, 13:43:54
Check if you need to increase the bump amount. I remember OSL bump output was *very* weak for some reason, I thought it was fixed but maybe not.

Also, if you only need the noises form BerconMaps, try the free Siger Noise map, it's based on Bercon and gets actively updated/recompiled:
https://www.sigerstudio.eu/sigertexmaps-sigernoise/ (https://www.sigerstudio.eu/sigertexmaps-sigernoise/)
Title: Re: Exterior windows OSL shader
Post by: STHA on 2018-05-03, 14:07:47
Yes, I tried pushing the bump to the maximum and it doesnt work. Strange.

I forgot about sigernoise, but currently it is only upto 2018. I guess I will have to wait once he has recompiled.

Thanks.
Title: Re: Exterior windows OSL shader
Post by: pokoy on 2018-05-03, 14:31:15
Yes, I tried pushing the bump to the maximum and it doesnt work. Strange.

I forgot about sigernoise, but currently it is only upto 2018. I guess I will have to wait once he has recompiled.

Thanks.
I thought the 2019 were available already, sorry.

Can you save out a simple scene with the OSL noise where bump doesn't work? I'd like to inspect and have someone look at it.
Title: Re: Exterior windows OSL shader
Post by: STHA on 2018-05-03, 15:01:46
sorry, I deleted the file as it was just a test. I recreated it.

Scene is Just a sphere, with two lights.

Here are some screen grabs.
Max 2019
Corona 1.7 (4)

(http://)
Title: Re: Exterior windows OSL shader
Post by: romullus on 2018-05-03, 15:07:09
Did you try to plug it trough CoronaBumpConverter map? Would that help?
Title: Re: Exterior windows OSL shader
Post by: STHA on 2018-05-03, 15:45:58
Yes, that seems to have solved the problem.

Thanks Romullus.
Title: Re: Exterior windows OSL shader
Post by: pokoy on 2018-05-03, 16:07:42
Ok, some thoughts - I've tested all noises and they worked (in beta), only OSL bump output was very weak, not only for Corona but for all renderers. When I tested after 2019 release the bump output was stronger, so that was probably fixed.

In your case, the 3D OSL noise should work as this one works in object space - please test this one.

The OSL noise you're using is 2D, so you may have to define the mapping by connecting an OSL UVW node to the UVW slot of the 2D noise. See if that works without the BumpConverter.
Then again, OSL defaults to map channel 1 if no UVW input is defined so it should have worked since the sphere primitive defines UVs for channel 1 by default as well. So not sure why it didn't work for bump while it works for displacement... Still, try with a UVW node in the OSL noise UVW slot and see if that helps.
Title: Re: Exterior windows OSL shader
Post by: STHA on 2018-05-03, 17:11:13
No, it does not work.

I tried both Noise and Noise 3D. without bumpconvertor there is no reaction.

OSL - Named Coord Space reacts with displacement and so does UvWrowoffset when plugged in with Named Coord Space.

Thanks.

Title: Re: Exterior windows OSL shader
Post by: pokoy on 2018-05-03, 18:28:22
Ah well, it definitely worked before with Corona. Wonder what happened in between. I guess it works with Scanline/Arnold... will need to test that for myself. Thanks!
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2018-05-14, 11:29:10
I got it working enough to be usable. You need to make some very minor changes to the VRay version to make it work in Corona: remove the first line and go through the code and remove references to VRay. If anyone wants it, I can upload the modified file later.

The attached image is a bunch of instanced planes with a Corona Multimap randomizing the diffuse bitmap.
Title: Re: Exterior windows OSL shader
Post by: NicolasC on 2018-05-14, 11:34:53
Amazing, Monkeybrother ! I'm definitely interested in testing your modified file, please :)

Regards.
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2018-05-14, 14:18:19
Amazing, Monkeybrother ! I'm definitely interested in testing your modified file, please :)

Regards.

Sure, attaching .osl file. It seems to be a bit sensitive, as in you have to do things the right way. If I made a big subdivided box and added a "per face" uvw map, it doesn't work (even if I unwelded vertices or even detached every face), and if I resize the polygon after applying the uv map it stretches and bends (it shouldn't happen, but I haven't investigated). So for best result: create a plane with the correct size, apply material and uv's ("per face" or "planar"), instance it. I've just done some quick tests, so I'm sure there's an explanation.

I'm not 100% sure that the attached file is the latest one, the one I'm using, but let me know if it doesn't work. Hopefully someone can make a less hacky version.
Title: Re: Exterior windows OSL shader
Post by: NicolasC on 2018-05-14, 15:05:11
Thank you ! I'll give it a try as soon as I my current project is over ;)
Title: Re: Exterior windows OSL shader
Post by: Christa Noel on 2018-05-15, 14:27:20
hi, is there any way to make older max compatible with osl? something like plugins??
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2018-05-15, 14:54:56
hi, is there any way to make older max compatible with osl? something like plugins??

I don't think so, it was the only big update in Max 2019 (if you don't like 90's looking procedural wood).
Title: Re: Exterior windows OSL shader
Post by: demkin on 2019-09-10, 13:43:52
I got it working enough to be usable. You need to make some very minor changes to the VRay version to make it work in Corona: remove the first line and go through the code and remove references to VRay. If anyone wants it, I can upload the modified file later.

The attached image is a bunch of instanced planes with a Corona Multimap randomizing the diffuse bitmap.

So, what should the material look like in the coronarendor so that the OSL would work
Title: Re: Exterior windows OSL shader
Post by: danio1011 on 2019-10-09, 06:57:54
I realize this thread is a little old but I'm hoping to make this work.  I downloaded the OSL and plugged it into the diffuse slot on a Corona material and got an error.  I notice the OSL file still has a number of references to VRay in it.  Has anyone had any luck here?  I'll keep tweaking in the meantime...

Thanks!
Daniel
Title: Re: Exterior windows OSL shader
Post by: burnin on 2019-10-09, 13:18:20
Fun fact: Corona doesn't support OSL. ;)

Check forum posts:

support OSL (https://forum.corona-renderer.com/index.php?topic=3568.msg25944#msg25944)
Ondra: "lets close this until corona goes VFX way"

Better OSL Support for 3dsmax 2019 (https://forum.corona-renderer.com/index.php?topic=20128.msg125490#msg125490)
Ondra: "Hi,
there is no OSL API for 3dsmax 2019 published. We (and any other renderer) have no way to support the required trace() call other than doing OSL support from scratch, independently from Autodesk, and just using its UI. Same thing with fluids - no API, means we cannot support it"

Title: Re: Exterior windows OSL shader
Post by: danio1011 on 2019-10-09, 17:14:50
Fun fact: Corona doesn't support OSL. ;)

Check forum posts:

support OSL (https://forum.corona-renderer.com/index.php?topic=3568.msg25944#msg25944)
Ondra: "lets close this until corona goes VFX way"

Better OSL Support for 3dsmax 2019 (https://forum.corona-renderer.com/index.php?topic=20128.msg125490#msg125490)
Ondra: "Hi,
there is no OSL API for 3dsmax 2019 published. We (and any other renderer) have no way to support the required trace() call other than doing OSL support from scratch, independently from Autodesk, and just using its UI. Same thing with fluids - no API, means we cannot support it"


Are you sure that info is still valid?  Aside from Monkeybrother's screenshot showing it working in Corona I'm able to render out some of the stock OSL maps in Max 2020 (checker, candy, etc.)  I might be wrong but it seems like it's working to me.  It's just the Window OSL that is kicking an error.

Thanks,
Daniel
Title: Re: Exterior windows OSL shader
Post by: burnin on 2019-10-09, 20:04:30
Indeed, I'm wrong.

Quote
OSL works in any renderer supporting the regular 3ds Max shading API (Scanline, vRay, Corona, etc.). It also works outside of renderers, anywhere in 3ds Max where a regular map is requested, such as in the Displacement modifier.
(source) (https://knowledge.autodesk.com/support/3ds-max/getting-started/caas/CloudHelp/cloudhelp/2019/ENU/3DSMax-Lighting-Shading/files/GUID-568DA829-62DA-432F-814F-2600F65141BD-htm.html)

My bad.
Title: Re: Exterior windows OSL shader
Post by: Monkeybrother on 2019-10-09, 22:36:39
I forgot about this post. I've been away from Max/Corona for a while, but if I update it (before someone else does it), I'll post the file and an example scene.
Title: Re: Exterior windows OSL shader
Post by: danio1011 on 2019-10-10, 03:31:28
I forgot about this post. I've been away from Max/Corona for a while, but if I update it (before someone else does it), I'll post the file and an example scene.

Oh, great!  Thank you!!
Title: Re: Exterior windows OSL shader
Post by: peterguthrie on 2019-11-06, 12:08:31
anyone managed to get this working?
Title: Re: Exterior windows OSL shader
Post by: sprayer on 2019-11-06, 14:05:46
anyone managed to get this working?
Here working scene in corona
https://we.tl/t-BDu28lchBs

place before OSL file in C:\Program Files\Autodesk\3ds Max 20xx\OSL
Title: Re: Exterior windows OSL shader
Post by: artmaknev on 2019-12-17, 16:06:35
Do you still have that link? would be helpful!
Thanks,
Title: Re: Exterior windows OSL shader
Post by: artmaknev on 2021-03-12, 20:43:35
Hello guys,

Well, I have been obsessed with parallax for the past year, and finally got some nice results. 

Will have more info soon :)


(https://media.giphy.com/media/TPpz3OMmFbK3FetuVf/giphy.gif)


Title: Re: Exterior windows OSL shader
Post by: NicolasC on 2021-03-13, 15:04:56
Wow !! nice result, artmaknev :)
So you managed to get it working with Corona ? pretty interested in that stuff ;)
Title: Re: Exterior windows OSL shader
Post by: artmaknev on 2021-03-13, 16:34:50
hi NicolasC, yes it works for corona, I am putting together a free scene and will share it here in couple of days.

glad you like it :)
Title: Re: Exterior windows OSL shader
Post by: dfcorona on 2021-03-13, 21:00:15
That's great, I couldn't get it working.
Title: Re: Exterior windows OSL shader
Post by: NicolasC on 2021-03-14, 11:49:55
hi NicolasC, yes it works for corona, I am putting together a free scene and will share it here in couple of days.

glad you like it :)
Amazing ! vey kind from you, I can't wait ;)

Regards.
Title: Re: Exterior windows OSL shader
Post by: Mohammadreza Mohseni on 2021-03-14, 16:38:34
a little play with it. I will have so much fun with it.

Title: Re: Exterior windows OSL shader
Post by: artmaknev on 2021-03-15, 21:50:53
Hi all, here is the free scene!

https://gum.co/YyRmU

It is part of wParallax.com you can check it out :D

Enjoy!
Title: Re: Exterior windows OSL shader
Post by: NicolasC on 2021-03-16, 09:46:12
You rule !
Thanks a lot for sharing, artmaknev :)