Would it be possible to get Alpha on Glass Materials?

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dez!
Posts: 307
Joined: Sun Apr 08, 2018 1:09 am
Location: Ekaterinburg
Contact:

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

Post by Dez! » Mon May 10, 2021 4:08 am

https://i.imgur.com/lE6Kd2p.png
Probably it is wrong
Linux Plasma | Ryzen 5, 32Gb, SSD M2, GT 590 RX | BenQ 27 | Wacom One | Microsoft Ergo | Tie Guan Yin tea
http://dezigner.tilda.ws/

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

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

Post by Dade » Mon May 10, 2021 8:41 am

JulianoLisboa wrote:
Mon May 10, 2021 2:41 am
Corona alpha
corona_alpha.jpg
They may have the alpha value related to the amount refraction (more refraction = more white). Can you you run the same test with a sphere and post the alpha channel ?
Support LuxCoreRender project with salts and bounties

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 12:34 pm

Dade wrote:
Mon May 10, 2021 8:41 am
JulianoLisboa wrote:
Mon May 10, 2021 2:41 am
Corona alpha
corona_alpha.jpg
They may have the alpha value related to the amount refraction (more refraction = more white). Can you you run the same test with a sphere and post the alpha channel ?
Yes sure. Here it is.
sphere_beauty.jpg
sphere_beauty.png

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

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

Post by Dade » Mon May 10, 2021 2:24 pm

JulianoLisboa wrote:
Mon May 10, 2021 12:34 pm
Yes sure. Here it is.sphere_beauty.jpgsphere_beauty.png
What is the difference between the 2 spheres ? Is it the amount of reflection ?

It seems to set alpha=0 if the ray is transmitted or alpha 1.0 if it is reflected :idea:
Support LuxCoreRender project with salts and bounties

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 3:38 pm

Dade wrote:
Mon May 10, 2021 2:24 pm
JulianoLisboa wrote:
Mon May 10, 2021 12:34 pm
Yes sure. Here it is.sphere_beauty.jpgsphere_beauty.png
What is the difference between the 2 spheres ? Is it the amount of reflection ?

It seems to set alpha=0 if the ray is transmitted or alpha 1.0 if it is reflected :idea:
The one on the left is solid and the one on the right is thick (solidify)

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

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

Post by Dade » Wed May 12, 2021 2:15 pm

JulianoLisboa wrote:
Mon May 10, 2021 12:34 pm
Yes sure. Here it is.
sphere_beauty.jpg

sphere_beauty.png
This doesn't make sense, you have a solid background in your rendering and the alpha channel of that rendering is, by definition, all white (with or without the 2 glass spheres, it doesn't matter). You are using something else, not the alpha channel. Please render a glass sphere over a plane like this (RGB and Alpha):

normal.jpg
alpha.jpg
alpha.jpg (4.71 KiB) Viewed 925 times

We can argue about the alpha channel of pixels belonging to the sphere but the alpha of plane pixels must be 1. Otherwise you are using some kind of shadow catcher or similar.
Support LuxCoreRender project with salts and bounties

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 » Wed May 12, 2021 5:01 pm

Hello Dade, so ... Yes I am using a shadow collector, but that has been talked about since the beginning. The use of this is to be the transparent glass when you have a product in the studio for example. So I believe that it is the shadow collector that has to be changed.
Esfera1.jpg
Esfera_alpha.jpg

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

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

Post by Dade » Thu May 13, 2021 12:29 pm

JulianoLisboa wrote:
Wed May 12, 2021 5:01 pm
Yes I am using a shadow collector, but that has been talked about since the beginning.
The first MCurto's post in this thread talks only about alpha channel, they are 2 different topics.

I reworked how alpha channel is handled for purely transmitted eye paths and the result should match what was asked:

normal.jpg
alpha.jpg

This change is available in v2.6 daily builds.

The last question is if this new behavior should be used far all kind of transmitted paths (like in the new code) or only for specular one (i.e. glass but not rough glass, glossy translucent, etc.).
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 » Thu May 13, 2021 12:50 pm

Hoah!Thaks a lot, will test, and give feed back!Looks great.

I guess because I'm a bit new to the whole scene maybe I'm not calling things by their names but the ability to have transparency (alpha?) on a glass material believe its invaluable for people who are more focused on the kind of studio stills like product rendering and stuff, I work a lot with glass and liquids (photos) and I'm sure this will prove very handy to help me try to integrate 3D more often.

Anyway: thanks!

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

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

Post by Dade » Thu May 13, 2021 1:05 pm

MCurto wrote:
Thu May 13, 2021 12:50 pm
I guess because I'm a bit new to the whole scene maybe I'm not calling things by their names but the ability to have transparency (alpha?) on a glass material believe its invaluable for people who are more focused on the kind of studio stills like product rendering and stuff, I work a lot with glass and liquids (photos) and I'm sure this will prove very handy to help me try to integrate 3D more often.
The reason I was not marking the glass as transparent is because you are not seeing directly what is beyond the glass but the ray is refracted and it lands in a different part of the sky.
So, if you use this new alpha channel for some kind of background compositing, you are not really ending with an accurate result. But I guess "something" is till better than "nothing"
Support LuxCoreRender project with salts and bounties

Post Reply