Before updating to Windows 10 you may need to return your Pro license. More information here

In-game video monitor without render-to-texture

I'm having problems creating an in-game video monitor that renders the view from an in-game camera. The screen of the in-game monitor is rendered with a "mask" shader which cuts a hole in the geometry, allowing the camera feed to be rendered behind the level geometry. I then tamper with the camera's projection matrix to scale, translate and distort it - just like photoshop's "free transform" command - so that it fits correctly behind the in-game monitor when viewed from any angle.

After much testing, I've learned that it IS possible, but the math has me beat. I can perform all the necessary transformations by individually tweaking the values of the camera matrix in the editor so that it fits the in-game monitor, but can't figure out how to write a script that will correctly adjust the projection matrix in real time. At the moment I can only translate and scale the camera output correctly in real time. I am not adjusting the view rect, only the projection matrix.

Obviously, I don't own Unity PRO, and can't use a render texture.

So... How do I use the viewport points of the in-game monitor to correctly distort the in-game video camera's projection matrix so that it conforms to the in-game monitor?

more ▼

asked Dec 13, 2010 at 01:58 AM

avatar image

142 4 3 9

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Dec 13, 2010 at 01:58 AM

Seen: 1588 times

Last Updated: Dec 13, 2010 at 01:58 AM