Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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)

Posted

The only diffeence in your code to that in my book is this line:

 


dev.RenderState.DestinationBlend = Blend.InvSourceAlpha

 

Don't know if that helps?

My website

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...