Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => Topic started by: Petros Proestos on 2021-07-16, 18:32:13

Title: Two OSL that corona dont recognize
Post by: Petros Proestos on 2021-07-16, 18:32:13
Ok I edit my message again.
I attach two very useful OSL I have.
One that creates any kind of tiling shape,
circles, triangles, squares ecc depending
of the sides value we enter.
Useful as opacity map.

The other creates triangles, one near the other.
Useful for creating vinyl floors ecc..

Can somebody test them and tell me why
they dont work in corona?
They work in 3ds max physical material.
Where is the Po value, a OSL UVW map
has to be assigned.

thx.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Bormax on 2021-07-21, 09:17:31
Hi
Max 2021.3
OSL Shapes works fine with any renderer/material
OSL Triangles doesn't work with any renderer/material. Actually UVW-mapping doesn't work at all on rendered pictures, in viewport everything looks fine.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Petros Proestos on 2021-07-21, 11:51:17
Bormax thx for the reply.

I am an ex arnold user.
I am using 3ds max 2022.1 and Corona 7 (RC 7)
They are working fine with the general Physical Material,
when I assign arnold renderer.

So:

For being able to see triangles.osl you have
to create this nodes:

Assign arnold renderer.
In the Physical Material->Base Color Map
attach to the "Out", the OSL Switchers 1 of N (color)
attach to the "Index", the OSL Switchers Random index by number/color
attach to the "Input Color", the OSL triangles.osl
attach to the "Po", the OSL UVW Transform

For shapes.osl just plug it in
Physical Material->Base Color Map and
attach to the "Po", the OSL UVW Transform

Unfortunately none of these procedures
I am able to see, neither in viewport,
either in material editor, neither
in IRwith Corona Physical Material.

Maybe is something wrong with my installations?
Can you test it please?
I attach also the scene
thank you.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Bormax on 2021-07-21, 12:26:50

I am using 3ds max 2022.1 and Corona 7 (RC 7)


Ok, but I have Max 2021.3 and can't open your scene. Please, save it as Max 2021 and I'll test it
Title: Re: Two very useful OSL that corona dont recognize
Post by: Petros Proestos on 2021-07-21, 12:39:03
Yes you're right. 🙂
I apologize...
Here it is.
thx again.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Bormax on 2021-07-21, 12:59:54
No problem.

This is what I've got. Is it correct result?

Max 2021.3 Corona7 RC7

Edit: just noticed that your renders from Arnold are the same :)
Title: Re: Two very useful OSL that corona dont recognize
Post by: pokoy on 2021-07-21, 13:01:47
Petros, when you say they work fine in Arnold - Arnold has its own OSL implementation. In order to use the 3ds max specific implementation you need to enable '3ds max maps support' in the compatibility tab in Arnold's renderer properties. If it's set to 3ds max and fails, then it's on the max side of things and it probably doesn't properly translate the maps to the renderer.
This compatibility mode switch only applies to Arnold, all other renderers will use the 3ds max implementation.

In other words - if it works in Scanline, it *should* work in Corona.
If it works in Arnold only, then it's because OSL in max in general does something different.

So if it works in Arnold but fails in Scanline you might consider submitting this as a bug to Autodesk.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Petros Proestos on 2021-07-21, 14:00:03
@Bormax
Bormax, those two renders you did them with corona?
Can you send me please the file with what you modified please?
**Edit: Hmm as I understand it worked in 3ds max 2021 and not in 2022?**

@Pokoy
If Autodesk/Arnold creates osl that work only with their
renderers... alright I delete them.
And yes I will post the bug to Autodesk forum.

Thank you both for answer me.
I am in the transition phase from arnold->corona and
that's the reason for my questions.

Thanks again.
Title: Re: Two very useful OSL that corona dont recognize
Post by: Bormax on 2021-07-21, 14:41:56

Can you send me please the file with what you modified please?
**Edit: Hmm as I understand it worked in 3ds max 2021 and not in 2022?**


I didn't change anything in your scene, just assigned materials and pressed render.
And yes, it was Max 2021.3, Corona7 RC7

You are welcome!
Title: Re: Two OSL that corona dont recognize
Post by: pokoy on 2021-07-21, 15:25:59
If it works in 2021 and not in 2022, I'd make sure this also happens in Scanline.
Then, strip Corona renderer maps etc from the scene, and submit to Autodesk.
Title: Re: Two OSL that corona dont recognize
Post by: Petros Proestos on 2021-07-21, 16:07:29
Done!

https://forums.autodesk.com/t5/3ds-max-forum/osl-that-worked-in-2021-3-dont-work-in-2022-1-with-corona/td-p/10485144
Title: Re: Two OSL that corona dont recognize
Post by: pokoy on 2021-07-21, 16:10:25
Just tested.

It's not a 3dsmax problem, and it really is weird.
Scanline works in 2021 and 2022 without difference - but in 2022, after installing Corona, Scanline won't render it anymore.
Corona wouldn't either but after switching to Scanline and back to Corona it will... I have no idea what is going on here.

Generally though, all Corona materials - Legacy and Physical - will not display OSL correctly in the viewport, UVs will be shifted. They will render exactly like Scanline, but for some reason not display correctly in the viewports. I think this was the case before v7 already, not sure.

I'd contact support with this problem, and see if they can find out what the root of both problems is.
Title: Re: Two OSL that corona dont recognize
Post by: junchien on 2021-08-01, 16:09:29
Could this be the reason for the cache? When using OSL, my colleague will also have the reason that there is no render result and the map cannot be read. Later in path C:\USERS\USERSNAME\appdata\local\autodesk\3dsmax\ your Max version \ your country version \ your language version \Plugcfg\OSLcahce

Deleting all the cache files in it will render normally. This is a strange problem and seems to be 3DSmax
Title: Re: Two OSL that corona dont recognize
Post by: Petros Proestos on 2021-08-01, 16:57:36
Thanks for the reply junchien.
Nope still the same.

But all other OSL that come with 3ds max
they work flawless with corona.
Only those two they dont work and for the
record,  they have been made especially for me once
by a talented programmer who uses arnold...

Maybe I will re-install 3ds max again...
Title: Re: Two OSL that corona dont recognize
Post by: junchien on 2021-08-02, 08:34:42
In this directory C:\Program Files\Autodesk\3ds Max 2021\Plugins did you try to fix the problem with NVIDIA? It seems to have something to do with Arnold

Here's an example of that
https://knowledge.autodesk.com/support/3ds-max/troubleshooting/caas/sfdcarticles/sfdcarticles/3ds-Max-Mental-Ray-Missing-Dlls-warning-appears-when-opening-the-program-or-scene-files.html
Title: Re: Two OSL that corona dont recognize
Post by: Petros Proestos on 2021-08-02, 13:16:21
Junchien, as you read before there
is no problem with 3ds max 2021.

With 2022 something is wrong.
I have 3ds max 2022 student version, original.

Title: Re: Two OSL that corona dont recognize
Post by: dmitry_dmitryev on 2021-11-22, 02:36:16
I have same bug in 3ds max 2022 and corona 7