示例#1
0
        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);

        }