I just started to work a on project where I need to make a working phone with camera in game, I already did this once on my game “R-eLink” but people complained the screen was hard on the eyes because the screen of the phone displayed the full render texture instead of just the portion of the screen the phone screen covers.
Is the render texture camera from the same view as the main camera? If that’s the case why even do a render texture for this, why not just have the phone’s screen be transparent? If you want to do screen effects you can use a grab pass.
Okay, in that case you can use a similar shader to what you would use for a grab pass to get the UV coordinates for the render texture.
Use o.screenPos = ComputeScreenPos(v.vertex);
in the vertex shader or add screenPos to your input struct in a surf shader and then do float2 renderTexUvs = screenPos.xy / screenPos.w;