Author Topic: Daily Builds 1.7  (Read 166661 times)

2017-07-07, 09:13:28
Reply #165

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
I've dug around some more, and it seems that the Photoshop (which everyone hates when it comes to handling EXR alpha) is only mainstream image processing software out there that expect straight instead of premultiplied alpha. All the other mainstream packages, such as Nuke, Fusion, Resolve, and so on, expect Alpha to be premultiplied - which output from 3ds Max indeed seems to be.

2017-07-07, 11:14:47
Reply #166

mike288

  • Former Corona Team Member
  • Active Users
  • **
  • Posts: 353
  • Michal 'Mike' Wirth
    • View Profile
Whew... false alarm then... I was scared to death by a thought that Corona in Max would stop saving EXRs with premultiplied alpha.

Nothing has changed there. Saving to non-CXR formats in VFB is being done by Max.

But notice that it DOES NOT premultiply by alpha (and IMHO it never did). One can easily try it: render a scene, inspect some pixel having alpha between 0.0 and 1.0 with VFB's pixel probe, take the tone mapped float red value, and power it to 2.2. You will get a value of a red component in that pixel after saving to EXR (you can inspect it with CIE, for instance). If you further multiply it with that pixel's alpha (which what the premultiplication is), you will get a different value than Max has stored. That implies Max does not premultiply. And yes, CIE in the "original" column shows truly saved values for just opened EXRs.

Anyway, I still think you got it upside down. If it works like in 3ds Max, then it does store images with premultiplied alpha, not without it. Even official 3ds Max documentation says so: https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/3DSMax/files/GUID-E49782BE-6486-4B9D-929A-7A02535F1829-htm.html

Yes, I know that article. IMHO it is a lie because they do not do it, as far as I can tell.

And images outputted from 3ds Max indeed have correct alpha when loaded into compositing packages, just like images from any other software that use premultiplied alpha.

Premultiplied alpha is not about the alpha channel itself. Premultiplication means "take red/green/blue and multiply it by alpha, then store results + the alpha itself". Nothing more. It changes colors and the loading software must be aware of this and handle it properly. The difficulty is that from an image you cannot tell whether it has been saved premultiplied or not. That is why image formats define it - like EXR, the standard expects its data to be premultiplied. But nobody seems to follow it. We have decided to ignore it too - in our custom saving handler, used in CIE or Standalone, because of the others. The premultiplication brings more troubles with actually zero benefits, see below.

Afaik it is not an optimization, but a means of ensuring that images with alpha channel compose on top of each other correctly in post.

It is, as you can see from the above described principle - one can do it any time later. So any composing software can do it while it is actually composing. Technically, it is not required to do by every image producer.

The premultiplication is just a trick how avoid one multiplication per pixel while composing images on top of each other. It is an often done thing and in old times it made sense to save the data already premultiplied so it wouldn't need to be done every time using the image. But with performance of today's computers, plus/minus one multiplication per pixel makes no difference. On the contrary, the premultiplication brings troubles and misunderstandings like this. Unfortunately, EXR authors have decided to stick to the old times in this. I don't know why and from my perspective it was wrong.
« Last Edit: 2017-07-07, 11:24:12 by mike288 »
Chaos Scatter developer | In case of crash, please send minidump | Private uploader: https://corona-renderer.com/upload

2017-07-07, 11:21:43
Reply #167

mike288

  • Former Corona Team Member
  • Active Users
  • **
  • Posts: 353
  • Michal 'Mike' Wirth
    • View Profile
I've dug around some more, and it seems that the Photoshop (which everyone hates when it comes to handling EXR alpha) is only mainstream image processing software out there that expect straight instead of premultiplied alpha. All the other mainstream packages, such as Nuke, Fusion, Resolve, and so on, expect Alpha to be premultiplied - which output from 3ds Max indeed seems to be.

If you are OK with outputs of 3ds Max, you will be satisfied with outputs of the editor and standalone. The point of the change was to make it the same way as in Max. We hesitated because it goes against the standard, but we had to do it to be compatible with other (wrong) implementations.
Chaos Scatter developer | In case of crash, please send minidump | Private uploader: https://corona-renderer.com/upload

2017-07-07, 11:23:13
Reply #168

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
There's been actually one very well known thread where adobe engineer fought many folks from high end vfx houses about the multiplication of alpha:
https://forums.adobe.com/thread/369637

It's very interesting 5 pages of reading with points of view from both camps.

Non the less, I think I've found out cause of all the confusion and misunderstanding. The post by Master Zap from the thread in the link above sums it up I think:

Quote
The error here is that Chris is interpreting the word "premultiplied" literally. Many people do, incorrectly. I really hate the word, actually, because it leads you to believe it's literal meaning, that something has been multiplied with something "before" (i.e. "pre" something).

THAT IS WRONG. It is a total misrepresentation of what "premultiplied" means.

I don't know what a better word would be, but it's meaning is "dont' multiply the color-channels with alpha".

I.e. in non-premultiplied (aka "straight" alpha), a compositing operation would be

r = fg * fg.alpha + bg * (1 - fg.alpha)

And in "pre multiplied" the compositing math is

r = fg + bg * (1 - fg.alpha)

Notice the lack of a multiplicatoin on the fg? This is what lead the people to name this to say it is "pre multiplied". It isn't, really. It just means IT HAS THE PROPER RGB DATA TO BE ADDED TO THE MATTED BACKGROUND. This is *****NOT****** and I repeat * N * O * T * the same as "having already premultipled it with alpha"

Because this is a completely legal premultipled RGB color (1.0,1.0,0.0,0.0).

This is 100% transparent luminiscent yellow.

When composited properly, according to r = fg + bg * (1 - fg.alpha) it ends up ADDING yellow on top of the (unmodified) background. This is a very common workflow that renderers output such channels.

The whole idea that for a zero alpha, RGB data is always zero (or can legally be thrown away) is WRONG. It is a complete misinterpretation of the concept of "premultipled" alpha. It is a total misunderstanding, going so far as some documents claiming this "illegal" completely erroneously.

(For street cred of my position, since that seems necessary here, I had this discussion with Alvy Ray Smith, the guy who *invented* the Alpha channel, and he agrees with me on this).

/Z

So everything is fine, it's just confusing empirical terminology I guess :) Even Autodesk folks themselves seem to have been misled by the wrong interpretation of the term, and so did we, users:)

2017-07-07, 12:11:57
Reply #169

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
*shrug* This is why we cannot have nice things. Let's just change the changelog to "made compatible with 3ds max"
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2017-07-07, 12:57:14
Reply #170

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
So everything is fine, it's just confusing empirical terminology I guess :)
So, even computer graphics has its alternative truth then ;)
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2017-07-07, 13:34:40
Reply #171

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
So everything is fine, it's just confusing empirical terminology I guess :)
So, even computer graphics has its alternative truth then ;)


2017-07-10, 02:33:29
Reply #172

SoniKalien

  • Active Users
  • **
  • Posts: 31
    • View Profile
How do we apply the CoronaHairMtl? For example, I have a camferbox in max 2017, uv unwrapped. I apply a HairFur WSM to it.

I cannot get the hairs to change colour at all - they render with the default brown. Apllied (any) material to cmferbox only changes the box material. Also tried setting to render MrPrims with the coronahairmtl in the mrshader box and as expected didnt work. Render as gemotry has no effect. Changing colours in the HairFur settings box also has no effect...

2017-07-10, 10:26:11
Reply #173

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8778
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Currently Hair material can't be adjusted when working with H&F. We have to wait and pray for proper support.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-07-10, 10:32:29
Reply #174

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
done
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2017-07-10, 10:34:28
Reply #175

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8778
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2017-07-10, 16:06:55
Reply #176

Christa Noel

  • Active Users
  • **
  • Posts: 911
  • God bless us everyone
    • View Profile
    • dionch.studio

2017-07-10, 18:44:58
Reply #177

Lomarx

  • Active Users
  • **
  • Posts: 9
    • View Profile
Hi all,
I made animated grass with forest pack (5.4.0) and I used random samples to offset the animation of the 4 source objects (I add an animated blend modifier).
In viewport I see the animation with offset but on render Corona didn't see the random samples option and the objects moves all at the same time.

I use 3ds max 2018 update 1, Corona 1.7 DailyBuild Jul 4

Lomarx

2017-07-11, 00:10:27
Reply #178

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2017-07-11, 00:51:51
Reply #179

SoniKalien

  • Active Users
  • **
  • Posts: 31
    • View Profile
Awesome, thanks Ondra. Now I can has my fluffy dice at last :D