- Home /
How to Sample colors from a quad to a RenderTexture?
As you can see, I have a quad in the scene which stamps the depth buffer of the camera. However what I wanna to do is to radially blur the quad and apply back the result onto the quad. One possible solution is to sample all the pixels of the quad into a RenderTexture, and then blur the RenderTexture in Camera.OnRenderImage() and then apply it back. However I have no idea how to make such a RenderTexture. Any suggestions would be greatly appreciated!
Answer by Yujingping · Dec 07, 2016 at 06:40 AM
OK so Finally I figured it out on my own. In this case what I want to do is applying an image effect on only a part of the screen rather than a full-screen blit. Please use GL.Begin (GL.Quads); and make sure you are using orthogonal projection. Then manually set the tex coordinates and vertex positions of the for vertices. Finally apply your material to that quad. For more information please refer to Official Document
Your answer
Follow this Question
Related Questions
Interger return value in shader with R8 R16 RenderTexture 1 Answer
RenderTexture to Shader everyframe 0 Answers
[Unity SRP] How do I clear 3d RW RenderTexture? 1 Answer
CustomRenderTexture not working 5 Answers
Pixelart camera shader 2 Answers