Maniphest T96758

unable to rebuild combined image from passes if shadow catcher enabled because the shadow catcher data is missing from the alpha channel
Closed, Resolved

Assigned To
None
Authored By
michael campbell (3di)
Mar 24 2022, 2:33 PM
Tags
  • BF Blender
Subscribers
Brecht Van Lommel (brecht)
michael campbell (3di)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.12

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-18 21:28, hash: rB93cc89247010
Worked: (newest version of Blender that worked as expected)

I develop an addon which rebuilds the combined image from the passes and then outputs to an image format with an alpha channel. If a shadow catcher is in the scene, then it seems impossible to get the correct result in the re-combined image because the shadow catcher data is missing from the alpha pass.

test file:

Revisions and Commits

rB Blender

Event Timeline

michael campbell (3di) created this task.Mar 24 2022, 2:33 PM
Brecht Van Lommel (brecht) closed this task as Archived.Mar 24 2022, 2:44 PM
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

You can choose to render the shadow catcher as alpha or as a separate pass to be multiplied into the background. You have set up the latter in this file, so there's not going to be an influence on the alpha channel.

michael campbell (3di) added a comment.Mar 24 2022, 2:47 PM

@Brecht Van Lommel (brecht) Where is this option please?

Brecht Van Lommel (brecht) added a comment.Mar 24 2022, 2:49 PM

It's the shadow catcher pass that you enabled.

michael campbell (3di) added a comment.Mar 24 2022, 2:49 PM

ah never mind, you just disable the pass. Thanks.

michael campbell (3di) added a comment.Mar 24 2022, 2:56 PM

@Brecht Van Lommel (brecht) this still isn't producing the correct result, sorry I've never used the shadow catcher when rebuilding from passes. Perhaps I'm doing something wrong?

michael campbell (3di) added a comment.Mar 24 2022, 3:00 PM

or is it just a case of the plane needing to be black?

michael campbell (3di) added a subscriber: Philipp Oeser (lichtwerk).EditedMar 24 2022, 4:37 PM

This doesn't appear to be a user issue. I think the shadow catcher objects need to show as black in the diffuse direct and indirect passes (where there is no indirect lighting), this way the alpha will leave just the shadow and indirect lighting.

The glossy passes are fine because they automatically show as black where there's no reflection. Haven't tested transmission passes.

I can't do it using the shadow catcher pass, because this removes it from the alpha.

@Brecht Van Lommel (brecht) can you re-open this?
@Philipp Oeser (lichtwerk) could you also have a look just to make sure this is not a user issue at my side?

Philipp Oeser (lichtwerk) added a comment.Mar 24 2022, 4:43 PM

@michael campbell (3di): is the latest file the one from the report description?

michael campbell (3di) added a comment.EditedMar 24 2022, 4:48 PM

Thanks @Philipp Oeser (lichtwerk) I'm pretty desperate on this one as someone just asked for refund because of it. So hopefully it is just something I'm doing wrong.

Here's a simpler version

Philipp Oeser (lichtwerk) added a comment.Mar 24 2022, 6:15 PM

will look at it tomorrow

michael campbell (3di) added a comment.Mar 24 2022, 6:20 PM

thanks. I'm pretty sure it's a bug as I'm quite skilled in this area (been doing it for 20 years), but perhaps there is some Blender specific thing that I'm missing.

Brecht Van Lommel (brecht) changed the task status from Archived to Resolved by committing rB9ef400ddf747: Cycles: don't write light passes for shadow catcher objects.Mar 24 2022, 7:44 PM
Brecht Van Lommel (brecht) added a commit: rB9ef400ddf747: Cycles: don't write light passes for shadow catcher objects.
michael campbell (3di) added a comment.Mar 24 2022, 8:32 PM

thanks @Brecht Van Lommel (brecht) much appreciated. Did you discard the diffuse direct only and keep the indirect pass for the shadow catcher? Indirect could be kept as that renders black already where there's no indirect light. Would be nice to keep the indirect light if possible as that's included in the alpha

michael campbell (3di) added a comment.EditedMar 31 2022, 12:18 PM

Hi The shadow catcher's diffuse colour is still being written to the diffuse direct pass in today's daily build of 3.1.1:

michael campbell (3di) added a comment.Mar 31 2022, 12:20 PM

@Philipp Oeser (lichtwerk) could you re-open this?

Philipp Oeser (lichtwerk) added a comment.Mar 31 2022, 12:31 PM

Fix is only in 3.2 (if this is what you meant -- or did you mean to reopen because of indirect?)

michael campbell (3di) added a comment.EditedMar 31 2022, 1:11 PM

ah ok, sorry, I thought the bug fixes were applied to all daily's. I'll check now. It shouldn't have affected the indirect passes hopefully, as they are already black where there's no indirect lighting data.

michael campbell (3di) added a comment.Mar 31 2022, 3:56 PM

@Philipp Oeser (lichtwerk) I've just checked in 3.2 and although the shadow catcher's diffuse colour have been removed from the DiffDir pass (allowing it to work), it's also been unncecessarily removed from the DiffInd and gloss passes, resulting in loss of indirect lighting and reflection. Ideally these should have been left alone, as now all the GI etc has been lost. These can be left alone because they render black where there's no data anyway.

Brecht Van Lommel (brecht) added a comment.Mar 31 2022, 4:01 PM

The shadow catcher makes no distinction between diffuse and glossy, or direct and indirect, and they do not behave fundamentally differently when it comes to what renders black or not in general. Diffuse direct light is not special here and should not be treated as such.

michael campbell (3di) added a comment.Mar 31 2022, 4:13 PM

ah ok. I just thought if you only removed the shadow catcher from the DiffDir, then we could still have indirect lighting and reflection. The only issue was the shadow catchers diffuse colour showing up on the diffDir pass (making the shadow catcher visible when combining the image).