protected override void OnRenderImage(RenderTexture source, RenderTexture destination) { Material.SetColor("_White", white); Material.SetColor("_Black", black); Material.SetColor("_Red", red); Material.SetColor("_Green", green); Material.SetColor("_Blue", blue); Material.SetColor("_Yellow", yellow); Material.SetColor("_Magenta", magenta); Material.SetColor("_Cyan", cyan); Material.SetFloat("_Amount", amount); Graphics.Blit(source, destination, Material, CLib.IsLinearColorSpace() ? 1 : 0); }
protected override void OnRenderImage(RenderTexture source, RenderTexture destination) { float fp = CLib.Frac(phase); if (fp == 0f) { Graphics.Blit(source, destination); return; } Material.SetVector("_Params", new Vector4( amplitude, waves, colorGlitch, fp )); Graphics.Blit(source, destination, Material); }
protected virtual void RenderLut3D(RenderTexture source, RenderTexture destination) { if (needsUpdate || lookupTexture.name != m_BaseTextureName) { ConvertBaseTexture(); } if (m_Lut3D == null) { SetIdentityLut(); } Material.SetTexture("_LookupTex", m_Lut3D); float lutSize = (float)m_Lut3D.width; Material.SetVector("_Params", new Vector3( (lutSize - 1f) / (1f * lutSize), 1f / (2f * lutSize), amount )); Graphics.Blit(source, destination, Material, CLib.IsLinearColorSpace() ? 1 : 0); }
protected virtual void Reset() { white = CLib.IsLinearColorSpace() ? new Color(0.72974005284f, 0.72974005284f, 0.72974005284f) : new Color(0.5f, 0.5f, 0.5f); }