Hi All.I am new to Unity shaders programming with CG.My background is OpenGL and GLSL.I want to do a 2 pass based effect where in the first pass I render the whole frame to a frame buffer texture attachment.I guess in Unity it is called “Render to texture” ? Then in the second pass I need to grab that texture for the further post process processing.
I already wrote post process shaders in Unity attaching those to camera and I see that in such a setup the input texture is automatically the one coming from the frame buffer.But I would like to do this manually in a shader which is not attached to camera and render to texture the final result.Then I can do with that texture some other things like draw a full screen quad , apply to geometry etc.
Thanks.
Post your request like this:
- xxxx
- yyyy
- zzzz
I think that would be more clear and easy for anybody who would like to read and help
Ok, for example let’s take 2 pass gausian blur.My camera has a post process shader attachment which has to do this:
Pass -1 :
RT texture is blurred along X axis.
Pass-2 :
X blurred frame texture from the previous pass now is the input and is blurred along Y.
The texture is output to the screen blit.
I can’t figure out how to pass the screen texture resulting from the first pass into the second pass.
Thanks.
Hmmm , well I think I found it.GrabPass does the job.