Ahoy there!
I’m having problems creating an in-game video monitor that renders the view from an in game camera. It’s the need to make a custom projection matrix to fit the output of a camera into that screen which has me beat. The screen of the in-game monitor is rendered with a kind of “mask” shader I guess you’d call it, which cuts a hole in the geometry and allows a camera set to a different depth to be rendered on that screen alone, behind the level geometry. That’s all working fine, but I still need to apply some sort of perspective transformation to the feed from the in-game video camera.
I’ve been messing around with the individual values of the video camera’s projection matrix, and can manually adjust the values so that the feed from the video camera distorts properly and conforms to the in-game video screen, but I can’t figure out how to have the projection matrix update automatically as the first-person camera moves around to view the screen from different angles. From this experimentation I see no reason why it wouldn’t be possible, it’s just that using the projection matrix to do it seems pretty difficult.
Sadly, I don’t own Unity PRO, and can’t use a render texture. I’ve looked for Unity code examples and have been googling Matrix math relating to camera projections, but haven’t found anything.
So… does anyone know if this has been done before, or if it really is possible?