How to make fake Glass

Hey Guys,
I’m working on a scene, where the camera looks through a dirty window into a landscape.
I normally bring my renders into Nuke, splitting them up into different layers + using cryptomatte to composite the final shot.
The problem is, that when looking through glass, you can’t have the background be transparent. I guess that has something to do with refraction etc.

What is the best way to get this window seperate from the rest, being able to composite it on top of the rest later? I want to to some comp on the outside, before adding in the window on top.

I’ve tried switching the glass shader with a transparent shader. This keeps all the dirt, since that was done by mixing in a diffuse shader. But I lose all the imperfections I added to the roughness input of the glass shader.
Is there a way to have fake glass, where I still have roughness, maybe even some refelctions, but still being able to get transparency for what is behind it?

Have you tried to check ‘Transparent Glass’ in FIlm>Transparent tab in Properties panel?
film

1 Like

Please @DerMalt don’t forget to tell us if this solves your question or not, so that other users with the same problem know

Sorry. It did not solve the problem. What I did instead was to not use a glass shader, but instead just a transparent shader. Instead of the scratches in the roughness input, I mixed in a white diffuse shader and matched the color. It does not react the same way to light, but for my scene this works.
Not sure what the “correct” way is in this case, so if anyone has a better Idea, I would love to hear it.

Ok, this happens because the scratches texture is, obviosuly :grimacing:, greyscale and connected to roughness the ‘Transparent Glass’ makes transparent only the black parts (a short video below).
I didn’t think about it. So you can approach it in different ways, like render a clean glass with ‘Transparent Film’ activated (in that way you get reflections anyway) and using mask (transmission render passes or cryptomatte) to easily apply scratches after in comp.

1 Like