public TextureUnitState( Pass parent, string textureName, int texCoordSet )
{
this.parent = parent;
isBlank = true;
colorBlendMode.blendType = LayerBlendType.Color;
SetColorOperation( LayerBlendOperation.Modulate );
this.SetTextureAddressingMode( TextureAddressing.Wrap );
// set alpha blending options
alphaBlendMode.operation = LayerBlendOperationEx.Modulate;
alphaBlendMode.blendType = LayerBlendType.Alpha;
alphaBlendMode.source1 = LayerBlendSource.Texture;
alphaBlendMode.source2 = LayerBlendSource.Current;
// default filtering and anisotropy
minFilter = FilterOptions.Linear;
magFilter = FilterOptions.Linear;
mipFilter = FilterOptions.Point;
maxAnisotropy = MaterialManager.Instance.DefaultAnisotropy;
isDefaultFiltering = true;
isDefaultAniso = true;
// texture modification params
scrollU = scrollV = 0;
transU = transV = 0;
scaleU = scaleV = 1;
rotate = 0;
texMatrix = Matrix4.Identity;
animDuration = 0;
textureType = TextureType.TwoD;
textureSrcMipmaps = (int)TextureMipmap.Default;
// texture params
SetTextureName( textureName );
this.TextureCoordSet = texCoordSet;
parent.DirtyHash();
}