protected RenderTexture CreateRenderDestination(TextureParam _input, TextureParam _output) { if (_input == _output) { Debug.LogError(" using input as output "); } return(_output.CreateRenderDestination(m_TexWidth, m_TexHeight, TextureParam.GetRTFormat(m_TexMode == TexMode.Greyscale))); }
protected Texture2D gradientX;// = new Texture2D(256, 1, TextureFormat.ARGB32, false); public void ExecuteRemapCurve(float _size, TextureParam _output) { System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch(); timer.Start(); Material mat = GetMaterial("TextureOps"); mat.SetInt("_MainIsGrey", m_TexMode == TexMode.Greyscale ? 1 : 0); mat.SetInt("_TextureBIsGrey", 1); mat.SetVector("_Multiply", new Vector4(1, 1, 0, 0)); AnimCurveToTexture(ref gradientX, m_Gradient); // m_TexMode=TexMode.Greyscale; RenderTexture destination = _output.CreateRenderDestination(m_TexWidth, m_TexHeight, TextureParam.GetRTFormat(m_TexMode == TexMode.Greyscale)); SetCommonVars(mat); Graphics.Blit(gradientX, destination, mat, (int)ShaderOp.CopyRGBA); // Debug.LogError(" multiply in Final" + timer.ElapsedMilliseconds + " ms"); }
protected RenderTexture CreateRenderDestination(TextureParam _output) { return(_output.CreateRenderDestination(m_TexWidth, m_TexHeight, TextureParam.GetRTFormat(m_TexMode == TexMode.Greyscale))); }