Hide portals (doors/windows) when the surrounding wall piece is hidden
The portal saga continues – but we are getting closer to the end of it. While at first glance the portals and the surrounding walls are a unit they are actually drawn very differently, as the portals themselves are actually models, while the wall pieces are geometry which is calculated programmatically.
This distinction requires a special solution to determine when portals need to be hidden. Luckily, the code that determines whether a given wall piece needs to be drawn lowered could be refactored and re-used, getting the information into the shaders was slightly more tricky, but it got there in the end. Check it out below! 🙂