示例#1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="l"></param>
		private ImportData ConfigureTerrainDefaults( Light l )
		{
			TerrainGlobalOptions.MaxPixelError = 8;
			TerrainGlobalOptions.CompositeMapDistance = 3000;
			TerrainGlobalOptions.LightMapDirection = l.DerivedDirection;
			TerrainGlobalOptions.CompositeMapAmbient = SceneManager.AmbientLight;
			TerrainGlobalOptions.CompositeMapDiffuse = l.Diffuse;

			ImportData defaultImp = terrainGroup.DefaultImportSettings;
			defaultImp.TerrainSize = TerrainSize;
			defaultImp.WorldSize = TerrainWorldSize;
			defaultImp.InputScale = 100;
			defaultImp.MinBatchSize = 33;
			defaultImp.MaxBatchSize = 65;

			defaultImp.LayerList = new List<LayerInstance>();
			LayerInstance inst = new LayerInstance();
			inst.WorldSize = 100;
			inst.TextureNames = new List<string>();
			inst.TextureNames.Add( "dirt_grayrocky_diffusespecular.dds" );
			inst.TextureNames.Add( "dirt_grayrocky_normalheight.dds" );
			defaultImp.LayerList.Add( inst );

			inst = new LayerInstance();
			inst.WorldSize = 30;
			inst.TextureNames = new List<string>();
			inst.TextureNames.Add( "grass_green-01_diffusespecular.dds" );
			inst.TextureNames.Add( "grass_green-01_normalheight.dds" );
			defaultImp.LayerList.Add( inst );

			inst = new LayerInstance();
			inst.WorldSize = 30;
			inst.TextureNames = new List<string>();
			inst.TextureNames.Add( "growth_weirdfungus-03_diffusespecular.dds" );
			inst.TextureNames.Add( "growth_weirdfungus-03_normalheight.dds" );
			defaultImp.LayerList.Add( inst );

			return defaultImp;
		}
示例#2
0
		public static bool ReadLayerInstanceList( ref StreamSerializer stream, int numSamplers,
												  ref List<LayerInstance> targetLayers )
		{
			byte numLayers;
			stream.Read( out numLayers );
			targetLayers = new List<LayerInstance>( numLayers );
			for ( var l = 0; l < numLayers; ++l )
			{
				if ( stream.ReadChunkBegin( TERRAINLAYERINSTANCE_CHUNK_ID, TERRAINLAYERINSTANCE_CHUNK_VERSION ) == null )
				{
					return false;
				}

				var inst = new LayerInstance();

				stream.Read( out inst.WorldSize );
				inst.TextureNames = new List<string>( numSamplers );
				for ( var t = 0; t < numSamplers; ++t )
				{
					string texName;
					stream.Read( out texName );
					inst.TextureNames.Add( texName );
				}

				stream.ReadChunkEnd( TERRAINLAYERINSTANCE_CHUNK_ID );
				targetLayers.Add( inst );
			}

			return true;
		}