Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: Dade, jromang, tomb, zcott, coordinators

Introduction

For an introduction to the shadow catcher concept, you can read https://support.solidangle.com/display/ ... ow+Catcher

The LuxCore support for shadow catcher is an option you can enable in any material (however it doesn't make sense for pure specular materials), for instance:

Code: Select all
scene.materials.shadowcatcher_mat.type = mattescene.materials.shadowcatcher_mat.kd = 0.001 0.001 0.001scene.materials.shadowcatcher_mat.shadowcatcher.enable = 1

The material solidity will be set according the amount of direct light received.

Example 1

This is a common usage of shadow catcher with a (true) HDR image as infinite light:

This is the same scene with shadow catcher material flag disabled:

Example 2

This is another common usage:

A back ground image is used:

Code: Select all
# Film image pipeline plug-insfilm.imagepipeline.0.type = TONEMAP_LINEARfilm.imagepipeline.0.scale = 1film.imagepipeline.1.type = BACKGROUND_IMGfilm.imagepipeline.1.file = scenes/luxball/road.jpgfilm.imagepipeline.1.gamma = 2.2film.imagepipeline.1.storage = bytefilm.imagepipeline.2.type = GAMMA_CORRECTIONfilm.imagepipeline.2.value = 2.2

In combination with a light setup resembling the real word light condition (a distant light + an LDR image):

Notice how the lower hemisphere of the LDR image used for the infinite light is black: otherwise the lower hemisphere will partially cast shadows on the shadow catcher plane.

Alpha

The alpha channel is set according the solidity of the shadow catcher object, as expected.

Material used for the shadow catcher

The material used for the shadow catcher give you a lot of control over the appearance of the shadows. For instance, you can use the .transparency to make the shadow more or less visible, the color of the material can be used to control the color of the shadow, etc.

BIDIRCPU

BIDIRCPU doesn't directly support the shadow catcher flag but you can use the alpha channel of the same scene rendered with PATH to compose your images.

Posts: 8358
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Linux builds packager

SATtva

Posts: 7162
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

This is fantastic, thank you very much Dade.

pciccone

Posts: 1579
Joined: Wed Jan 13, 2010 11:02 am
Location: South Carolina

That is awesome and a long awaited feature. Thank you, Dade!
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 780 + GTX 560, Windows 10 64bit, Blender 2.77a
neo2068

Posts: 742
Joined: Sun May 03, 2009 2:11 am
Location: Germany

I added the support to LuxBlend, but I have a little problem:

When I use a sky or hemi lamp with the shadowcatcher, it does not end up fully transparent.
I understand what you wrote here:
Notice how the lower hemisphere of the LDR image used for the infinite light is black: otherwise the lower hemisphere will partially cast shadows on the shadow catcher plane.

But even when I set the sky lower hemisphere to black ('ground.color'), the shadowcatcher is not fully transparent.
Is a sky with black groundcolor still emitting light there somehow or what's going wrong here?

Note: all images below are using a background image.
Attachments
scene.zip
sunsky with black ground color
the default sunsky
sunsky with black ground color
sun only (correct)

B.Y.O.B.

Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

B.Y.O.B. wrote:Is a sky with black groundcolor still emitting light there somehow or what's going wrong here?

Yes, technically, it is still sampled and still in shadow for direct light sampling. Just use an infinite light with an image (even a 2x2 pixels image with lower row in black). Infinite light sources have importance sampling so the lower black is not sampled at all.

But I guess I could add a special path to sky when the background color is both enabled and black.

Posts: 8358
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Dade wrote:But I guess I could add a special path to sky when the background color is both enabled and black.

I think that would also make sense for "normal" scenes without the shadow catcher.

B.Y.O.B.

Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

B.Y.O.B. wrote:
Dade wrote:But I guess I could add a special path to sky when the background color is both enabled and black.

I think that would also make sense for "normal" scenes without the shadow catcher.

I don't understand, can you explain this to me? Sorry.

Also, this is a long-awaited feature, also on cycles; I would be good you make a post on blenderartists when this feature is finished.

Best regards.
Ephemereal architecture rendering.

Sorry for my english.
Asticles

Posts: 199
Joined: Sat Sep 12, 2009 7:40 am
Location: Spain

Asticles wrote:I don't understand, can you explain this to me? Sorry.

It makes sense to not sample lights where they are completely black. Every ray that hits the black part of an HDRI or the skydome (when the groundcolor is set to black) is a wasted ray, because that part of the light does not contribute anything to the scene lighting.

I will make a post about the new features when we release the RC1 of 1.6.

B.Y.O.B.

Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

B.Y.O.B. wrote:
Asticles wrote:I don't understand, can you explain this to me? Sorry.

It makes sense to not sample lights where they are completely black. Every ray that hits the black part of an HDRI or the skydome (when the groundcolor is set to black) is a wasted ray, because that part of the light does not contribute anything to the scene lighting.

I will make a post about the new features when we release the RC1 of 1.6.

..which reminds me in the this case portals could be added while on it ?

Jens

jensverwiebe

Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Next