Glass Shader

Started by gregsandor, January 21, 2014, 08:49:40 PM

Previous topic - Next topic

gregsandor

I've been trying to get a decent glass shader working, based on a water shader.  My window glass is fully modeled (not just a single poly), double sided render is off.

When it renders, blotchy black artifacts appear.  Also, how do I allow some light to pass through so shadows cast by the glass are not fully shadowed, but only by the inverse of the opacity of the glass?

TheBadger

It would be very nice to have a real glass shader, Instead of using the water trick. The water shader is to limited in what you can do with it as glass. Or requires a ton of playing to get it to work well anyway. And people try to make glass a lot around here.
It has been eaten.

j meyer

One thing to remember would be to set the decay distance of the water
shader to 1e+010.
Fully modelled can cause more trouble than two panes that are not
connected.And each pane should have polies on one side and a hole
on the other,so that they are not doublesided.(judging from my experience)
As far as I know there still is no way to get the transparency affecting the
shadows.(of course you could render without the glass parts and another
pass with the glass and comp it,but...oh well)

gregsandor

Quote from: j meyer on January 22, 2014, 09:54:21 AM
... each pane should have polies on one side and a hole on the other,so that they are not doublesided ...

What do you mean by this?

gregsandor

#4
Here's the result with 6-sided panes:

TheBadger

#5
Correct me if Im wrong, J. But you mean is should be 5 sided? So that there is not an extra polygon on the inside, right?

It looks good Greg. But its to dark I think. And then there is the part on the far right that is so clear its as though nothing is there at all. THis is the primary problem with the water shader. Its inconstant, and changes with the light.

I had some luck using one polygon plain, it seemed to work better than the 6 sided I tried. But there were still problems. http://www.planetside.co.uk/forums/index.php/topic,15003.msg148185.html?PHPSESSID=fdcc073f924ae32981fa0b1f088ebecd#msg148185

We need a glass shader. The idea of Terragen being used for architectural visualization is kinda hard without glass that works right in all lighting.
That is if I understand the problem here, which I thought I did.

nice looking model by the way.
It has been eaten.

gregsandor

#6
Some of the darkness I think is because it is fully shadowing the interior of the building; it might as well be solid brick. What do Volume 1 Density and Color do?  Would that affect the look?  Also I don't like the blotchy artifacts that show up.

gregsandor

Here i tried to recreate Dandelo's (or yours) setup with the watershader as a child of a surface layer - notice the fuzzy interior.  (have either of you posted a clip file of that setup?)

TheBadger

#8
The last page of the link has a clip from Dune, and one from me too. Dune shows how some changes to what I did helps.
DandelO has a thread  where he uses a bee and its wings to demonstrate his thinking (there should be a link in my link, or one on  the first page of this part of the forum). I simply used DandelO's brain and applied it to what I was doing. If I remember right, I got better results when I used DandelO's method of adding a texture to the glass, but I went for a more aged unkept look. I dont know if that will be good for you here. *The point is that in a situation where the glass will be too clear and one where its too dark, can be compensated for by adding a dirt texture. So it will be visible that there is glass there when its clear, and when you back light it. SO it will work for more angles.

Quote from: gregsandor on January 22, 2014, 04:17:09 PM
Some of the darkness I think is because it is fully shadowing the interior of the building; it might as well be solid brick. What do Volume 1 Density and Color do?  Would that affect the look?  Also I don't like the blotchy artifacts that show up.

Well you can always add light sources to the inside of the building, which will help with the darkness part. But that has issues too and will require a fair amount of tweaking. And all that is dependent on the cameras position, relative to the glass, relative to the sun.
Sorry Greg, I haven't done glass in a while. I don't remember what effect if any Volume 1 Density and Color had. I have been modeling buildings that don't have glass lately.


*Ah yes, check the first page of my link. It has links to all the threads by others that I used.
It has been eaten.

gregsandor

#9
Okay, Ive attached Dune's water shader in that thread to your masking setup.  Still dark.

TheBadger

Yep like I said, we need a glass shader.

You should put some light on behind the windows?
It has been eaten.

Kadri

#11

Gregsandor did you tried basic planes?
Just curious because TG3 is probably trying to make all sides of your object to be transparent.
You may get this to work but i would not press TG3 to hard on this as it is.
I had mostly problems with this kind of renders.

dandelO

Hi, Greg.
I have problems with some objects and a transparency shader, generally, though, ray-traced objects tend to work fine for me. Thd built-in sphere renders noisy, black spots when atmosphere passes through it but a RT rock object renders that fine.
In all these GI tests following, the spheres are built-in rock objects and the tabletop they're sitting on is a 6 sided cube object, just like your windows, the transparency shader rendered them all fine.

Volume 1 Colour/Density creates a faked 'milky' effect, colour is self explanatory, density is how 'thick' the 'milkiness' appears. Imagine a muddy puddle, you can see through the water only so far until the mud volume obscures the transparency. However, there's a problem with the 'volumetric' shadowing in the water shader, in that the shadows appear very noisy along the edges, there are no quality settings, that I know of, that can reduce the noise. Raising render detail/ray detail maybe but that can't really be called a 'fix' as even full quality settings does not remove the noise and it's really wasteful of render time to go even higher. The error/effect looks similar to Soft-Shadows lacking samples on regular surfaces, noisy blurring, no smooth falloff. A water volume quality slider would be a handy thing here but I don't know how easy that would be to implement. The Water Shader 'volume' is a fake 2D approximation, not a full 3D volumetric effect.

dandelO

Plane and rock objects. There's no volume density on the left, 0.1 in the middle and 1 on the right. The volume settings are pretty much unusable when there are objects casting shadows into it, see the noise as volume density increases. Render detail at 0.8/AA=4. A ridiculous increas in detail would be required to clean that up!
Rendering a RTE version to test the shadow noise with that,

* Btw, in your glass object, are you unchecking Casts Shadows? You should.

dandelO

#14
* Ray tracing the water volume doesn't held remove all the noise, although it's better, it's still nowhere near usable. :/