Global Rendering with a shader that uses a texture

Hi,

I’m starting with shaders and unity. I’d like to render a scene which is globally affected by a shader that uses a .dds texture. The shader takes red and green channels of this image for geometry correction(vertexs and so on…) and the blue channel for brightness. So it is pretty easy to create a material that uses this shader with a source image attached.

As far as I know, the usual way to do what I want is “Camera.SetReplacementShader”. But what i have to use in this method is a shader but not a material. How can i do it for making use of the image? (because the source image can only be attached to a material and not to the shader itself, can’t it?).

Thanks in advance

You can pass the texture directly to a shader using Shader.SetGlobalTexture.