Example #1
0
    // Use this for initialization
    void Start()
    {
        //Start position texture. Assuming dimensions and position RenderTexture are set in
        //inspector.
        SetupPlane();
        Camera cam = camObj.camera;

        cam.Render();

        //Start spring connection texture
        springInitMaterial.SetFloat("_posTexSize", dimensions.x);
        springInitMaterial.SetFloat("_subTexSize", springSubTexSize);
        renderer.material = springInitMaterial;
        dimensions.x     *= springSubTexSize;
        dimensions.y     *= springSubTexSize;
        EffectCamera camScript = camObj.GetComponent("EffectCamera") as EffectCamera;

        camScript.changeRenderTexture(springTex, dimensions);
        SetupPlane();
        cam.Render();
    }