Author Topic: Sky opacity?  (Read 4131 times)

2013-10-22, 12:22:30

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12754
  • Marcin
    • View Profile
Sky map is semi-transparent when saving as .exr with alpha.
Not sure if bug or feature. If feature, than please explain what's the point of this.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2013-10-22, 14:01:12
Reply #1

Captain Obvious

  • Active Users
  • **
  • Posts: 167
    • View Profile
That looks right to me. The alpha is obviously zero when showing the environment, and Corona premultiplies against the background rather than against black. To comp it correctly, you'll need to either hide the background from camera rays, or do some trickery in post. What software are you using? If you're using Adobe software, you'll need the ProEXR plugin. If it's Fusion, you should have all the tools to deal with it built-in.

2013-10-22, 16:38:11
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12754
  • Marcin
    • View Profile
It's a screenshot from photoshop. It looks like in VFB when you flatten image or add a white background layer (which produces the same effect).
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2013-10-22, 21:11:09
Reply #3

Captain Obvious

  • Active Users
  • **
  • Posts: 167
    • View Profile
If you want to load OpenEXR files in Photoshop, you'll need ProEXR. Adobe basically don't understand the format, or how to load it properly. Sorry. Either get proper compositing software, or get the plugin. It's only $75.

2013-10-22, 21:51:55
Reply #4

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12754
  • Marcin
    • View Profile
Relax, I was just curious why it works like this. :)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2013-10-23, 09:39:17
Reply #5

Captain Obvious

  • Active Users
  • **
  • Posts: 167
    • View Profile
Well, it's basically because there are two basic ways of dealing with stacking up layers. Photoshop and After Effects want unpremultiplied images. Suppose you have a blue background and you want to add a red circle to it. In Photoshop, the correct way of doing this would be to have an image layer that's red everywhere, and then use the alpha to clip it out. If you have a circle that's red on a black background and has an alpha, then you will get a black fringe. This is what happens in Adobe software. In Nuke and Fusion (and presumably all the other node-based compositors), there's a blending mode called "Over" which basically works the other way around. The red circle is supposed to be red on a black background, and with an alpha channel. If you've got a layer that's red all over and has a circle in the alpha channel, you'll end up *adding* red everywhere even where the alpha is black.


The problem with Adobe software, unfortunately, is that there aren't really any good ways of dealing with this. In Nuke and Fusion, you can use either the "over" blending or a "normal" blending mode same as in Adobe's. And you can do colour math easily to change one thing into another. With Adobe software, you're stuck either using clunky work-arounds or living with ugly borders.

2013-10-23, 11:16:18
Reply #6

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12754
  • Marcin
    • View Profile
Ok, so this means that Corona saves images with alpha 0 for the environment background?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2013-10-23, 11:28:16
Reply #7

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Ok, so this means that Corona saves images with alpha 0 for the environment background?

EXR uses premultiplied alpha, which means, that you take the image you see in VFB, and multiply each pixel by its alpha value. So semi-transparent objects are now darker. This is supposed to save one multiplication operation when compositioning later (instead of foreground*alpha + background*(1-alpha) you do premultipliedForeground + background*(1-alpha), but is in my opinion utter bullshit, because multiplication is extremely fast anyway, and it only unnecessarily complicates things. And you need to do a special case for alpha=0. But, it is in the standard, so it is done anyway (in 3dsmax, corona does not do this).
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)