Hi, I have been trying for days to come up with a solution for having seperate image effects on seperate cameras, but am having no luck.
I want to have my UI camera have its own bloom and scanline effects, seperate from the ones used on the main camera. The problem is that they will apply to all cameras.
I have two cameras, rendering only the layers applied to them.
I have tried rendering both cameras to a render texture, merging them with a simple shader, and then using a material to blit them and apply to a quad in the scene, this doesnt work either, but I was under the impression that it should.
material script:
public class MixRenderTextures : MonoBehaviour {
public Material effectMaterial;
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Graphics.Blit(null, destination, effectMaterial);
}
}
Shader Code:
Shader "Examples/2 Alpha Blended Textures" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_BlendTex ("Alpha Blended (RGBA) ", 2D) = "white" {}
}
SubShader {
Pass {
// Apply base texture
SetTexture [_MainTex] {
combine texture
}
// Blend in the alpha texture using the lerp operator
SetTexture [_BlendTex] {
combine texture lerp (texture) previous
}
}
}
}
This doesnt work, I still get the bloom effect applied to both cameras.
There must be a really simple way that I am overlooking as surely this is pretty common setup in game development!
Any help would be greatly appreciated.