Hi everyone,
i am new to image effects. I want to apply an image effect to my game in android. Therefore i can not use OnRenderImage() ( see here ). Instead i used this:
[ExecuteInEditMode]
public class PostProcess : MonoBehaviour
{
public Material blitMaterial;
[SerializeField] Camera cam;
RenderTexture myRenderTexture;
void OnPreRender()
{
myRenderTexture = RenderTexture.GetTemporary(Screen.width, Screen.height, 16);
cam.targetTexture = myRenderTexture;
}
void OnPostRender()
{
cam.targetTexture = null;
Graphics.Blit(myRenderTexture, null as RenderTexture, blitMaterial);
RenderTexture.ReleaseTemporary(myRenderTexture);
}
}
The blitMaterial simply returns a green color for test purpose. However after applying everything nothing changes. The whole game still looks like it was before. The assigned camera in the inspector is correct. I also tried to blit it to a raw image and it worked but for the framebuffer it doesn’t. So it looks like it has something to do with Graphics.Blit(). I also tried without HDR and MSAA.
I realy don’t know what else might be the problem Therefore i want to ask you for help…
Thank you so much!