Would it be possible to get Alpha on Glass Materials?

Discussion related to the LuxCore functionality, implementations and API.
MCurto
Posts: 7
Joined: Sun May 09, 2021 5:28 pm

Would it be possible to get Alpha on Glass Materials?

Post by MCurto » Sun May 09, 2021 5:44 pm

Don't really know the inner workings or how much work it would take or even if its possible considering the differences between the way Cycles and Lux calculate light, but in Cycles its kind of easy to get an Alpha trough Glass materials.Considering Lux is much more suited for the kind of renders in glass and liquids it seems it lacks on this area.At least to my knowledge and apart using Architectural option there's no way to get that Alpha, which really doesn't look that great.
I know I can get the Alpha from Cycles and use it on Lux render but was wondering if there's at least a possibility that this "feature" could make it eventually to some future LuxCore version?

Just a simple Glass Teapot, Lux Glass default:
Screenshot 2021-05-09 at 18.11.16.jpg
Cycles default (made IOR 1.5):
Screenshot 2021-05-09 at 18.27.36.jpg
Lux Glass Architectural, really lacks detail/realism (no diference between black/white shadow):
Screenshot 2021-05-09 at 18.16.37.jpg

JulianoLisboa
Posts: 101
Joined: Sat Feb 22, 2020 3:29 am

Re: Would it be possible to get Alpha on Glass Materials?

Post by JulianoLisboa » Sun May 09, 2021 8:17 pm

This feature would be very important for those who work with product visualization like me.

User avatar
TAO
Developer
Posts: 673
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: Would it be possible to get Alpha on Glass Materials?

Post by TAO » Sun May 09, 2021 8:42 pm

It will be great to have transparency with glass. that's a good feature to have.
Omid Ghotbi (TAO)
Latest build Download link👇👇
https://github.com/LuxCoreRender/MaxToLux/releases
Last update information
https://forums.luxcorerender.org/viewto ... 590#p30154

User avatar
Dade
Developer
Posts: 5343
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Would it be possible to get Alpha on Glass Materials?

Post by Dade » Sun May 09, 2021 8:52 pm

You have just to use Glass + material transparency (probably called opacity in Blender) and you get a Cycles-like alpha channel.
Support LuxCoreRender project with salts and bounties

User avatar
TAO
Developer
Posts: 673
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: Would it be possible to get Alpha on Glass Materials?

Post by TAO » Sun May 09, 2021 9:04 pm

I give it a try and that's the result.
Glass with 0.5 transparency
Screenshot 2021-05-09 230521.jpg
Glass with 1.0 transparency
Screenshot 2021-05-09 230534.jpg
Orginal render frame buffer with 1.0 transparency
Screenshot 2021-05-09 230655.jpg
Omid Ghotbi (TAO)
Latest build Download link👇👇
https://github.com/LuxCoreRender/MaxToLux/releases
Last update information
https://forums.luxcorerender.org/viewto ... 590#p30154

JulianoLisboa
Posts: 101
Joined: Sat Feb 22, 2020 3:29 am

Re: Would it be possible to get Alpha on Glass Materials?

Post by JulianoLisboa » Sun May 09, 2021 9:26 pm

This does not solve Dade, for example a bottle has to be transparent where I have no liquid. I cannot change the transparency of the whole bottle.


Luxcore glass turns white without transparency
image_2021-05-08_17-14-36.png

Cycles is correct, with transparency using holdout or shadow catcher in the background.
image_2021-05-08_17-13-52.png
The same behavior of Cycles can be achieved in corona and Fstorm in 3ds Max.

MCurto
Posts: 7
Joined: Sun May 09, 2021 5:28 pm

Re: Would it be possible to get Alpha on Glass Materials?

Post by MCurto » Sun May 09, 2021 9:36 pm

Dade wrote:
Sun May 09, 2021 8:52 pm
You have just to use Glass + material transparency (probably called opacity in Blender) and you get a Cycles-like alpha channel.
I don't even think Cycles is ok, its closer but not ok.The light reflections really shouldnt keep that much Alpha, those are reflections on a glossy surface that should cancel the transparency. Think Lux just could "do it better". Putting transparency on a glossy light reflection is a bit "weird".

User avatar
Dade
Developer
Posts: 5343
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Would it be possible to get Alpha on Glass Materials?

Post by Dade » Sun May 09, 2021 10:29 pm

You can not have the rays follow the refracted direction and go straight at the same time without any kind of mix (for instance 50% and 50%). Otherwise you would create energy out of thin air (i.e. breaking the energy conservation law).

Given the rendering of a glass sphere over a plane with a sky, post how you would like to have the RGB and Alpha result.
Support LuxCoreRender project with salts and bounties

MCurto
Posts: 7
Joined: Sun May 09, 2021 5:28 pm

Re: Would it be possible to get Alpha on Glass Materials?

Post by MCurto » Sun May 09, 2021 11:15 pm

Not sure I understand your proposition,Im a post-producer/retoucher that took interest in 3D not long ago, I'm obviously not very skilled at 3D and certainly not a physicist, but being a unbiased rendering engine+physically based just stating that giving transparency to a whole object material is probably not the way to go as light reflections shouldn't carry the same transparency change.At least as far as my logic goes.And I don't mean any disrespect by that, I honestly ignore the inner workings of that.

I can composite my way out of it, mixing black and white blackground+ diference in both and inverting the result for a mask and a bit of tweak for shadows reflectionns..whatever...this is actually kind of what I was expecting in the first place:
Screenshot 2021-05-10 at 00.05.02.jpg
Just stating that its obviously possible to get better results, as Cycles does to some extend, but again: I dont know the differences between the two, maybe its not possible in Lux?

A Glass over a plane with Sky?I

JulianoLisboa
Posts: 101
Joined: Sat Feb 22, 2020 3:29 am

Re: Would it be possible to get Alpha on Glass Materials?

Post by JulianoLisboa » Mon May 10, 2021 2:41 am

I will post here images of the corona shadow catcher with transparent glass with refraction.


Corona Beauty pass
corona.jpg
Corona shadow catcher transparent mode
corona_shadow_catcher_transparent_mode.jpg
Corona alpha
corona_alpha.jpg
Within the settings of the corona shadow catcher material, we can choose between solid (such as luxcore, without glass transparency), composition (with shadows) and the always transparent mode (with transparent glass and alpha channel).

corona Shadow catcher material.jpg
Hope this helps

Juliano Lisboa

Post Reply