Class that provides functionality to generate materials for use with a terrain.
Terrains are composed of one or more layers of texture information, and require that a material is generated to render them. There are various approaches to rendering the terrain, which may vary due to:
  • Hardware support (static)
  • Texture instances assigned to a particular terrain (dynamic in an editor)
  • User selection (e.g. changing to a cheaper option in order to increase performance, or in order to test how the material might look on other hardware (dynamic)
Subclasses of this class are responsible for responding to these factors and to generate a terrain material. @par In order to cope with both hardware support and user selection, the generator must expose a number of named 'profiles'. These profiles should function on a known range of hardware, and be graded by quality. At runtime, the user should be able to select the profile they wish to use (provided hardware support is available).
Наследование: IDisposable
Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="name"></param>
 /// <param name="description"></param>
 public Profile(TerrainMaterialGenerator parent, string name, string description)
 {
     this.mParent = parent;
     this.mName   = name;
     this.mDesc   = description;
 }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="profile"></param>
 public Profile(Profile profile)
 {
     this.mParent = profile.mParent;
     this.mName   = profile.mName;
     this.mDesc   = profile.mDesc;
 }
			/// <summary>
			/// 
			/// </summary>
			/// <param name="parent"></param>
			/// <param name="name"></param>
			/// <param name="description"></param>
			public SM2Profile( TerrainMaterialGenerator parent, string name, string description )
				: base( parent, name, description )
			{
				this.mLayerNormalMappingEnabled = true;
				this.mLayerParallaxMappingEnabled = true;
				this.mLayerSpecularMappingEnabled = true;
				this.mGlobalColorMapEnabled = true;
				this.mLightMapEnabled = false;
				this.mCompositeMapEnabled = true;
			}
			/// <summary>
			/// 
			/// </summary>
			/// <param name="profile"></param>
			public Profile( Profile profile )
			{
				this.mParent = profile.mParent;
				this.mName = profile.mName;
				this.mDesc = profile.mDesc;
			}
			/// <summary>
			/// 
			/// </summary>
			/// <param name="parent"></param>
			/// <param name="name"></param>
			/// <param name="description"></param>
			public Profile( TerrainMaterialGenerator parent, string name, string description )
			{
				this.mParent = parent;
				this.mName = name;
				this.mDesc = description;
			}
Пример #6
0
		protected void CheckDeclaration()
		{
			if ( this.mMaterialGenerator == null )
			{
				this.mMaterialGenerator = TerrainGlobalOptions.DefaultMaterialGenerator;
			}

			if ( this.mLayerDecl.Elements == null || this.mLayerDecl.Elements.Count == 0 )
			{
				//default the declaration
				this.mLayerDecl = this.mMaterialGenerator.LayerDeclaration;
			}
		}
Пример #7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="profile"></param>
 public Profile(Profile profile)
 {
     mParent = profile.mParent;
     mName = profile.mName;
     mDesc = profile.mDesc;
 }