# Frosted Glass Shader

**URL:** <https://forums.chaos.com/t/frosted-glass-shader/51680>\
**Category:** General\
**Created:** [November 12, 2014, 5:08pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680 "2014-11-12T17:08:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyepiz](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/eyepiz/32/7037_2.png) [@eyepiz](https://forums.chaos.com/u/eyepiz)\
**Post date:** [November 12, 2014, 5:08pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/1 "2014-11-12T17:08:18Z")

</div>

Hi All!

I have an animation running where I was cruising about 20 to 30 min a frame, until I got to a scene where I have a lot of opaque glass pieces on top of the cubicle partitions. noting to crazy but it’s killing my render times 1 and half hour frames!

Diffuse: Black  
Reflection: 148, 148, 148  
Refl, glossiness: 1

Refraction 228, 228,228  
Glossiness .095

Does anyone have any suggestion on optimizing this shader? or making a fake one that renders faster?

I would appreciate any advise!

Thanks!

---

<div class="post-metadata">

**Author:** ![Neilg](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/neilg/32/7044_2.png) [@Neilg](https://forums.chaos.com/u/Neilg)\
**Post date:** [November 12, 2014, 7:35pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/2 "2014-11-12T19:35:22Z")

</div>

are you willing to render in passes and use a compositing app?  
You can render out the glass fully reflective as a seperate pass, use that alpha as a mask for z-depth blur on the base render and add the reflection pass back over the top of it.

---

<div class="post-metadata">

**Author:** ![eyepiz](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/eyepiz/32/7037_2.png) [@eyepiz](https://forums.chaos.com/u/eyepiz)\
**Post date:** [November 12, 2014, 8:08pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/3 "2014-11-12T20:08:57Z")

</div>

> [@invert animation keyframes](https://forums.chaos.com/t/invert-animation-keyframes/46132/4):
>
> are you willing to render in passes and use a compositing app?  
> You can render out the glass fully reflective as a seperate pass, use that alpha as a mask for z-depth blur on the base render and add the reflection pass back over the top of it.

Yes…I use after effects to comp.

Here is the situation I have glass though glass will your suggestion work?

Thanks!

---

<div class="post-metadata">

**Author:** ![Neilg](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/neilg/32/7044_2.png) [@Neilg](https://forums.chaos.com/u/Neilg)\
**Post date:** [November 12, 2014, 10:11pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/4 "2014-11-12T22:11:44Z")

</div>

you’d have render each layer of glass separately… yeah that’s not an easy one.  
You could try lowering the amount of blur so there’s just enough and rendering it noisy, then in AE blur it a little more with a multimatte mask to smooth out the noise. then add the sharp reflection back on, if you even see it.

---

<div class="post-metadata">

**Author:** ![Morbid\_Angel](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/morbid_angel/32/21272_2.png) [@Morbid\_Angel](https://forums.chaos.com/u/Morbid_Angel)\
**Post date:** [November 12, 2014, 10:49pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/5 "2014-11-12T22:49:22Z")

</div>

why not render sharp refraction then just blur the refraction pass in comp and add it back as blurred?

---

<div class="post-metadata">

**Author:** ![ben\_hamburg](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@ben\_hamburg](https://forums.chaos.com/u/ben_hamburg)\
**Post date:** [November 13, 2014, 10:48am UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/6 "2014-11-13T10:48:47Z")

</div>

> why not render sharp refraction then just blur the refraction pass in comp and add it back as blurred?

Anybody actually tried this succesfully? Does it hold up?  
I do mostly animations and only use wireocolor/zdepth for compositing, but if this works I´d consider putting out some more passes in the future…😉

Don´t even know how often I built some pretty shaders with glossy refractions and then through it away because it was killing my render times…

---

<div class="post-metadata">

**Author:** ![svetlozar.draganov](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/svetlozar.draganov/32/53004_2.png) [@svetlozar.draganov](https://forums.chaos.com/u/svetlozar.draganov)\
**Post date:** [November 13, 2014, 1:38pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/7 "2014-11-13T13:38:08Z")

</div>

Glossy Refractions are usually calculated very very slow.  
There is an option to optimize them via interpolations but this of course will reduce the quality although it worth to try it at least for the objects in the distance.  
You may also reduce the global override depth value to a lower number like 2 for example, this could speed up the rendering a lot especially on scenes with a lot of refractive objects behind each other.

---

<div class="post-metadata">

**Author:** ![alexyork](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/alexyork/32/271382_2.png) [@alexyork](https://forums.chaos.com/u/alexyork)\
**Post date:** [November 13, 2014, 2:54pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/8 "2014-11-13T14:54:46Z")

</div>

You could consider rendering out a pass where only the glossy refracted objects are visible, but render it with lower AA and at a lower resolution. Then scale it up and denoise in post.

---

<div class="post-metadata">

**Author:** ![kalamazandy](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kalamazandy](https://forums.chaos.com/u/kalamazandy)\
**Post date:** [November 13, 2014, 7:51pm UTC](https://forums.chaos.com/t/frosted-glass-shader/51680/9 "2014-11-13T19:51:53Z")

</div>

my thought is to put the material in an override. The refraction of the second glass should be a very simplified version. It’s already glossy right? You don’t need the refracted piece to look nice. GI also doesn’t need to see a very high quality representation of the material. I think refraction is where you’re really getting hit though.

Also, I’d Definitely look into using interpolation.

And lastly, you Could do the whole thing in post. Render them all as plain glass. Then render to AfterEffects and create planes in after effects that match where each glass should be. Apply the blur to those as layer effects. That way the blur gets stronger as they overlap, as they should. This would definitely take some time to set up, but the render time would be fast.
