Example #1
0
    // Use this for initialization
    void Start()
    {
        updaters = updaters.OrderBy(b => b.name).ToArray();
        Application.targetFrameRate = 30;

        velTex            = Extentions.CreateRenderTexture(256, 256);
        velTex.filterMode = FilterMode.Point;
        vAdTex            = Extentions.CreateRenderTexture(256, 256);
        vAdTex.filterMode = FilterMode.Point;
        posTex            = Extentions.CreateRenderTexture(256, 256);
        posTex.filterMode = FilterMode.Point;
        preTex            = Extentions.CreateRenderTexture(256, 256);
        preTex.filterMode = FilterMode.Point;
        rotTex            = Extentions.CreateRenderTexture(256, 256);
        rotTex.filterMode = FilterMode.Point;
        colTex            = Extentions.CreateRenderTexture(256, 256);
        colTex.filterMode = FilterMode.Point;

        rt1            = Extentions.CreateRenderTexture(256, 256);
        rt1.filterMode = FilterMode.Point;
        rt2            = Extentions.CreateRenderTexture(256, 256);
        rt2.filterMode = FilterMode.Point;

        Shader.SetGlobalTexture("_VelTex", velTex);
        Shader.SetGlobalTexture("_VelAdditive", vAdTex);
        Shader.SetGlobalTexture("_PosTex", posTex);
        Shader.SetGlobalTexture("_PreTex", preTex);
        Shader.SetGlobalTexture("_RotTex", rotTex);
        Shader.SetGlobalTexture("_ColTex", colTex);
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     targetTex            = Extentions.CreateRenderTexture(256, 256);
     targetTex.filterMode = FilterMode.Point;
     rt            = Extentions.CreateRenderTexture(256, 256);
     rt.filterMode = FilterMode.Point;
 }
Example #3
0
 void CreateBuffers()
 {
     colTex = Extentions.CreateRenderTexture((int)camera.pixelWidth, (int)camera.pixelHeight, colTex);
     nomTex = Extentions.CreateRenderTexture((int)camera.pixelWidth, (int)camera.pixelHeight, nomTex);
     posTex = Extentions.CreateRenderTexture((int)camera.pixelWidth, (int)camera.pixelHeight, posTex);
     rbs    = new RenderBuffer[3] {
         colTex.colorBuffer,
         nomTex.colorBuffer,
         posTex.colorBuffer
     };
     compMat.SetTexture("_DSColTex", colTex);
     compMat.SetTexture("_DSNomTex", nomTex);
     compMat.SetTexture("_DSPosTex", posTex);
 }
Example #4
0
    void Start()
    {
        posTex            = Extentions.CreateRenderTexture(256, 256);
        posTex.filterMode = FilterMode.Point;
        colTex            = Extentions.CreateRenderTexture(256, 256);
        colTex.filterMode = FilterMode.Point;

        Shader.SetGlobalTexture("_VertPosTex", posTex);
        Shader.SetGlobalTexture("_VertColTex", colTex);

        rbs = new RenderBuffer[2] {
            posTex.colorBuffer, colTex.colorBuffer
        };
        targetFilter = GetComponentInChildren <MeshFilter> ();

        InvokeRepeating("Change", 0.3f, 0.3f);
    }
Example #5
0
    void OnRenderImage(RenderTexture s, RenderTexture d)
    {
        if (finalTex == null || finalTex.width != s.width || finalTex.height != s.height)
        {
            blurTex  = Extentions.CreateRenderTexture(s, blurTex);
            finalTex = Extentions.CreateRenderTexture(s, finalTex);
            preTex   = Extentions.CreateRenderTexture(s, preTex);
        }
        Graphics.Blit(s, blurTex);
        blurTex.GetBlur(blurSize, blurIter, blurDS);

        effectMat.SetTexture("_bTex", blurTex);
        effectMat.SetTexture("_pTex", preTex);
        Graphics.Blit(s, finalTex, effectMat);
        Graphics.Blit(finalTex, preTex);
        Graphics.Blit(finalTex, d);
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     rt            = Extentions.CreateRenderTexture(n, n);
     rt.filterMode = FilterMode.Point;
     Shader.SetGlobalTexture("_PointsTex", rt);
 }