public GeoSurface() { nodes = new List <GeoNode>(); tritree = new List <GeoTriTreeNode>(); meshContainers = new List <MeshContainer>(); atmMeshContainers = new List <MeshContainer>(); Noise = new DummyNoiseGenerator(); TexNoises = new ISpatialNoiseGenerator[1] { new DummyNoiseGenerator() }; subdivideThread = new Thread(this.SubdivideThreadProc); applyNoiseThread = new Thread(this.ApplyNoiseThreadProc); buildMeshThread = new Thread(this.BuildMeshThreadProc); texLoadGeneratorThread = new Thread(this.TexLoadGeneratorThreadProc); texColorizeThread = new Thread(this.TexColorizeThreadProc); textures = new List <Color[]>(); heightMapsCache = new List <Vector3[]>(); texNoiseInputCache = new List <Vector3[]>(); //hmtestcache = new List<Vector3>(); NormalMapGenerator = null; normalMaps = new List <Color[]>(); normalMapColorizeThread = new Thread(this.NormalMapsColorizeThreadProc); exportedTextures = new List <Texture2D>(); exportedNormalMaps = new List <Texture2D>(); uvPlanesData = new List <UVPlaneData>(); }
void Start() { /*switch (QualitySettings.GetQualityLevel()) * { * case 0: * TextureSize = 512; * SubdivisionLevel = 6; * break; * case 1: * TextureSize = 512; * SubdivisionLevel = 7; * break; * case 2: * TextureSize = 1024; * SubdivisionLevel = 7; * break; * }*/ fbmgpu = new FBMGPU(FBMGPUProgram, MethodName); fbmgpu.Setup(NoiseOctaves, NoisePersistence); fbmgpu.Iterations = NoiseIterations; fbmgpu.Gamma = 2f; texfbmgpu = new FBMGPU(FBMGPUProgram, TexMethodName); texfbmgpu.Setup(TexNoiseOctaves, TexNoisePersistence); texfbmgpu.Iterations = TexNoiseIterations; texfbmgpu.Gamma = 2f; nmapgpu = new GPUTextureProcessor <Vector3, Vector3>(NormalMapGPUProgram, "NormalMap3x3", 1, 3, 3); geo = new GeoSphere(); geo.Noise = fbmgpu; geo.NoiseScale = NoiseScale; geo.NoiseGenFrames = NoiseGenFrames; geo.TargetSubdivisionLevel = SubdivisionLevel; geo.NoiseSpaceScale = NoiseSpaceScale; geo.TexNoiseSpaceScale = TexNoiseSpaceScale; geo.BuildAtmosphere = BuildAtmosphere; geo.TexNoises[0] = texfbmgpu; geo.TextureSize = TextureSize; geo.NormalMapGenerator = nmapgpu; ProgressText = GameObject.Find("ProgressText").GetComponent <GUIText>() as GUIText; geo.StartBuilding(); }