PDA

View Full Version : Glass refraction



taz1004
06-26-2012, 10:25 AM
This may be common knowledge but I just figured it out so I thought I'd share.

One of the downsides of using UDK for architecture was making realistic looking glass. And that comes from refraction. This obviously is not real refraction but the effect is very close and convincing. Connect fresnel to distortion. Default fresnel effect may be too strong so multiply with constant (0.3 seems to be good value) to reduce the effect.

If you have better way or other ways to improve this, please share.

Here's sample of the effect. It enhances the edge of the glass as well. This effect obviously looks much better in motion.

http://www.tripod3d.com/tripod3d/downloads/refraction.jpg

Icemopper
06-26-2012, 01:53 PM
That looks pretty great, and I'm sure in motion it is even better. I think it is one of those details that people just don't think about, but their eye picks up and it adds a whole new level of realism without them even realizing it.

taz1004
06-26-2012, 03:00 PM
That looks pretty great, and I'm sure in motion it is even better. I think it is one of those details that people just don't think about, but their eye picks up and it adds a whole new level of realism without them even realizing it.
Yea, it's actually one of those things that people don't notice if it's there. But notice it if you don't have it. I had people mentioning that the glass looks flat before I used this. But now no one says anything about glass.

Tom Shannon
06-26-2012, 06:51 PM
Wow! that's really nice looking. Good to see some traditional arc-viz in here. "Boring" shopping malls full of mudane details are the bread and butter of this industry, but all you see are the 'crazy' projects.
As for the glass, I do something similar, my big difference is putting a less translucent edge on the glass. That really helps pop the shape of the glass:
http://i01.i.aliimg.com/photo/v0/340149215/PVB_Film_for_Architectural_Glass.jpg

Tom Shannon
06-26-2012, 07:11 PM
Oh, there's another trick/info:
The distortion node uses a vector to distort in the requested direction. That means a bare Fresnel into the distortion slot will create a distortion that always moves from 0,0 (black:0,0,0) to 1,1 (white:1,1,1), so it always shifts the sample up and to the right (shifting the image down and to the left). By multiplying the Reflection Vector by a fresnel, you can make your distortions a little more dynamic:
http://content.screencast.com/users/kopar/folders/Jing/media/63a6657d-b6fe-46e9-95e2-21a9dac6edc5/2012-06-26_1708.png
Just Fresnel:
http://content.screencast.com/users/kopar/folders/Jing/media/506bdd27-edf9-4a81-a13e-4b105cdf9787/2012-06-26_1712.png

taz1004
06-26-2012, 07:26 PM
I used to add separate material on the edge too but extra draw call just for that seemed... I donno... inefficient. Also with real glass, depending on the angle, edge are sometimes darker and sometimes lighter.

Reflection vector with fresnel sounds like a great idea. Will try it out.

Tom Shannon
06-27-2012, 01:02 PM
Do you do a cube-map or just a simple projection map for your reflections?

taz1004
06-28-2012, 07:35 PM
I usually use cube map. I didn't know there was projection map in UDK.

bukkit
07-13-2012, 06:17 AM
i made an UDK glass materials tutorial a while ago.
could be useful in this thread

http://forums.epicgames.com/threads/789955-Realistic-Glass-Materials-in-UDK

Tom Shannon
07-16-2012, 01:04 PM
Everything I know about glass in UDK I learned from that tut! :D

bukkit
07-16-2012, 07:06 PM
glad to hear that :)

Frontop
08-08-2012, 06:01 AM
Looks great.