void Initialize()
    {
        crt = GetComponent <CreateReflectionTexture>();
        if (crt == null)
        {
            gameObject.AddComponent <CreateReflectionTexture>();
            crt = GetComponent <CreateReflectionTexture>();
        }
        CreatePlaneMesh();
        randomXZ = new ComputeBuffer(width * depth, 8);
        setRandomDisplacementBuffer();
        CreateMesh();

        initValuesSWE();
        initBuffersSWE();
    }
예제 #2
0
    void Initialize()
    {
        crt = GetComponent <CreateReflectionTexture>();
        if (crt == null)
        {
            gameObject.AddComponent <CreateReflectionTexture>();
            crt = GetComponent <CreateReflectionTexture>();
        }
        mainCam.depthTextureMode = DepthTextureMode.Depth;

        CreatePlaneMesh();
        initHeightField();
        randomXZ = new ComputeBuffer(width * depth, 8);
        setRandomDisplacementBuffer();
        CreateMesh();
        initBuffers();

        currentCollision = 1;
    }