I would like to render 3d geometry with two different textures. Then having a quad in 2d space i want swap the texture sampler where the quad is occluding the 3d geometry. So basically sample tex1 but when quad overlays then sample tex2.
I have already adapted @antokhio ´s shader from this thread to do this with a 3d box but the cut follows the object geometry depending on the box position and projection. I would like a straight cut as seen from 2d viewspace.
Maybe it would be sufficient to transform the box somehow. Right now i am just making it always face the camera but thats not enough since it has a depth.
Patch and slicer shader: PS_Slicer.zip (3.8 KB)
Cutting in 3D:
I would like from 2d (mockup):