Shaders (How do I apply them and their role)

I have watched the excellent video posted in Holographic Photo Blending with PhotoCapture and read some about shaders.

Now I am facing a situation in which I have a project in which there is something called a “Video Panel” in the Main Camera. In this there is a Canvas and in the Canvas an Image. The Image I get is inverted so someone propose to apply a Shader.

My first question is how do I apply a shader? I understand (correct me if I am wrong) that I have to create a Material first, is that right? When i see the Image in the Inspector I see "Image(Script) with Texture and Material (both are None) so I suppose that I should apply the material with the shader there?

My second question is what is the role of shaders? I read and understand that they can run operations and modify the way images or textures are seen by the user, but is that only for the show? I am planning to do Image processing with the captured images and i am planning to do with C# scripts but seeing that some shader can for example transform all to grey (which is a operation I do in C#) can I take this result from the shader or is it just for visualization purposes only?

yes, assign the material with correct shader to the objects.
(if its none, they use some default material/shader, you can see what they are using from Window/Frame Debugger)

you could take rendertexture of the shader image results, and access that result image (and save it etc)

1 Like