Forum

#1 2017-04-30 17:12:05

sachalek
Member

glass refraction problem

Hi,

I have a problem that's a bit difficult to explain so I'm attaching an image. I have a character wearing glasses, and I can see the character's face through the glasses, but not the background. I am testing with everything in the same render layer. When the glass is set to "thin glass", I can see the background, but I'd rather have normal glass to get a bit of distortion. In the image, you can see that the white blinds in the background are not in the glasses. We rendered an animated sequence where the character moves, and it's like this in every frame.

I've tried changing the ray depth to 4, and increasing the ray length, but it didn't work. I don't understand ray length and it's not explained in the documents.

https://drive.google.com/file/d/0B_h6O- … sp=sharing

I don't think Phillip will be back in school next week, so I hope someone on the forum can help.

Thanks,
Sarah

Offline

 

#2 2017-04-30 17:31:32

sachalek
Member

Re: glass refraction problem

Followup:

I reset the absorbtion color and ray depth to their default values and it fixed the problem. Originally, I had changed the absorbtion color to make the glasses slightly tinted. I don't understand why that would make the background completely black. Can you please explain Ray Depth and Ray Length and how they interact with absorbtion color?

Thanks,
Sarah

Offline

 

#3 2017-04-30 17:52:55

subdproxy
Member

Re: glass refraction problem

Thanks for posting a follow up to your problem. I had some trouble with glass in the past and never solved it. This will help others in the future!

Glen

Offline

 

#4 2017-04-30 17:53:12

sachalek
Member

Re: glass refraction problem

Also, is there any way to have an alpha channel in my refraction pass? I guess that's impossible.

Offline

 

#5 2017-05-09 18:53:39

hulud
Guerilla dev, the guy to hug

Re: glass refraction problem

Hi Sarah,

Ray length is the maximum distance a ray can travel before to hit an object in world space. It is by default very large (like 10.000 units) but it may be useful to reduce it in some situation, like in a forest, you may want to make the light "enter" the forest by reducing the length of the direct lighting rays. In your situation, there is no need to change it.

Ray Depth means how many time the ray is bouncing in the scene in a single light path. This attribute is critical in refraction scenari. The default Guerilla settings is 4 refraction bounces, which are enough for two double refractive surface, so you should be fine too with the default setting here.

For the absorption, If your glass is composed of a single surface and you are using a DoubleSided glass, Guerilla thinks everything behind the glass surface is "inside" the glass, so it applies absorption on it, which is the required behavior. You may have everything black in this situation.

Glass surfaces in ThinGlass mode should not have absorption, in Guerilla 1.4, it is an undefined behavior to render a ThinGlass object with absorption. It is ignored in Guerilla 2.0.

To color a single surface glass, use the Glass Color instead.

Best and sorry again for the delay,

Cyril


Cyril 'Hulud' Corvazier
Guerilla developer
http://www.mercs-eng.com

Offline

 

#6 2017-05-14 15:49:49

sachalek
Member

Re: glass refraction problem

Thanks Cyril! I'm still having some problems with the glasses. It's difficult because our character moves a lot and her glasses are constantly changing angle. Sometimes the glass looks black from certain angles, and sometimes it becomes a mirror-like surface. It could be the environment. It's ok though, we change it to thin-glass when there are problems.

P.S. We're really happy with the bevel-bumpmap and the exr-ID's! It saves us a lot of time.

Offline

 

#7 2017-05-16 20:44:05

sachalek
Member

Re: glass refraction problem

Here is another example of a problem we have with the glasses. This is just a standard glass material and it reflects our character's eyes from the back. https://drive.google.com/file/d/0B_h6O- … sp=sharing

Offline

 

#8 2017-05-17 11:29:29

Ben
Guerilla dev, the guy to hug

Re: glass refraction problem

Hi Sachalek,

Is the lens geometry single sided, or is it thick?
If it is a single face, then the shader will not operate properly, and you *must* use Glass Mode = Thin Glass.
If it is a thick lens (with a front facing side and a back facing side) then you *must* use Glass Mode = double Sided.

In french, in case my english doesn't make so much sense:

Est-ce que la geometrie de la lentille est une face simple, ou est elle epaisse ?
Si c'est une face simple, alors le shader ne marchera pas proprement et il *faut* utiliser le Glass Mode = Thin Glass.
Si la lentille a une epaisseur, alors il faut utiliser le Glass Mode = Double Sided.

Can you send me a sample frame of this, so I can have a look at the setup?

Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#9 2017-05-18 14:30:15

sachalek
Member

Re: glass refraction problem

Hi Ben,

Thanks for the explanation! Now I understand, the reason Double Sided gives us weird results is because our glasses have a single face.

Merci beaucoup ! Maintenant je comprends que Double Sided nous donne des resultats bizarres parce que notre lentille est une face simple.

Sarah

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB