   [mdx] Semi-transparent shield effect
  I'd like to create a semi-transparent spherical shield effect around one of my models (using managed d3d).I was thinking to accomplish this effect, I'd simply create a spherical shell mesh and set the opacity of the mesh to ~20%.Problem is, I'm not 100% clear on the best way (performance, etc) to set the transparency of a mesh.Here's my Mesh code:private static Mesh loadMesh(Device d, string file, ref Material[] meshMats, ref Texture[] meshTexts){    ExtendedMaterial[] mtrl;    Mesh tempMesh = Mesh.FromFile(file, MeshFlags.SystemMemory, d, out mtrl);    if ((mtrl != null) && (mtrl.Length > 0))    {   meshMats = new Material[mtrl.Length];   meshTexts = new Texture[mtrl.Length];   for (int i = 0; i < mtrl.Length; i++)   {  meshMats = mtrl.Material3D;  meshMats.Ambient = meshMats.Diffuse;  if ((mtrl.TextureFilename != null) && (mtrl.TextureFilename != string.Empty)) meshTexts = TextureLoader.FromFile(d, @"..\..\Models\" + mtrl.TextureFilename);   }    }    return tempMesh;}public void Draw(){    for (int i = 0; i < materials.Length; i++)    {   device.Material = materials;   device.SetTexture(0, textures);   mesh.DrawSubset(i);    }}I'd like to modify the loadMesh and Draw method in such a way that I can specify:Draw(.25);to get the mesh to draw with 25% opacity.Any help would be greatly appreciated!Thanks,Dave   
  Performance isn't really going to change one way or the other.Are you using effects or fixed function?You want to set up your texturing and blending (or pixel shader) such that your ".25" goes out in the alpha component of the output color. Then you turn on framebuffer blending, with the appropriate blend function (SRCALPHA,INVSRCALPHA if  not using pre-multiplied alpha, ONE,INVSRCALPHA if you are).Remember to draw all transparent objects last, sorted from far to near.For a pixel shader, it's really easy -- just make your ".25" a parameter to the shader, and move that value into OCOLOR.w.For a fixed function, you probably want to set the AlphaSrc to the Constant value, and set the constant to contain 0xff000000*alpha (where "alpha" is your floating-point value). Check out the documentation on the texture stage states for more information.   