Get texture pixels under a plane

Hi, given a plane on screen (it is actually a very thin box), I want to get all the pixels which it covers from a background texture (which covers the whole screen).

Note that the plane may be rotated in 3D (or the camera may be rotated), so just doing getPixels according to its scale won’t be enough.

An expansive and rather inelegant solution that I thought of is acquiring the 4 corners of the plane in screen space from the camera. Then, getting all the pixels between these corners.

My guess is you want to use a screenspace shader. But you’d need Unity Pro for that.

In the Unity surface shader examples here, scroll down to “Detail Texture in Screen Space”; and you should find what you are looking for.