- Home /
Question by
aj1729 · Oct 03, 2016 at 05:59 AM ·
c#camerashaderrendertexture
What is the procedure of capturing a particular region using Render Texture
I have four points in screen space . I would like to do following.
1.Create a Rect using those 4 points in screenspace.
2.Use the Render Texture of Camera (I have UnityPro.) to capture the region
specified by Rect defined in step 1.
3.Save Render Texture to a new Render Texture.
4.Use Shader to clip the texture by giving "clip" coordinates by script.
5.Clip the rest of the area which is not included in the clip defined in step 1.
My questions
how do I construct rect where the points are dynamic in nature so I cannot get Xmin,Ymin,Xmax,Ymax ! (Rectangle is not always Axis-aligned)
How do I pass the information of clipping to the shader ?
Should I use Clip(-1) in shader ? (Not suitable for Mobile Platforms) ?
Comment