Alpha mesh

maen

Newcomer
Joined
Mar 22, 2003
Messages
4
Hello every one,
I am trying to make a loaded mesh transparent , in VB.net and DirectX9

this is the code in the InitializieDevice , Is there anything thing wrong ?

' Turn on the zbuffer
dev.RenderState.ZBufferEnable = True

' Turn on ambient lighting
dev.RenderState.Ambient = System.Drawing.Color.White

dev.RenderState.AlphaBlendEnable = True
dev.RenderState.AlphaSourceBlend = Blend.SourceAlpha
dev.RenderState.DestinationBlend = Blend.DestinationAlpha

' Load the mesh from the specified file
mesh = mesh.FromFile("box.x", MeshFlags.SystemMemory, device, materials)
 
The only diffeence in your code to that in my book is this line:

Visual Basic:
dev.RenderState.DestinationBlend = Blend.InvSourceAlpha

Don't know if that helps?
 
Back
Top