Axiom.Graphics.Material.SetSceneBlending C# (CSharp) Метод

SetSceneBlending() публичный Метод

Allows very fine control of blending every Pass with the existing contents of the scene.
This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.
public SetSceneBlending ( SceneBlendFactor src, SceneBlendFactor dest ) : void
src SceneBlendFactor
dest SceneBlendFactor
Результат void
		public void SetSceneBlending( SceneBlendFactor src, SceneBlendFactor dest )
		{
			// load each technique
			for ( int i = 0; i < this.techniques.Count; i++ )
			{
				( (Technique)this.techniques[ i ] ).SetSceneBlending( src, dest );
			}
		}

Same methods

Material::SetSceneBlending ( SceneBlendType blendType ) : void

Usage Example

Пример #1
0
		protected override void load()
		{
			// clarabie - nov 18, 2008
			// modified this to check for an existing material instead of always
			// creating a new one. Allows more flexibility, but also specifically allows us to
			// solve the problem of XNA not having fixed function support

			_material = (Material)MaterialManager.Instance.GetByName( "Fonts/" + _name );

			if ( _material == null )
			{

				// create a material for this font
				_material = (Material)MaterialManager.Instance.Create( "Fonts/" + _name, Group );

				TextureUnitState unitState = null;
				bool blendByAlpha = false;

				if ( _fontType == FontType.TrueType )
				{
#if !( XBOX || XBOX360 )
					// create the font bitmap on the fly
					createTexture();

					// a texture layer was added in CreateTexture
					unitState = _material.GetTechnique( 0 ).GetPass( 0 ).GetTextureUnitState( 0 );

					blendByAlpha = true;
#endif
				}
				else
				{
					// load this texture
					// TODO In general, modify any methods like this that throw their own exception rather than returning null, so the caller can decide how to handle a missing resource.
					_texture = TextureManager.Instance.Load( Source, Group, TextureType.TwoD, 0 );

					blendByAlpha = texture.HasAlpha;
					// pre-created font images
					unitState = Material.GetTechnique( 0 ).GetPass( 0 ).CreateTextureUnitState( Source );
				}

				// set texture addressing mode to Clamp to eliminate fuzzy edges
                if ( unitState != null )
                    unitState.SetTextureAddressingMode( TextureAddressing.Clamp );

				// set up blending mode
				if ( blendByAlpha )
				{
					_material.SetSceneBlending( SceneBlendType.TransparentAlpha );
				}
				else
				{
					// assume black background here
					_material.SetSceneBlending( SceneBlendType.Add );
				}
			}
		}
All Usage Examples Of Axiom.Graphics.Material::SetSceneBlending