How do I get a camera and a SceneCapture2d to line up perfectly?

I want to parent a SceneCapture2d component to a Camera component so that they see identical views of the world (because I plan to operate on a canvas render target version of the scene). No matter what I do though I can’t get them to see the same thing! Below I’ve taken a screenshot of the camera’s output and the captured scene overlaid on top of one another. I printed their transforms together and they’re identical, so are their FOVs. Even changing the buffer size did nothing. Moving the player around moves the camera and SceneCapture2d in tandem perfectly, but the SceneCapture2d is always distorted compared to the camera regardless. What could possibly be causing this and how do I fix it?

1 Like

Show the material editor nodes for you capture render material.

Changing the post process input/blendable location doesn’t fix it either.

I think this may be an issue/error in the editor. It works for me if my render target resolution and viewport size have equal ratios, but only in standalone. Also, for some reason if I get viewport size on begin play, it’s 0,0. So I have to wait one tick to get it.

Well you’re right that it lines up in that particular circumstance, which is more progress than I made, so thank you! I’ll leave this open for a while to see if anyone has a more robust solution and accept if not.

So you can get the previous method to work in the editor if you plug in ScreenPosition>ViewportUVs into RT TextureSampler