LuxCore: Shadowcatcher

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

Moderators: Dade, jromang, tomb, zcott, coordinators

LuxCore: Shadowcatcher

Postby Dade » Sun Feb 07, 2016 3:18 am

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 = matte
scene.materials.shadowcatcher_mat.kd = 0.001 0.001 0.001
scene.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:

sc1.jpg


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

sc1no.jpg


Example 2

This is another common usage:

sc2.jpg


Without the shadow catcher object:

sc2no.jpg


A back ground image is used:

Code: Select all
# Film image pipeline plug-ins
film.imagepipeline.0.type = TONEMAP_LINEAR
film.imagepipeline.0.scale = 1
film.imagepipeline.1.type = BACKGROUND_IMG
film.imagepipeline.1.file = scenes/luxball/road.jpg
film.imagepipeline.1.gamma = 2.2
film.imagepipeline.1.storage = byte
film.imagepipeline.2.type = GAMMA_CORRECTION
film.imagepipeline.2.value = 2.2


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

sc2no2.jpg


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.
User avatar
Dade
Developer
 
Posts: 8358
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: LuxCore: Shadowcatcher

Postby SATtva » Sun Feb 07, 2016 5:19 am

Hell yeah! Awesome work Dade!
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 7162
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: LuxCore: Shadowcatcher

Postby pciccone » Sun Feb 07, 2016 7:06 am

This is fantastic, thank you very much Dade.
User avatar
pciccone
Developer
 
Posts: 1579
Joined: Wed Jan 13, 2010 11:02 am
Location: South Carolina

Re: LuxCore: Shadowcatcher

Postby neo2068 » Sun Feb 07, 2016 3:18 pm

That is awesome and a long awaited feature. :D Thank you, Dade!
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 780 + GTX 560, Windows 10 64bit, Blender 2.77a
neo2068
Developer
 
Posts: 742
Joined: Sun May 03, 2009 2:11 am
Location: Germany

Re: LuxCore: Shadowcatcher

Postby B.Y.O.B. » Sun Feb 07, 2016 4:27 pm

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
(731.87 KiB) Downloaded 49 times
1_sunsky_default.png
the default sunsky
2_sunsky_black_bottom.png
sunsky with black ground color
3_sun_only.png
sun only (correct)
User avatar
B.Y.O.B.
Developer
 
Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: LuxCore: Shadowcatcher

Postby Dade » Sun Feb 07, 2016 6:34 pm

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.
User avatar
Dade
Developer
 
Posts: 8358
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: LuxCore: Shadowcatcher

Postby B.Y.O.B. » Mon Feb 08, 2016 2:55 am

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.
User avatar
B.Y.O.B.
Developer
 
Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: LuxCore: Shadowcatcher

Postby Asticles » Mon Feb 08, 2016 10:47 am

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.
Salvador Ureña
Ephemereal architecture rendering.
http://urenasalvador.wix.com/portfolio

Sorry for my english. :P
Asticles
 
Posts: 199
Joined: Sat Sep 12, 2009 7:40 am
Location: Spain

Re: LuxCore: Shadowcatcher

Postby B.Y.O.B. » Mon Feb 08, 2016 12:25 pm

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.
User avatar
B.Y.O.B.
Developer
 
Posts: 5136
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: LuxCore: Shadowcatcher

Postby jensverwiebe » Mon Feb 08, 2016 12:36 pm

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
User avatar
jensverwiebe
Developer
 
Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Next

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest