예제 #1
0
 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)));
 }
예제 #2
0
    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");
    }
예제 #3
0
 protected RenderTexture CreateRenderDestination(TextureParam _output)
 {
     return(_output.CreateRenderDestination(m_TexWidth, m_TexHeight, TextureParam.GetRTFormat(m_TexMode == TexMode.Greyscale)));
 }