Author Topic: 01.2022 compositing issues  (Read 10726 times)

2022-01-29, 23:22:43

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.

2022-01-30, 03:18:38
Reply #1

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
Actually I was curious about the same thing. Alpha channels come with a black (or whatever background there is) contour. Can the alpha take alpha as transparent as opposed to the background while rendering?

2022-01-30, 09:21:59
Reply #2

user116

  • Active Users
  • **
  • Posts: 22
    • View Profile
Yes, the difference is obvious and brutal. Better example where the trees do not overlap - impossible to build any volume with single tree which is somewhat dense in itself. Bright background, dark override, and composited image saved with alpha channel and background added in post.
Pretty please address this guys. Thank you

2022-01-30, 09:27:02
Reply #3

LorenzoS

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

2022-01-30, 16:42:23
Reply #4

Yuriy Bochkaryov

  • Active Users
  • **
  • Posts: 102
    • View Profile
    • Home Page
Quote
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.
I also wrote about this problem, but no one answered me
everyone is silent

2022-01-31, 11:43:53
Reply #5

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
just render on black or do not replace background. there is nothing to fix hence the silence.
Marcin Piotrowski
youtube

2022-01-31, 12:19:01
Reply #6

Yuriy Bochkaryov

  • Active Users
  • **
  • Posts: 102
    • View Profile
    • Home Page
Quote
just render on black or do not replace background. there is nothing to fix hence the silence.
strange offer
why render on black?
how is this justified?
maybe you need to fix the error and there will be no more problems
2022 - and we need a black background to render coniferous plants
I think it's wrong

2022-01-31, 12:51:40
Reply #7

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
on the edges of those conifiers green pixels with value of 0.25 are mixing with blue sky pixels well above 1.0. you are just loosing them: 0.25 and sky will often blend to 1+. not so green any more.
you want to preserve this green 0.25 for future compositing? every possible pixel of it? render on black 0.0.
Marcin Piotrowski
youtube

2022-01-31, 12:57:29
Reply #8

Yuriy Bochkaryov

  • Active Users
  • **
  • Posts: 102
    • View Profile
    • Home Page
Quote
on the edges of those conifiers green pixels with value of 0.25 are mixing with blue sky pixels well above 1.0. you are just loosing them: 0.25 and sky will often blend to 1+. not so green any more.
you want to preserve this green 0.25 for future compositing? every possible pixel of it? render on black 0.0.
does everything work correctly?
there is no problem, nothing needs to be fixed, everything works correctly?

2022-01-31, 13:36:17
Reply #9

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
on the edges of those conifiers green pixels with value of 0.25 are mixing with blue sky pixels well above 1.0. you are just loosing them: 0.25 and sky will often blend to 1+. not so green any more.
you want to preserve this green 0.25 for future compositing? every possible pixel of it? render on black 0.0.

Rendering on black is fine. The issue is that the alpha channel leaves pixels on the contour. So you need to keep on working on post to remove them.

2022-01-31, 13:48:52
Reply #10

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
on the edges of those conifiers green pixels with value of 0.25 are mixing with blue sky pixels well above 1.0. you are just loosing them: 0.25 and sky will often blend to 1+. not so green any more.
you want to preserve this green 0.25 for future compositing? every possible pixel of it? render on black 0.0.

Rendering on black is fine. The issue is that the alpha channel leaves pixels on the contour. So you need to keep on working on post to remove them.

and it is ok in Corona 7?
Marcin Piotrowski
youtube

2022-01-31, 14:24:26
Reply #11

Dionysios.TS

  • Active Users
  • **
  • Posts: 766
    • View Profile
    • Evolvia Imaging
just render on black or do not replace background. there is nothing to fix hence the silence.

This is not the solution!

I've tried many times in the past and the black background leaves small black artifacts on the edges of the foliage objects.
As a fast workaround, I render the image with the background I'll use in post so the defect is minimized but in any case is still there.

I agree with Yuriy, there is something wrong and needs to be fixed.

Thanks.

2022-01-31, 14:32:38
Reply #12

LorenzoS

  • Active Users
  • **
  • Posts: 291
    • View Profile
Quote
I've tried many times in the past and the black background leaves small black artifacts on the edges of the foliage objects.
As a fast workaround, I render the image with the background I'll use in post so the defect is minimized but in any case is still there.
same workflow for me

Quote
I agree with Yuriy, there is something wrong and needs to be fixed.
+1

for who work with external views I think it is a big limitation.



2022-01-31, 15:08:17
Reply #13

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
on the edges of those conifiers green pixels with value of 0.25 are mixing with blue sky pixels well above 1.0. you are just loosing them: 0.25 and sky will often blend to 1+. not so green any more.
you want to preserve this green 0.25 for future compositing? every possible pixel of it? render on black 0.0.

Rendering on black is fine. The issue is that the alpha channel leaves pixels on the contour. So you need to keep on working on post to remove them.

and it is ok in Corona 7?

No.

This should be a separate thread for Corona in general.

2022-01-31, 15:50:39
Reply #14

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • Marcin
    • 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.

Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

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

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12711
  • 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: 12711
  • 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: 12711
  • 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.

2022-01-31, 20:38:48
Reply #30

piotrus3333

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

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.

if you need it cleaner just use exrs. these would look perfect even in Photoshop.
Marcin Piotrowski
youtube

2022-01-31, 20:45:13
Reply #31

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
Thanks Piotrus.
I'll try. It scares me the disc space, but will definitely give it a try.
Fusion sounds good too and always wanted to play with it.

2022-01-31, 21:37:52
Reply #32

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
16bit exr should be smaller than your 16bit PNG. no need for 32bit.
Marcin Piotrowski
youtube

2022-05-22, 23:25:58
Reply #33

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

Here are my results from Photoshop (dark border) and Fusion (no border).

Thank you Maru. I just did this with Fusion. Now my question is, can Corona render in the VFB directly with the transparency instead of using a black background, like Fusion does? We would save directly into a PNG for example, saving us the fusion step.

2022-05-23, 09:11:15
Reply #34

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
its not Corona. this is PS trying to do compositing in 2.2
Marcin Piotrowski
youtube

2022-05-23, 14:32:32
Reply #35

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
I understand. But if Fusion let's you output/save the image with a transparent background, maybe corona can do it too.
In that case you can save as PNG and open it in PS with perfect transparency.

2022-05-23, 15:34:52
Reply #36

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
The PNG options from Max when saving specify whether to include the alpha or not. As a note, Photoshop may not show it on loading because Photoshop, but it is there.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2022-05-23, 16:54:52
Reply #37

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
The PNG options from Max when saving specify whether to include the alpha or not. As a note, Photoshop may not show it on loading because Photoshop, but it is there.

Ok. So it wouldn't be possible to show it like this in the VFB?
See attached please.
I feel (really don't know), that if it's shown like this in the VFB, as opposed to a black background, it wouldn't bring black pixels around the image into photoshop. No?

2022-05-23, 16:59:32
Reply #38

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
The VFB will always show whatever background color or image is set for the scene, but those areas will also generate an alpha mask that gets saved with the image. Photoshop gets a bit weird about this and may load the PNG with the background visible, but the alpha is in there and can be extracted and applied, I don't remember exactly when it decides to get weirded out about it :)

A quick test with a cube shows that so long as Alpha channel is checked in the Max settings, it loaded just fine in PS with that already applied for me.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2022-05-23, 17:07:21
Reply #39

lupaz

  • Active Users
  • **
  • Posts: 951
    • View Profile
The VFB will always show whatever background color or image is set for the scene, but those areas will also generate an alpha mask that gets saved with the image. Photoshop gets a bit weird about this and may load the PNG with the background visible, but the alpha is in there and can be extracted and applied, I don't remember exactly when it decides to get weirded out about it :)

A quick test with a cube shows that so long as Alpha channel is checked in the Max settings, it loaded just fine in PS with that already applied for me.

Ah ok. Thanks.

2022-05-27, 10:42:16
Reply #40

piotrus3333

  • Active Users
  • **
  • Posts: 230
    • View Profile
This is how Fusion handles alpha edges issues with Merge node (Additive/Subtractive slider):

Marcin Piotrowski
youtube