# Looking for tips on how to create a proper mask for windows

**URL:** <https://forums.chaos.com/t/looking-for-tips-on-how-to-create-a-proper-mask-for-windows/63494>\
**Category:** General\
**Tags:** glass, mask, window, rendermask\
**Created:** [April 18, 2017, 7:30pm UTC](https://forums.chaos.com/t/looking-for-tips-on-how-to-create-a-proper-mask-for-windows/63494 "2017-04-18T19:30:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinybot](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/tinybot/32/19972_2.png) [@tinybot](https://forums.chaos.com/u/tinybot)\
**Post date:** [April 18, 2017, 7:30pm UTC](https://forums.chaos.com/t/looking-for-tips-on-how-to-create-a-proper-mask-for-windows/63494/1 "2017-04-18T19:30:06Z")

</div>

In this image below, I’m trying to figure out how to create a mask of the window glass pane so that I can do a basic exterior background image replacement in post-production.

Usually what I’ve done in the past is to set a wire color for the glass pane, and use the VRayWireColor render element to give me something to work with in Photoshop.

However, in this case, because of the angle, if I used this same approach, I would end up with a mask represented by the Yellow sample region. This would mean losing the exterior side of the window frame. Ideally what I want is a mask that looks more like the Red region.

I’ve also tried playing with the RenderMask script - but haven’t been able to quite produce the mask I’m after here.

I suppose I could remove the glass panes, and use a temporary object that covers the viewable window space on the outside, and use that to create the mask, but then I would lose the glass reflections and would need a separate render pass to merge reflections back in - I’m hoping there’s an easier way?

 ![Window Masking Question.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/6/b/6b89f1fb11889b089fc08b874bfcb7b223ae43e3.jpeg)

---

<div class="post-metadata">

**Author:** ![tinybot](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/tinybot/32/19972_2.png) [@tinybot](https://forums.chaos.com/u/tinybot)\
**Post date:** [April 18, 2017, 9:50pm UTC](https://forums.chaos.com/t/looking-for-tips-on-how-to-create-a-proper-mask-for-windows/63494/2 "2017-04-18T21:50:26Z")

</div>

Managed to find an answer for this from a some-what related thread:

[https://forums.chaosgroup.com/showthread.php?93793-Alpha-in-a-reflection](https://forums.chaosgroup.com/showthread.php?93793-Alpha-in-a-reflection)

In the Material Editor, I set the Refract “Affect channels” option for the window glass material to “Color+Alpha” and that gave me exactly what I needed in the Alpha channel / render element!

---

<div class="post-metadata">

**Author:** ![dlparisi](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/dlparisi/32/14236_2.png) [@dlparisi](https://forums.chaos.com/u/dlparisi)\
**Post date:** [April 20, 2017, 10:09pm UTC](https://forums.chaos.com/t/looking-for-tips-on-how-to-create-a-proper-mask-for-windows/63494/3 "2017-04-20T22:09:11Z")

</div>

This thread may help you out as well…[https://forums.chaosgroup.com/showthread.php?87292-How-to-make-glass-render-black-environment-with-VRay-sky](https://forums.chaosgroup.com/showthread.php?87292-How-to-make-glass-render-black-environment-with-VRay-sky)
