Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Bug Reporting => [Max] Resolved Bugs => Topic started by: chopmeister on 2018-09-01, 22:42:42

Title: Corona can't interpret OSL 'screen' space properly
Post by: chopmeister on 2018-09-01, 22:42:42
So, in 3dsmax 2019 (obviously) when you're using OSL shaders, you have several spaces available such as 'raster', 'world', 'object' and 'screen'.

I was trying to write a shader which maps an image from edge to edge in screen space and couldn't seem to do it, until I tried a different renderer and realized my shader was good all along, and it was Corona mishandling it.

To reproduce: Plug a named space node into a bitmap lookup, and set the space to 'screen'. Plug the bitmap into any kind of material and render with Corona VS any other renderer. I tested Arnold, Scanline and Vray, which all render it correctly.

Test video with Arnold:

https://drive.google.com/open?id=11prmlt8SAwfL0-S5S4K41saW4pUlp2jg

Test with Corona:

https://drive.google.com/open?id=1naitThKPvlPSSk6R1mwUES0gwxZ6bRfv
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2018-09-04, 16:59:03
Thanks for a nice report. We will try to reproduce this, and will get back to you if we need some help (personally I haven't touched OSL yet...).
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: chopmeister on 2018-09-04, 17:12:28
Any time. :) I have a suspicion that anything coming from an OSL map doesn't work in a CoronaMtl bump slot either, but I gotta test this some more and see if it may be easily circumvented somehow.
 
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2018-09-05, 13:10:13
Reproduced the 1st issue with screen mapping.
If you can confirm the 2nd one with bump maps, please let us know, and then we will look into it.
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: pokoy on 2018-09-05, 13:46:38
Any time. :) I have a suspicion that anything coming from an OSL map doesn't work in a CoronaMtl bump slot either, but I gotta test this some more and see if it may be easily circumvented somehow.
Bump should work in general, I've tested this. At some point OSL bump was way weaker than other standard maps, so you may have to crank up bump to see it. then again, I couldn't see it happen later when 2019 was rolled out.
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2018-09-05, 16:08:09
Maybe CoronaBumpConverter can help?
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: chopmeister on 2018-09-05, 16:30:13
So... By default something IS wrong with the bump. It works with BumpConverter though.

This is just a sphere with the default OSL_Rivets shader, with the Bump output plugged into the material's bump slot.
(Never mind the lighting differences, couldn't be bothered so rendered Arnold with default lights... :P )
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2018-09-05, 17:09:23
Good to know there is at least workaround. :)
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: romullus on 2018-09-05, 17:36:34
Looks like yet another case where autodesk releases shaders that works only with their integrated renderer. How typical.
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: chopmeister on 2018-09-05, 17:39:20
Well... It does work with Vray. And even with other plugins with pluggable maps like ForestPack. So I wouldn't just outright assume it's an ADSK problem by default. :)
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2018-11-22, 16:05:49
Fixed internally, unfortunately it won't make it to V3. Will be there in V4 dailies and final.
Title: Re: Corona can't interpret OSL 'screen' space properly
Post by: maru on 2019-01-08, 14:07:11
The fix is available in the newest daily build (https://coronarenderer.freshdesk.com/support/solutions/articles/5000570015) and will be also a part of Corona Renderer 4.