Page 1 of 2

Shadow rays transparency for path tracers (aka hybrid glass)

Posted: Tue Oct 08, 2019 2:09 pm
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.

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

Posted: Tue Oct 08, 2019 2:38 pm
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?

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

Posted: Tue Oct 08, 2019 2:58 pm
by lacilaci
Good, so it's finaly possible to make thick glass panels and lightbulbs etc..

Btw. will this work with disney material too?

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

Posted: Tue Oct 08, 2019 4:09 pm
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.

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

Posted: Tue Oct 08, 2019 4:13 pm
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.

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

Posted: Tue Oct 08, 2019 4:28 pm
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.

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

Posted: Tue Oct 08, 2019 5:51 pm
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.

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

Posted: Tue Oct 08, 2019 5:55 pm
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.

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

Posted: Tue Oct 08, 2019 7:53 pm
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

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

Posted: Tue Oct 08, 2019 8:33 pm
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).