Weird refraction in glass material

hey I’m still very new to UE4 and still figuring stuff out.
anyway I made a glass material for my windows using this tutorial: Using Refraction | Unreal Engine Documentation
(my material looks exactly like the 4th image)
but it gives these weird refraction or reflection at certain angles:

can anyone explain why does this happen, and how to fix this?
and if anyone can give me a tutorial for a good high quality glass material for architectural project, that would be very helpful.
thanks in advance.

if this question was already answered i apologize, as i looked, and didn’t find anything, nor did i figure out how to look for this specific problem anyhow.

thanks again.

Do you mean the splotches? Those are either lensflares or a bloom dirtmap (or both), both are post processing effects which can be disabled in the post processing options. Glass looks okay.

Check out some of the free marketplace examples for different glass materials.

Reduce refraction value to a very low value(like 1.05) or remove it altogether.

1 Like

wouldn’t that just make it just like air? and thus making the glass material useless ? (i come form a cg background)

Can you post picture and underline the oddiness.

If you look at a window(not just glass) like that in real life you would notice refraction only at extreme angles, which isnt worth it to be honest. Increasing metallic and specular values will give you enough reflections so that it wont be completely translucent. In other situations like wet or old, wobbly glass you’d mask refraction with a texture to prevent ghosting problems like this as much as possible and still have the refraction effect.

thanks for the reply i will try this today

Whats probably happening is your refrection value is too strong which means the windows are trying to grab pixels they dont’t have access to in the right depth.

In reality, if you somehow had refraction that strong, you would actually see around the window frame, in effect seeing new geometry that you wouldn’t normally see from that angle. Such intense refraction is not possible in ue4 since refraction is based on the screen texture. So the light cannot look around the corner to see what would have been there. Once you try to refract enough to see pixels outside the frame, it will instead show foreground pixels or possibly nothing (as in the refraction may vanish for those pixels which looks just as bad).

The same thing happens along the edge of the screen in a square shape if you try to use really high values since you are seeing them clamp up against the border of the scene texture.

In real life the apparent strength of window refraction is based on the viewing angle and thickness of glass. I used to have a fish tank with 3/4" thick glass and compared to that, the thickness of normal windows does not produce very much refraction at all. You have to strive to notice it. Even for 3/4" its only strong from the side.

thanks for the explanation, i ended up removing the the refraction all together, and instead used a material function to make the glass reflective at certain angles. thank you all for your help

Removing refraction for windows is as you’ve noticed a good idea. I don’t know about the material function you used, but I find that using a fresnel node for transparency is a good and not too expensive way to get glass looking like it should. Just a tip to try.