Author Topic: Two OSL that corona dont recognize  (Read 4810 times)

2021-07-16, 18:32:13

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos
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.
« Last Edit: 2021-07-21, 14:00:19 by Petros Proestos »
If you can't explain it simply, you don't understand it well enough. Albert Einstein

2021-07-21, 09:17:31
Reply #1

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
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.
« Last Edit: 2021-07-21, 09:21:36 by Bormax »

2021-07-21, 11:51:17
Reply #2

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos
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.
« Last Edit: 2021-07-21, 12:10:59 by pproestos »
If you can't explain it simply, you don't understand it well enough. Albert Einstein

2021-07-21, 12:26:50
Reply #3

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile

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

2021-07-21, 12:39:03
Reply #4

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos
Yes you're right. 🙂
I apologize...
Here it is.
thx again.
If you can't explain it simply, you don't understand it well enough. Albert Einstein

2021-07-21, 12:59:54
Reply #5

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
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 :)
« Last Edit: 2021-07-21, 13:05:07 by Bormax »

2021-07-21, 13:01:47
Reply #6

pokoy

  • Active Users
  • **
  • Posts: 1844
    • View Profile
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.

2021-07-21, 14:00:03
Reply #7

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos
@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.
« Last Edit: 2021-07-21, 14:30:03 by Petros Proestos »
If you can't explain it simply, you don't understand it well enough. Albert Einstein

2021-07-21, 14:41:56
Reply #8

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile

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!

2021-07-21, 15:25:59
Reply #9

pokoy

  • Active Users
  • **
  • Posts: 1844
    • View Profile
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.

2021-07-21, 16:07:29
Reply #10

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos

2021-07-21, 16:10:25
Reply #11

pokoy

  • Active Users
  • **
  • Posts: 1844
    • View Profile
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.
« Last Edit: 2021-07-21, 16:25:02 by pokoy »

2021-08-01, 16:09:29
Reply #12

junchien

  • Active Users
  • **
  • Posts: 18
    • View Profile
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

2021-08-01, 16:57:36
Reply #13

Petros Proestos

  • Active Users
  • **
  • Posts: 19
    • View Profile
    • Petros Proestos
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...
« Last Edit: 2021-08-01, 17:24:30 by Petros Proestos »
If you can't explain it simply, you don't understand it well enough. Albert Einstein

2021-08-02, 08:34:42
Reply #14

junchien

  • Active Users
  • **
  • Posts: 18
    • View Profile
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