예제 #1
0
파일: Terrain.cs 프로젝트: fulcircle/sagan
        public Terrain(int terrainSize, int levels, Camera cam) : base(name: "SaganTerrain") {
            this.levels = levels;

            // Add +1 to width and height of heightmap so bilinear interpolation of quad can interpolate extra data point beyond edge of quad
            this.heightMap = new HeightMap(terrainSize + 1);

            this.rootQuad = new Quad(1, terrainSize, terrainSize, this.heightMap);

            this.cam = cam;

        }
예제 #2
0
파일: Quad.cs 프로젝트: fulcircle/sagan
        public Quad(int LOD, float size, float error, HeightMap heightMap) : base(name: "Quad") {
            this.size = size;
            this.LOD = LOD;

            this.error = error;

            this._heightMap = heightMap;

            this.material = new Material(Shader.Find("Sagan/ColorHeight"));

            this.material.SetFloat("_MaxHeight", this._heightMap.maxHeightValue);
            this.material.SetFloat("_MinHeight", this._heightMap.minHeightValue);

        }