Axiom.Graphics.TextureUnitState.SetColorOperation C# (CSharp) Метод

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

Determines how this texture layer is combined with the one below it (or the diffuse color of the geometry if this is layer 0).
This method is the simplest way to blend tetxure layers, because it requires only one parameter, gives you the most common blending types, and automatically sets up 2 blending methods: one for if single-pass multitexturing hardware is available, and another for if it is not and the blending must be achieved through multiple rendering passes. It is, however, quite limited and does not expose the more flexible multitexturing operations, simply because these can't be automatically supported in multipass fallback mode. If want to use the fancier options, use , but you'll either have to be sure that enough multitexturing units will be available, or you should explicitly set a fallback using TextureUnitState.SetColorOpMultipassFallback.

The default method is LayerBlendOperation.Modulate for all layers.

This option has no effect in the programmable pipeline.

public SetColorOperation ( LayerBlendOperation operation ) : void
operation LayerBlendOperation One of the LayerBlendOperation enumerated blending types.
Результат void
		public void SetColorOperation( LayerBlendOperation operation )
		{
			colorOp = operation;

			// configure the multitexturing operations
			switch ( operation )
			{
				case LayerBlendOperation.Replace:
					SetColorOperationEx( LayerBlendOperationEx.Source1, LayerBlendSource.Texture, LayerBlendSource.Current );
					SetColorOpMultipassFallback( SceneBlendFactor.One, SceneBlendFactor.Zero );
					break;

				case LayerBlendOperation.Add:
					SetColorOperationEx( LayerBlendOperationEx.Add, LayerBlendSource.Texture, LayerBlendSource.Current );
					SetColorOpMultipassFallback( SceneBlendFactor.One, SceneBlendFactor.One );
					break;

				case LayerBlendOperation.Modulate:
					SetColorOperationEx( LayerBlendOperationEx.Modulate, LayerBlendSource.Texture, LayerBlendSource.Current );
					SetColorOpMultipassFallback( SceneBlendFactor.DestColor, SceneBlendFactor.Zero );
					break;

				case LayerBlendOperation.AlphaBlend:
					SetColorOperationEx( LayerBlendOperationEx.BlendTextureAlpha, LayerBlendSource.Texture, LayerBlendSource.Current );
					SetColorOpMultipassFallback( SceneBlendFactor.SourceAlpha, SceneBlendFactor.OneMinusSourceAlpha );
					break;
			}
		}