Corona ShadowCatcher and refractive objects

Hello dear Corona Forum devs and users,

Is it possible to render transparent and semi-transparent objects with a shadow catcher?
I’m struggling with this seemingly simple task.

Is there a way to solve this in Corona Renderer’s intelligent and user-friendly style?

Please see my images in the attachment:

00.simple VFB Render.jpg:

  • This is my sample object in the VFB, rendered without any shadow catchers (LookDev mode).
  • I’m lighting the scene with one Corona spotlight for control on shadow generation (ShadowCatcher illuminator disabled), an HDRI used in the Reflection and Refraction overrides for richer material interaction, and a dark grey color in the Environment slot to provide some base lighting and compensate dark shadows.
  • The object uses a simple Corona Physical glass shader with some roughness and volumetric scattering.
  • The plane also uses a basic Corona Physical material with default roughness and an RGB albedo value of 180.

01.rendered with shadowcatcher.jpg:

  • Same object, but plane with a ShadowCatcher applied (same albedo color (RGB albedo value of 180) as in the previous render, shadows set to 1.0, compositing mode + black direct override).
  • Saved as png 24 bit with alpha.
  • This is what I get with the ShadowCatcher. Despite using the same albedo, the result is different - both the shadows and the glass looks way too different from the original. Due to non-linear output?
    At the same time, I can already see in the VFB while rendering that, through the glass material, the same albedo looks much too bright when using the ShadowCatcher.

02.rendered with shadowcatcher- PS.jpg:

  • This is how it looks when I match the background color in Photoshop. PNG has build-in alpha information from ShadowCatcher.

03.questions.jpg:

  • Here are the main questions: I can’t find a user-friendly way to combine the object’s alpha with the ShadowCatcher’s alpha. Could you please help me here?
  • Is it also possible to control the object’s reflection color at grazing angles while changing the background color in the post, without going back to beauty compositing?
    For example, if the object was created in a white environment, and you later change the background to red, the white reflections stay visible, revealing the fake.

04.object refraction alpha.jpg:

  • This is my object’s refraction alpha. It looks the same in both the VFB and the saved version.

05.shadowcatcher alpha VFB.jpg:

  • This is how the ShadowCatcher’s alpha looks in the VFB: almost no noise and the same contrast as the object’s refraction alpha.

06.shadowcatcher alpha saved.jpg:

  • Same ShadowCatcher alpha, but saved as usual: you can see a lot of noise, and the image looks overall much brighter and foggier.

07.shadowcatcher alpha saved-correction.jpg:

  • My attempt to compensate for it.

08.alpha desired output.jpg:

  • This is the alpha I’m actually missing right now.

09.general-desired-output.jpg:

  • How it works with this alpha if I add it via layer mask to the PNGs alpha.

At the same time, I found this video for Blender…
https://www.youtube.com/watch?v=A0yejmy0Yf4

Thank you a lot for the information!










Hi,

If you have a transparent/refractive object, its alpha should be kept regardless of shadowcatcher and latter’s setup - they are independent (unless intersecting).
Maybe you have thin-shell enabled? This disables refraction and you have only reflection, which means fully opaque (white) alpha. Maybe you are using refraction element (this is not(!) the same as alpha) instead of alpha.

In the scene attached you can see that shadowcatcher does not affect in any way the glass objects’ alpha.


shadowcatcher-alpha.max (1.07 MB)

Hi Aram,
Thank you very much for your time and the scene. I opened it with Max 2026 and tested it.

00.original scene-viewport preview-nothing changed.jpg:

  • I opened your scene and did a quick interactive rendering. This is the result.

01.original scene-saved alpha-automatic.jpg:

  • Then I saved this alpha as a JPG - it turned darker and got a washed-out look, just like yours.

02.original scene-beauty-nothing changed.jpg:

  • This is a beauty render, just to understand how it looks in normal mode.

03.original scene-color settings.jpg:

  • I realized that the preview swatches were also off, so I switched from OCIO to the legacy gamma workflow, because all these color management settings make debugging more confusing for me.

04.switched to gamma workflow.jpg:

  • I switched to the legacy gamma workflow, and the swatches look normal now.

05.gamma workflow-viewport preview-nothing changed.jpg:

  • The result in the VFB is the same as before.

06.gamma workflow-saved alpha-automatic.jpg:

  • The saved image no longer looks darker and washed out.
    Transparency looks the same as in the VFB, but the ShadowCatcher shadows are much brighter than in the VFB.

07.gamma workflow-beauty.jpg:

  • Beauty render, just for control.

08-with my objects added.jpg:

  • I imported my objects with two materials: one colored and one from the previous scene. They are exactly the same as before, including the shaders.

09-with my objects-alpha.jpg

  • Again, I have only a white alpha. I realized that the absorption color affects the alpha a lot, but how can I get the same result as in the beauty render while still having a correct alpha?

I’m attaching the scene. I’m trying to figure it all out and get a predictable workflow, but right now this all is quite confusing for me…

Please take a look at my attachments.
Thank you again!











shadowcatcher-alpha-gamma workflow.max (996 KB)

Does this look more or less like what you would like to achieve?
I will add some images and can provide further explanation tomorrow.

I am not entirely sure if those gamma multiplications and corrections are needed, it just “felt” right.
I wouldn’t even try doing things like this in Photoshop, there is just no way to get the right alpha and mixing in it.







shadowcatcher-alpha.max (876 KB)

Hi Maru,

Thank you for your time and the tests. I’ll try to do the same using overrides for my objects and will share the results.

Basically, my goal is to build a clear workflow for achieving results as close as possible to a simple beauty render (without shadow catcher), but using the shadow catcher in compositing mode - without going back to the beauty pass or linear output.
Specifically:
-When rendering simple opaque objects
-Objects with refraction
-More reflective objects, like metals

The goal is to be able to post-change the background color and still get:
-More or less consistent shadows (because right now, shadows from the shadow catcher look very different compared to the beauty render)
-Refraction (so the changed background is visible through transparent materials)
-Ideally, reflection (to fix the “cut-off effect” when changing the background from, say, white to dark blue)

We’re have more and more tasks like this, where we need to dynamically change the background for objects in post…

I’m afraid those two does not come together, you either save and comp shadow catcher linearly and get 1:1 likeness to beauty, or you work conveniently with gamma corrected images and get dark and ugly shadows from shadow catcher.

Hi Romullus,

If it’s only about the shadows, then it’s fine - I can save the tonemapped version in PNG/TIFF 16-bit and fine-tune it by comparing it with a simple beauty render using layer masks and curves/levels in Photoshop.
I hope that objects with refraction and reflection are manageable with similar trade-offs…

P.S. I thought I could save the shadowcatcher’s alpha and apply it to the beauty render separately, but regardless of tonemapping and output gamma, I get weird results when saving this pass. You can see my results in the previous two posts.

Hey @brr,

To not overcomplicate and waste time describing limitations/bugs with OCIO, let’s just skip it. I will just mentioned for @brr, that Alpha darkening is because of Output transform (defaulting to view transform) in OCIO - it currently does not differentiate between data (mask) images or not, so you can set no conversion for Alpha and it will be saved as previewed in VFB. Switch to Gamma workflow and forget the headache.

The trick here is, given my assumption of planned composition/post-production (changing background, having its effect to some degree), is to enable some alpha for the objects you have, specifically with the materials they have.
Currently Shadowcatcher seen through refraction has solid alpha, which may or may not be expected, but it is a rabbit hole so let’s not dig it.
If RaySwitch is applied shadowcatcher plane and Refraction is excluded from it, you will get black/grey Alpha over your objects. This will let you add different backgrounds to the Beauty (no other elements are needed), solid color background working the best.

So the “solution” here is as Maru suggested, only having no material or 0 opacity material for refracted rays.

Environment is also important. As studio lighting is assumed, I would suggest changing to White environment, as with black environment, it is only the light illuminating everything.

Hope this helps.
shadowcatcher-alpha-gamma workflow_RaySwitch.max (1.72 MB)