コード例 #1
0
 // Called by camera to apply image effect
 void OnRenderImage(RenderTexture source, RenderTexture destination)
 {
     if (isOn == false)
     {
         NImageEffects.BlitWithMaterial(material, source, destination);
     }
 }
コード例 #2
0
    public static void BlitWithMaterial(Material material, RenderTexture source, RenderTexture destination)
    {
        RenderTexture.active = destination;
        material.SetTexture("_MainTex", source);

        GL.PushMatrix();
        GL.LoadOrtho();

        for (int i = 0; i < material.passCount; i++)
        {
            material.SetPass(i);
            NImageEffects.DrawQuad();
        }
        GL.PopMatrix();
    }