Combine colour operation with alpha operation?

boyamer

02-09-2009 14:50:01

Hi all,i want to combine alpha and colour operation together,i'm doing this;

pass.SetSceneBlending(SceneBlendType.TransparentAlpha);

TextureUnitState sampler = pass.CreateTextureUnitState();
//sampler.SetAlphaOperation(LayerBlendOperationEx.Add,LayerBlendSource.Texture,LayerBlendSource.Manual,0,1.0f,);
sampler.SetColourOperation(LayerBlendOperation.Add);
//sampler.SetColourOperationEx(LayerBlendOperationEx.BlendDiffuseAlpha,LayerBlendSource.Diffuse,LayerBlendSource.Current);
sampler.SetAlphaRejectSettings(CompareFunction.Greater,128);

sampler.SetTextureName(currentTexture.Name);
sampler.TextureAddressMode = TextureAddressMode.Clamp;
sampler.SetTextureFiltering(FilterOptions.Linear,FilterOptions.Linear,FilterOptions.Linear);


But i have my object with Transparent alpha on it,but with white colour,i'd like to see the material with Color on it,but also transparent..
please help?

Thanks