Glass Shader

Started by Matt, November 25, 2014, 11:04:39 PM

Previous topic - Next topic

Matt

[attachimg=1]

Hi everybody,

I want to show you one of the features I was working on for the upcoming Terragen v3.2. It's a new Glass Shader.

There were a number of problems with rendering transparent materials in TG. You've been reminding me of this for years! I set out to fix that. You can apply the new Glass Shader (or the Water Shader like before) to a variety of objects and get much better results than before.

Along the way I thought there should be a dedicated "Glass Shader" that has better defaults for glass and similar-looking materials. It has most of the important settings from the Reflective Shader (except for some of the lesser-used options, because I wanted to simplify it), combined with the subsurface features of the Water Shader, so you can make things like smoky or tinted glass.

It also has a setting to control whether the object's surface is treated as an infinitely thin volume without refraction instead of an interface into or out of a volume. You might turn this on for window panes, for example, or turn it off for gemstones and blocks of ice. It works independently of the index of refraction value.

By the way, the "caustics" in this render are not really caustics. They are simply GISD doing its thing.

We'll release v3.2 very soon :)

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Upon Infinity

GIMMIE!    ;D



Seriously, though, I was just going over on how to create glass.  Good timing!   8)

yossam

Thank you................. ;D

AP

Question. Can this shader become heavy upon render time?

Dune

As far as I tested it, it doesn't make any difference with the water shader, it mostly depends on the displacements, like before. So, not hugely more at all.

AP

That make sense because the more displacements, the more light refractions have to calculate due to the surface variations if I am understanding this correctly.

russe166

Oh, that's great!  :D
May I ask whether there is also an option for the shadows?


TheBadger

Very nice bit of news!

What does the render look like form inside the glasses looking out? And does any change need to be made to settings, or can you move the camera in and outside with out making any changes and still get a proper look?
It has been eaten.

Matt

Quote from: russe166 on November 26, 2014, 04:23:08 AM
Oh, that's great!  :D
May I ask whether there is also an option for the shadows?

You can turn an object's shadows on and off, as normal. But the shader doesn't change the shadows. To render this sort of thing properly you need to be able to render caustics, which Terragen doesn't do yet. I will think about adding some options that can change the look of glass shadows in future.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

Quote from: TheBadger on November 26, 2014, 02:44:35 PM
Very nice bit of news!

What does the render look like form inside the glasses looking out? And does any change need to be made to settings, or can you move the camera in and outside with out making any changes and still get a proper look?

Do you mean as if it's embedded in the glass material? It should still render the refraction correctly as long as the object normals are correct, but it won't render the internal volume density or decay (attenuation according to Beer's law) which only work when the camera is looking into the object from the outside.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

PabloMack

Matt, I am in the midst of struggling with this problem of getting transparency to work on a project, specifically, windows on a house. I just so happened to search for and read a thread about how to use the water shader for this purpose just yesterday. So far I have not gotten it to work. The new shader will be very much appreciated indeed! I'll let my director know that this feature is in the works.

Using Terragen for an upcoming project seemed as though it was going to depend on having this feature. supporting transparency is very important indeed.

Have you given any thought to supporting luminance? It's not as important but I needed it yesterday (quite literally).

Oshyan

Materials already support luminance, and luminance affects GI as well. Or did you mean somehow related specifically to transparency?

- Oshyan

PabloMack

#13
Quote from: Oshyan on November 26, 2014, 05:53:04 PMMaterials already support luminance, and luminance affects GI as well.

I have an object that has a luminous surface that I converted to an OBJ and then imported to TG. I was assuming that luminance was being carried over into the model and because the surface was not luminous in the render I concluded that TG was not supporting luminosity. Well, I just went into the model's node tree and saw the Luminosity parameter was set to 0. After setting it to 100 and then rendering I see now that it is working. That is wonderful.

I did some more work/research and discovered that it is the "Ke" parameter in the MTL (stands for "material"?) file accompanying the OBJ that encodes luminosity in the object's surface (i.e. "material"). A value of "1" apparently represent 100% because that's what I had the luminosity set to in my modeler. So it looks to me now that the OBJ reader ignores this parameter when it reads in the OBJ and sets the luminosity to 0 making it necessary for me to set the value manually. Perhaps this is why transparency wasn't working for me earlier.

Oshyan

Yes, importing of parameters from external formats isn't always perfect.

- Oshyan