I’m trying to make a script which can be placed onto a camera to make the camera render only the reds of a scene. Here’s what I have so far:
Script placed onto camera
var redMat : Material;
function OnRenderImage (source : RenderTexture, destination : RenderTexture)
{
RenderTexture.active = destination;
redMat.SetTexture ("_MainTex", source);
}
And this is the shader applied to the redMat:
Shader "Red Filter" {
Properties {
_MainTex ("Texture", RECT) = ""
}
SubShader {
Pass {
ColorMask R
Blend One One
SetTexture [_MainTex]
}
}
}
All this seems to do is create thick soft lines around the edge of the screen. Anyone know what I’m doing wrong?
Thanks