Preventing rendering within an area

I am trying to prevent an area from rendering within a collider (or similar), I am aware of how to simply deactivate the renderer within a collider, but I want to hide only the parts within the collider, so I could hide PART of a face for example, I am doing this because my walls require multiple different materials (easier to do with separate pieces) and I also want to include lights, which are models which have to intersect with the wall and appear flush with it, which leads to the Z buffer getting confused and resulting in Z fighting, this is what I want to prevent, the Hammer engine for Portal 2, as well as other games with level editors does this very well, and I am trying to replicate the same effect, allowing me to build my maps easier.

Multiple renderers?

This would not prevent rendering in one single area, I want to be able to occlude a part of an object or part of a face, so some clever “smoke and mirrors” may be required for this

If it has to take place on part of a polygon or object you would need some shader trickery, by blending out the alpha per fragmeant based on its world position.

This would be a problem because the wall texture is tiled across it. So I am not sure how well a blended shader would work, or whether it would just create loads of tiled holes all over the place

Its done world space dosnt matter if it is tiled it does it based on the location of the frqgmeant in the world. Just a little complex to tight such a shader. But you more or less have to get the collider bounds into the shader, and use that data for some if statements.

Have you done this before, would you be able to supply a shader or example? we have one programmer and he does not work with shaders apparently.

Well I’m not home till late tomorrow but I will see if I can make a sample. Will warn you it would be a expensive shader, since it would need to do a “if” on every fragment