Let me give the detailed infomation:
I have a pair of AR glasses and am trying to align the RGBcamera image with what i really see.
First for now I want to simulate the scenary in UnityEditor, so I created two cameras A and B in the scene.
Camera A render the scene to a rendertexture.
With the rendertexture, I placed a Quad to fulfil Camera A’s nearplane.
Camera B’s position and rotation are different from Camera A’s.
My idea is:
Here is the code and shader, but the result seems not right.
Can you guys give me some ideas?
I probably found why the result is not right. I am using the on-axis perspective projection matrix.
But the problem i am dealing with is off-axis perspective projection.
Am I right?
Thanks if anyone could give me suggestions.
Thanks for your explaination!
Below is my conclusion:
The Depth infomation is Lost in RGB Camera Image, so It is not impossible to precisely remap pixels between two views.
Correct. This is why Meta, Apple, and others that have external cameras also have methods to mapping real world geometry around it, and project the RGB camera’s view onto that geometry when displayed to the user.