Shadow rays transparency for path tracers (aka hybrid glass)

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

I have added the support for shadow rays transparency for path tracers (aka hybrid glass, issue #233). Transparency (aka opacity) was already available as general material option for front and back faces.
There is now another general form of transparency restricted to shadow rays (and path tracers):

Code: Select all

scene.materials.glass-right.transparency.shadow = 0.85 0.85 0.85

Note: it accepts only a constant color, not a texture (this is intentional and due to some performance consideration).

The result is:

hybridglass.jpg

From left to right:
  • a normal glass sphere;
  • an architectural glass sphere;
  • a normal glass sphere with a shadow transparency of (0.85, 0.85, 0.85);
Thanks to shadow transparency, anything in the shadow of the last sphere still receive direct light without any problem (i.e. noise and/or need to render SDS paths). Note also the beautiful caustics, hybrid rendering works fine with this feature.

As I wrote, this is a general material feature:

matte.jpg

Not only it works with glass and all other types of glass materials (i.e. roughglass, etc.) but even with solid materials. Note as the red sphere doesn't cast a shadow. Indeed, this is the obvious proof that it is a fake and breaks the energy balance so it has to be use with some care or you may hand with some totally fake/unrealistic rendering.

This feature is intended to resolve the "dark juice" problem, this is a normal rendering:

juice1.jpg

and this with shadow transparency enabled for the glass:

juice2.jpg

It looks quite good without the need to have to render SDS paths or other complex and expansive solutions.

Note: as I wrote, BiDir ignore this property, it is valid only for path tracers.
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by marcatore »

great!

About the last renders about the juice glass.
the shadow we see on the "hybrid" glass is just the shadow of the juice or the shadow of juice and glass?
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by lacilaci »

Good, so it's finaly possible to make thick glass panels and lightbulbs etc..

Btw. will this work with disney material too?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

marcatore wrote: Tue Oct 08, 2019 2:38 pm About the last renders about the juice glass.
the shadow we see on the "hybrid" glass is just the shadow of the juice or the shadow of juice and glass?
The shadow of the glass is very very light: 0.95 0.95 0.95 (95% of incoming light is transmitted). So it is mostly juice shadow, the glass has nearly no shadow. But the scene is a bit dark in general, cranking up the exposure would make the shadow glass more visible.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

lacilaci wrote: Tue Oct 08, 2019 2:58 pm Good, so it's finaly possible to make thick glass panels and lightbulbs etc..
Yes, it solves also the "lamp inside glass" problem. It is a more general solution of the back-face only transparency however the later doesn't break energy equilibrium.
lacilaci wrote: Tue Oct 08, 2019 2:58 pm Btw. will this work with disney material too?
Yes but I assume it will more useful once we have the transmission support added to Disney material.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by lacilaci »

Dade wrote: Tue Oct 08, 2019 4:13 pm Yes but I assume it will more useful once we have the transmission support added to Disney material.
You wouldn't believe the crazy setups I sometimes have to do to please the client.
And if the renderer allows for options like I requested here: https://github.com/LuxCoreRender/LuxCore/issues/148
Or a full rayswitching options it is the best thing ever...

Just yesterday I had some werid crazy request on removing some shadows and reflections, it's a lot of work "photoshopping" it out but in cycles(also corona vray etc..) I just enable/disable some object flags or rayswitch to modify those features and I'm done...

I know the community around luxcore somehow seeks ultimate realism, but in reality clients want fancy looking shit, not simulation (my case). So any feature that goes that direction is great for me cause I know there won't be any stress when someone asks for crazy stuff from me.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

lacilaci wrote: Tue Oct 08, 2019 4:28 pm Just yesterday I had some werid crazy request on removing some shadows and reflections, it's a lot of work "photoshopping" it out but in cycles(also corona vray etc..) I just enable/disable some object flags or rayswitch to modify those features and I'm done...

I know the community around luxcore somehow seeks ultimate realism, but in reality clients want fancy looking shit, not simulation (my case).
The problem is not that I don't want to fake, it is that we trace light in both directions (i.e. backward and forward, from eye and lights) plus we have very often MIS (i.e. we trace the same path in different ways).
This mean that any asymmetrical light behavior (eye Vs light) can easily lead to some inconsistent/messed rendering. Cycles can do some stuff because it traces rays in a very specific way. Some aspect of the general "ray switch" concept can not be generalized. This "shadow rays transparency" it is however a step in that direction.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

BTW, I'm not even to have looked in all possible problems of this new feature so it may need some intensive testing.
Support LuxCoreRender project with salts and bounties
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by lighting_freak »

Hi,

this hybrid glass sounds totally like a good solution for lot of rendering issues.
Does it work with roughness option also (or will it work for rough transparent surfaces in near future)?

Could you imagine to calculate the transparency according to Fresnel equations? This should allow more precise reflections (and shadows)?

Thanks
BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Shadow rays transparency for path tracers (aka hybrid glass)

Post by Dade »

lighting_freak wrote: Tue Oct 08, 2019 7:53 pm this hybrid glass sounds totally like a good solution for lot of rendering issues.
Does it work with roughness option also (or will it work for rough transparent surfaces in near future)?
Yes, it works with any materials.
lighting_freak wrote: Tue Oct 08, 2019 7:53 pm Could you imagine to calculate the transparency according to Fresnel equations? This should allow more precise reflections (and shadows)?
I was playing with the idea to make "hybrid glass" the default glass and to establish the default shadow transparency as you described but I'm not sure if it is better to let people understand the limitation of "true" glass and look for a solution or give them "hybrid glass" as default (and, may be, get some unexpected result).
Support LuxCoreRender project with salts and bounties
Post Reply