Author Topic: 01.2022 compositing issues  (Read 10709 times)

2022-01-31, 16:21:49
Reply #15

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12708
  • Marcin
    • View Profile
Another issue from the above posts:

- you render something in Corona against some background

- you want to replace the background or move the object into some other place of the image

- you render a mask of this object, save in 32-bit exr with alpha channel, no post processing, and do other fancy stuff to make sure all is fine

- in the end... OMG BORDERS!


Why?

Because Photoshop is unable to interpret the alpha channel correctly!
Use Fusion (it's free) or other software that is made specifically for compositing. It will handle just fine whatever complex alpha-channel-masked-32-bit-exr you throw at it.



If you are having issues with this - again, please send us sample files (max, exr, other) and let us know how to reproduce your issue. We will look into it.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-01-31, 16:24:30
Reply #16

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
I'll try with fusion later. But yes. With photoshop this is the result:

See below please.
I have two tall boxes. One with physical material and the other with legacy, to discard reflections.
Rendered against an empty background.

I save the image as PNG with alpha included.

In photoshop I add a white background and I can see a darker grey contour.

Edit: I added the Max file

« Last Edit: 2022-01-31, 16:28:30 by lupaz »

2022-01-31, 16:43:52
Reply #17

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
Maru thanks for moving the post here and excuse us for the "contamination" of the Daily 8 one.

Anyway, I remember in the old mental-ray days, to proceed with the compositing video process in Combustion I was saving in TGA format with the Pre-Multiplied Alpha option enable and this defect was gone. Now I don't know how to replicate the same fix in Photoshop as Combustion had a special future for the Alpha channels when they were Pre-Multiplied or not.

2022-01-31, 16:53:01
Reply #18

user116

  • Active Users
  • **
  • Posts: 22
    • View Profile
Hi. Can you please fix this ? This just does not look right.
Needles are opacity cards. When you render them agains bright background they just dissolve and thus the trees lack any volume. It does not matter if the background is HDRI or Corona Sky, does not matter how high you set up Hihlight compression, if you set up Highlight clamping or not.

^This is the message the whole compositing discussion originated from.

This behavior is expected in any renderer, and it also happens in real life.

If a thin or transparent object is against a bright background, its borders will contract.

Yes, you CAN negate that effect by using highlight clamping (see the attached examples, max scene, comparison):
https://corona-renderer.com/comparer/nrPkPH

If you cannot reproduce this in some other renderer or in photography, please post some examples and explanation how you did it.

Yea, sorry for posting in daily thread.
Concerning the topic - sorry but watching some pictures I still think something is off.

Image credits - Wikipedia
The trees sustain their volume. One can also pretty much see the individual needles.
Is there really no way to mitigate this effect without having to resolve to compositing and work freely in WYSIWG using the (awesome) interactive renderer? Highlight clamping is also no solution as the image gets extremally flat.

2022-01-31, 17:08:20
Reply #19

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12708
  • Marcin
    • View Profile
Yea, sorry for posting in daily thread.
Concerning the topic - sorry but watching some pictures I still think something is off.

Image credits - Wikipedia
The trees sustain their volume. One can also pretty much see the individual needles.
Is there really no way to mitigate this effect without having to resolve to compositing and work freely in WYSIWG using the (awesome) interactive renderer? Highlight clamping is also no solution as the image gets extremally flat.

The image you posted is also "extremally flat". The sky is not overexposed so there is no huge contrast difference between the trees and the background.

How about this one?


The tree branches become thinner and thinner up to a point where they are invisible, the brighter the background is.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-01-31, 17:29:38
Reply #20

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
The image you posted is also "extremally flat". The sky is not overexposed so there is no huge contrast difference between the trees and the background.

But Maru, even in this "extremely flat" situation this optical problem is still present. If you go back on page 1 in this thread, there is an example which is very similar to the last posted "flat and natural" photo and the leaves are less visible than same image on a black background.

I think is something it has to do with ho the sampler works on the opacity materials with very fine detail. Maybe I am wrong...

2022-01-31, 17:51:46
Reply #21

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12708
  • Marcin
    • View Profile
I'll try with fusion later. But yes. With photoshop this is the result:

See below please.
I have two tall boxes. One with physical material and the other with legacy, to discard reflections.
Rendered against an empty background.

I save the image as PNG with alpha included.

In photoshop I add a white background and I can see a darker grey contour.

Edit: I added the Max file

Here are my results from Photoshop (dark border) and Fusion (no border).
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-01-31, 18:06:20
Reply #22

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
Got it. Thanks!

2022-01-31, 18:59:37
Reply #23

user116

  • Active Users
  • **
  • Posts: 22
    • View Profile
Yea, sorry for posting in daily thread.
Concerning the topic - sorry but watching some pictures I still think something is off.

Image credits - Wikipedia
The trees sustain their volume. One can also pretty much see the individual needles.
Is there really no way to mitigate this effect without having to resolve to compositing and work freely in WYSIWG using the (awesome) interactive renderer? Highlight clamping is also no solution as the image gets extremally flat.

The image you posted is also "extremally flat". The sky is not overexposed so there is no huge contrast difference between the trees and the background.

How about this one?


The tree branches become thinner and thinner up to a point where they are invisible, the brighter the background is.

I understand that some bleeding of the sky will happen, but you are trying to bend the facts to your favour. In my test examples I would certainly accept some advantage to rendering on black background but for sure not so pronounced.

You posted exaple with sunset is clearly also exagerating the situation to your favour. I was not testing this against full blown sun, merely bright blue sky. Tree on my tests was aproximately the same distance as the leaveless branches on your example and yet the fine twigs in your example are clearly visible.

The image you posted is also "extremally flat". The sky is not overexposed so there is no huge contrast difference between the trees and the background.

But Maru, even in this "extremely flat" situation this optical problem is still present. If you go back on page 1 in this thread, there is an example which is very similar to the last posted "flat and natural" photo and the leaves are less visible than same image on a black background.

I think is something it has to do with ho the sampler works on the opacity materials with very fine detail. Maybe I am wrong...

I also think that how the sampler works might be the problem.

2022-01-31, 19:34:06
Reply #24

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
I'll try with fusion later. But yes. With photoshop this is the result:

See below please.
I have two tall boxes. One with physical material and the other with legacy, to discard reflections.
Rendered against an empty background.

I save the image as PNG with alpha included.

In photoshop I add a white background and I can see a darker grey contour.

Edit: I added the Max file

in your PNG with alpha example - is the black border almost gone if you switch to 32bit mode? if so Photoshop is blending colors with wrong gamma.
Marcin Piotrowski
youtube

2022-01-31, 19:50:04
Reply #25

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
I'll try with fusion later. But yes. With photoshop this is the result:

See below please.
I have two tall boxes. One with physical material and the other with legacy, to discard reflections.
Rendered against an empty background.

I save the image as PNG with alpha included.

In photoshop I add a white background and I can see a darker grey contour.

Edit: I added the Max file

in your PNG with alpha example - is the black border almost gone if you switch to 32bit mode? if so Photoshop is blending colors with wrong gamma.

There aren't 32 bit PNGs, but at 16 bit I can still see the border. I don't know how to premultiply a targa or tiff file in photoshop. I'd need to just do a selection of the alpha, but at that point the test doesn't make sense.

2022-01-31, 19:55:01
Reply #26

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
I'll try with fusion later. But yes. With photoshop this is the result:

See below please.
I have two tall boxes. One with physical material and the other with legacy, to discard reflections.
Rendered against an empty background.

I save the image as PNG with alpha included.

In photoshop I add a white background and I can see a darker grey contour.

Edit: I added the Max file

in your PNG with alpha example - is the black border almost gone if you switch to 32bit mode? if so Photoshop is blending colors with wrong gamma.

There aren't 32 bit PNGs, but at 16 bit I can still see the border. I don't know how to premultiply a targa or tiff file in photoshop. I'd need to just do a selection of the alpha, but at that point the test doesn't make sense.

That's the problem...

2022-01-31, 20:01:58
Reply #27

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
I'm sorry but the tree example just won't work - we are certainly not using real pine needle geometry with translucency as its main scattering component. Because our inputs are so far away from physical reality, we cannot expect physically correct results out of the box
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2022-01-31, 20:07:49
Reply #28

piotrus3333

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

There aren't 32 bit PNGs, but at 16 bit I can still see the border. I don't know how to premultiply a targa or tiff file in photoshop. I'd need to just do a selection of the alpha, but at that point the test doesn't make sense.

even 8bit PNG with alpha will show that behaviour when you switch between 8 and 32 mode.

I'm referring to this option in PS:
Marcin Piotrowski
youtube

2022-01-31, 20:15:22
Reply #29

lupaz

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

There aren't 32 bit PNGs, but at 16 bit I can still see the border. I don't know how to premultiply a targa or tiff file in photoshop. I'd need to just do a selection of the alpha, but at that point the test doesn't make sense.

even 8bit PNG with alpha will show that behaviour when you switch between 8 and 32 mode.

I'm referring to this option in PS:

Oh. You mean to just Image>Mode>32 bit.
Interestingly, it does seem to improve, but it's very subtle.

Regarding that option with gamma in PS, I never used that or new it existed.