private void InitTexture() { m_CurveTexture = new Texture2D(256, 1, TextureFormat.RGBAHalf, false, true); m_CurveTexture.wrapMode = TextureWrapMode.Clamp; m_CurveTexture.filterMode = FilterMode.Bilinear; CurveToTextureUtility.CurveToTexture(settings.AlphaCurve, ref m_CurveTexture); }
public override bool Process(int frame) { if (m_CurveTexture == null) { InitTexture(); } CurveToTextureUtility.CurveToTexture(settings.AlphaCurve, ref m_CurveTexture); Texture inputFrame = InputSequence.RequestFrame(frame).texture; m_Material.SetTexture("_MainTex", inputFrame); m_Material.SetFloat("_Brightness", settings.Brightness); m_Material.SetFloat("_Contrast", settings.Contrast); m_Material.SetFloat("_Saturation", settings.Saturation); m_Material.SetTexture("_AlphaCurve", m_CurveTexture); ExecuteShaderAndDump(frame, inputFrame); return(true); }
public override bool Process(int frame) { if (m_CurveTexture == null) { InitTexture(); } CurveToTextureUtility.CurveToTexture(AlphaCurve, ref m_CurveTexture); Texture inputFrame = RequestInputTexture(frame); material.SetTexture("_MainTex", inputFrame); material.SetFloat("_Brightness", Brightness); material.SetFloat("_Contrast", Contrast); material.SetFloat("_Saturation", Saturation); material.SetTexture("_AlphaCurve", m_CurveTexture); ProcessFrame(frame, inputFrame); return(true); }