I’m pretty new to shaders like this (and shaders in general), so I was looking for some advice on the best way to implement this feature.
The intended effect is to have two cameras. Camera 2 is a child of camera 1, and is rendering objects on a different layer (neither camera is seeing the same objects or “world”).
The camera 2 is rendered on top of camera 1, but is masked off by a 3D mesh (camera 2 would only be visible in green area)
I’m pretty much trying to achieve the effect in the “Dimensions and Portals” asset, but in the simplest way possible. Just rendering another camera on top of an object, no fancy effects or anything.
I don’t want someone to code this for me, I’m mostly just looking for the most optimal way to go about making this effect (although some code snippets would help).
I already tried making camera 2 output to a render texture, which was then rendered in the screenspace of an object, but it didn’t come out perfect (notice below how the perspective is slightly off)

Any help or pointers would be greatly appreciated.
EDIT: The perspective being incorrect was due to the rendertexture having the incorrect aspect ratio.
