示例#1
0
        private void PostConstructor()
        {
            if (this.m_bPostConstructor)
            {
                _shader = PoolProxy.GetResource <ObtainShaderPool, ShaderAllocationPolicy <LandscapeShader>, string, LandscapeShader>(string.Format("{0}{1},{0}{2}", ProjectFolders.ShadersPath, "terrainVertexShader.glsl", "terrainFragmentShader.glsl"));
                liteReflectionShader = PoolProxy.GetResource <ObtainShaderPool, ShaderAllocationPolicy <WaterReflectionTerrainShader>, string, WaterReflectionTerrainShader>(string.Format("{0}{1},{0}{2}", ProjectFolders.ShadersPath, "waterReflectionTerrainVS.glsl", "waterReflectionTerrainFS.glsl"));
                liteRefractionShader = PoolProxy.GetResource <ObtainShaderPool, ShaderAllocationPolicy <WaterRefractionTerrainShader>, string, WaterRefractionTerrainShader>(string.Format("{0}{1},{0}{2}", ProjectFolders.ShadersPath, "waterRefractionTerrainVS.glsl", "waterRefractionTerrainFS.glsl"));

                _buffer = LandscapeBuilder.getTerrainAttributes(this.LandscapeMap, this._normalsSmoothLvl);
                this.m_bPostConstructor = !this.m_bPostConstructor;
            }
        }
示例#2
0
        private void InitTextures(string pathTexR, string pathTexG, string pathTexB, string pathTexBlack, string pathTexBlendMap)
        {
            this._textureR     = PoolProxy.GetResource <ObtainTexturePool, TextureAllocationPolicy, string, ITexture>(pathTexR);
            this._textureG     = PoolProxy.GetResource <ObtainTexturePool, TextureAllocationPolicy, string, ITexture>(pathTexG);
            this._textureB     = PoolProxy.GetResource <ObtainTexturePool, TextureAllocationPolicy, string, ITexture>(pathTexB);
            this._textureBlack = PoolProxy.GetResource <ObtainTexturePool, TextureAllocationPolicy, string, ITexture>(pathTexBlack);
            this._blendMap     = PoolProxy.GetResource <ObtainTexturePool, TextureAllocationPolicy, string, ITexture>(pathTexBlendMap);

            try
            {
                using (var map = new Bitmap(m_heightMapTexPath))
                {
                    LandscapeMap = new TableGrid(map.Height, MapSize / map.Height);
                    LandscapeBuilder.loadHeightMap(map, this);
                }
            }
            catch (ArgumentException ef)
            {
                Debug.Log.AddToFileStreamLog("Terrain height map file load error : " + ef.Message);
                System.Environment.Exit(0);
            }
        }