Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Stof on 2022-12-27, 02:24:41

Title: Is it possible to render objects out and layer them without black edges?
Post by: Stof on 2022-12-27, 02:24:41
So I've been trying to find a way to render out objects in Corona but avoiding the black edges seen in the pictures below...

Is there a way to place an object above another object without having black edges?
(it's for compositing inside photoshop)

Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: lupaz on 2022-12-27, 16:32:31
There's info about this in here. The problem seems to be Photoshop and not Corona.
https://forum.corona-renderer.com/index.php?topic=35500.15
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: Stof on 2022-12-27, 18:54:19
I do see that but is there a way to make photoshop interpret the alpha correctly or?

The only solution I see in there is "use fusion instead" which is not an option...
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: Kalopsia on 2022-12-28, 12:48:29
It does work like it should in Photoshop but you need to be in 32bit. That is ust how a Matte works. Since the pixels on the edge are multiplied by the background color you need to perform this in linear space. If you do this in 16 or 8 bit, even inside AE or Fusion, it would give your the same problems.

The way of doing this in photoshop would just be to creat a new file in 32 bit and do the compositing of the Matte in there. You can work with a Smart object inside your 16bit editing file. I used to do this way back when we still worked with 32bit files in Photoshop.

In fact, if you oppen a 32bit exr in Photoshop that has the Alpha saved inside the same file, EXR IO will aply the alpha and you just need to add the backgroudn and save it.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: lupaz on 2022-12-28, 15:15:54
It does work like it should in Photoshop but you need to be in 32bit. That is ust how a Matte works. Since the pixels on the edge are multiplied by the background color you need to perform this in linear space. If you do this in 16 or 8 bit, even inside AE or Fusion, it would give your the same problems.

The way of doing this in photoshop would just be to creat a new file in 32 bit and do the compositing of the Matte in there. You can work with a Smart object inside your 16bit editing file. I used to do this way back when we still worked with 32bit files in Photoshop.

In fact, if you oppen a 32bit exr in Photoshop that has the Alpha saved inside the same file, EXR IO will aply the alpha and you just need to add the backgroudn and save it.

I tested this in Fusion with an 8bit image and it doesn't happen. You get a clean edge.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: piotrus3333 on 2022-12-28, 17:13:19
No need for 32bit colour in PS:

This is how Fusion solves issues with alphas - slider (in Merge node).
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: Kalopsia on 2023-01-01, 01:58:11
piotruss3333 that is a smart solution, using the advanced option in the color profile
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: dj_buckley on 2023-01-06, 16:37:48
No need for 32bit colour in PS:

This is how Fusion solves issues with alphas - slider (in Merge node).

Piotrus

In that video you change a setting in the Colour Preferences of Photoshop (Blend RGB Colours Using Gamma 1).  It's worth pointing out, this will screw up your older PSD's, especially where you've used blending modes such as Multiply for people shadows etc etc.

I just discovered this the hard way.  Opened an old PSD and all my people shadows had practically disappeared.  Took me ages to figure out why.  It's because I'd changed that setting the other day to experiment with.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: davemahi on 2023-01-06, 16:58:24
Cheap and dirty would be to go to the top menu, Layer> Matting> Defringe

Not the best solution, but will work in a lot of cases.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: piotrus3333 on 2023-01-06, 17:15:23
Piotrus

In that video you change a setting in the Colour Preferences of Photoshop (Blend RGB Colours Using Gamma 1).  It's worth pointing out, this will screw up your older PSD's, especially where you've used blending modes such as Multiply for people shadows etc etc.

I just discovered this the hard way.  Opened an old PSD and all my people shadows had practically disappeared.  Took me ages to figure out why.  It's because I'd changed that setting the other day to experiment with.

Screw up? In this case the math can be either correct or incorrect. This is why I called it "Fixing your PS".
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: dj_buckley on 2023-01-06, 17:44:59
Yes, it will mess up any PSD's you created prior to activating that setting.  It was more a warning for anyone else who might not fully understand what they're changing and the effect it will have on the work they've already done.

That setting is off by default right?  So are you saying that it should be on by default otherwise everything is wrong?  I'm not exclusively talking about alpha channels here, but anything that gets blended?
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: piotrus3333 on 2023-01-06, 20:16:23
Yes, it will mess up any PSD's you created prior to activating that setting.  It was more a warning for anyone else who might not fully understand what they're changing and the effect it will have on the work they've already done.

That setting is off by default right?  So are you saying that it should be on by default otherwise everything is wrong?  I'm not exclusively talking about alpha channels here, but anything that gets blended?

Defaults mean nothing. Photoshop is not made for compositing cgi, hence the issue. Blending is math and this math is correct only with linear colour.

Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: Stof on 2023-01-18, 15:28:55
I just wanna follow up on this...

Using OpenEXR does not solve the problem but it makes the halo white instead of black... Is there a way to get these renders to compose correctly without using defringe..
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: lupaz on 2023-01-18, 15:39:01
There should be an option on the Corona VFB to do the pre-multiplication before exporting to PNG.
I mean, maybe Photoshop is not great for compositing, but the reality is that 90% (just throwing a guesstimate) of Corona users use PS.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: Stof on 2023-01-18, 22:48:06
I dont see that option, can u maby take a screenshot of the option
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: lupaz on 2023-01-19, 00:09:04
I dont see that option, can u maby take a screenshot of the option

It doesn't exist. My message was more like a feature request.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: sebastian___ on 2023-01-21, 07:01:42
I posted this solution before in the past.

Some leaves rendered and then composed as layers in AE over a background.

notice the dark edges here :

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=18488.0;attach=75420;image)


..............
And here we have white edges:

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=18488.0;attach=75422;image)


...............

And here - tga with premult unchecked - perfect edges. Does this method solves the dark edges issues ?

(https://forum.corona-renderer.com/index.php?action=dlattach;topic=18488.0;attach=75426;image)

Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: James Vella on 2023-01-21, 21:14:43
doesn't matter the format, along as you premultiply your alpha
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: sebastian___ on 2023-01-22, 00:19:47
There's no premultiply, premult or unpremult needed with the method above.
Title: Re: Is it possible to render objects out and layer them without black edges?
Post by: James Vella on 2023-01-22, 20:20:58
Render on a black background or use a proper compositing software.