Page 1 of 2

1.x: Glass Tutorial

Posted: Tue Jun 06, 2006 5:27 am
by Mihai
This is by no means THE glass, just some general suggestions. You can always alter the parameters like transmission, reflectance to get different looks.

First version:

Image

Settings:

Image

Going through the settings:

Reflectance (0°)
I decided I want very reflective glass so I set this pretty high, 218. This is actually too high, if you compare with one of the glass ior files (bk7 for example) it's reflectance would be much less than 218, perhaps around 80.

Reflectance (90°)
I left this at default white since I don't want tinted reflections at grazing angles. Usually only metals tint the reflection to their own color.

Transmittance
This controls the color and also the intensity of light rays passing through the glass. If you leave it at black it's as if the material is opaque.

Transmittance is a pretty sensitive parameter so change values in small increments.

Note: If ND is set to 1 and transmittance is set to 255, than the clipmapping feature will kick in.


Attenuation distance
Controls how far a light ray can move through an object before losing half it's energy. If you set this parameter very low, no light will actually pass through to the other side which gives transparency. I set it to 2cm since I thought it would be a "normal" setting for the usual glass. Think that you are shining a light through a glass panel 2cm thick, the light will lose a lot of it's initial energy passing through all that glass.

It's important to understand the attenuation distance works together with the transmittance. For example you can set transmittance to a very saturated blue, but if you set the attenuation distance at 999M and the glass panel in your scene is only 3mm thick, then the light rays passing through it will not have time to become tainted with blue. You will get completely colorless glass.

ND
Controls amount of light refraction. Here I set a typical of 1.55. Denser glass would have a bit higher nd, like 1.63.

Roughness
I didn't want any frosted glass, so I set roughness at 0, completely smooth glass.


Now changing only the transmittance from 200 to 100, we get a more "smoky" glass look:

Image

Lowering the transmittance even more, to only 20, the glass looks much darker overall, that is the thickness of the glass bottle doesn't matter too much, all of it looks darker:

Image

What if instead of setting the transmittance 10x less (from value 200 to 20), we lower instead the attenuation distance 10x (from 2cm to 2mm)?

Attenuation 2mm:
Image

The glass looks brighter, except the parts which are thicker, they look slightly more solid. This is because this particular model has a very small thickness and even a 2mm attenuation distance will still make it transparent. So if you wanted this model to look like tainted glass, it would be difficult to do that only lowering the attenuation distance, you would also have to make the transmittance color pretty saturated and not too bright. The next glass shows this:

Image

This is a 2 bsdf glass, with a weightmap controlling the influence of each bsdf.

The settings and weightmap:

Image

The glass object was simply mapped with a flat projector.

The weightmap was inverted for the other bsdf layer.

You can see the transmittance color for both bsdf's is pretty dark, so this thin object can still look tainted. One bsdf has the attenuation distance at 2mm, the other at 1cm. As mentioned above, having the attenuation distance smaller will make the glass tint "faster".

You can ofcourse have different nd for the two glass materials.

Posted: Tue Jun 06, 2006 5:32 am
by jjs
Thanks for tutorial Mihai


- however some of your image links are broken

Jonathan

Posted: Tue Jun 06, 2006 5:37 am
by aitraaz
hmmm very nice the orange glass, the clear glass examples seem to be missing something. Good tutorial anyways....

Posted: Tue Jun 06, 2006 5:41 am
by Mihai
Try reloading the page, should all be there.

Posted: Tue Jun 06, 2006 5:54 am
by jespi
Thanks you very much Mihai :wink: . Very clear tutorial.

Re: Glass tutorial

Posted: Tue Jun 06, 2006 6:02 am
by tom
Mihai wrote:Do not set it at 255 RGB since that kicks in the clip mapping feature.
Only if the Nd=1, otherwise 255 transmittance doesn't mean clipping. So, you don't need to worry about it for the glass. ;)
Thanks for this tutorial and clean renders, Mihai!

Note: Bumpmap blurs the bottom and with high reflectance this seems like a shiny topcoat color acryllic.

Posted: Tue Jun 06, 2006 6:04 am
by DELETED
DELETED

Posted: Tue Jun 06, 2006 6:05 am
by Mihai
Oh, forgot, thanks tom! Updated it...

Posted: Tue Jun 06, 2006 7:59 am
by samsam
Great stuff Mihai - thanks for this. :D

Posted: Tue Jun 06, 2006 8:49 am
by sandykoufax
Great and very useful tutorial, Mihai. :D

Thank you very much. :D :D

Posted: Tue Jun 06, 2006 1:40 pm
by vinys
Thanx :D !

- vinys

Posted: Tue Jun 06, 2006 1:47 pm
by Hervé
very nice tutorial Mihai... good explanation.. :wink:

Posted: Tue Jun 06, 2006 1:57 pm
by jotero
very nice work Mihai :)
but where the scene for testing :wink:

ciao
torolf

GREAT!

Posted: Tue Jun 06, 2006 3:51 pm
by adl
GREAT Mihai,
give us this wonderful scene and obj to test!!! :D :D :D

ADL
www.imagonet.it

Posted: Tue Jun 06, 2006 4:11 pm
by bugyboo
thanks Mihai,, great tutorial..