I’m trying to properly use the texcoord to “crop” a RenderTarget. I have a SceneCapture that sends a render target to a paper. A camera centers the players view directly in front of the paper. What is on the paper is more complicated. Here’s the simplest way I can explain it:
I made this crappy drawing to go with this. Imagine the paper as a “window” to the RenderTarget. Regardless of the RenderTarget size, the paper should only show essentially a “cutout” of the target.
The red box is the paper. It shows only what’s inside the red box. Everything else is cropped out. This is in order to do a seamless transition to the exact location of the SceneCapture.
Trying to use AI ended up in this calculation going into the UV input of the RenderTarget The RT_Aspect is 1920/1080, and the Photo_Aspect is the meshes height/width.
For debugging, I created a small room with a decor shelf in view of the paper’s capture. With this material in use on the paper, I took a screenshot of the centered view of the photo, and the final view of the player after the transition and overlaid them on top of one another.
View from centered paper camera Final transitioned Player view Overlaid images (blue is photo, red is player)As you can see, the scale (aspect ratio??) of the two shelves are completely off. This tells me this UV math is almost certainly flawed but I don’t have any ideas and I can’t get the AI to help me much more to be honest…
Does anyone have a better way to do this or any pointers? Thanks in advance.




