- Home /
Question by
LukaKotar · Aug 05, 2015 at 04:52 AM ·
camerashaderimage effects
Use information from two cameras in one image effect shader?
I would like to pass two images (one for each camera) to a shader, so I can mask out which areas of the secondary camera can be seen on the screen.
Basically, instead of just the image which OnRenderImage() automatically assigns to the _MainTex property, I also need the image of the other camera to work with in the shader (_MainTex2 or something). How can this be done?
Comment
Answer by Sparrowfc · Aug 05, 2015 at 06:33 AM
you can define a global shader property and set it through Shader.SetGlobalTexture