首页 新闻 会员 周边 捐助

VB.NET里面用D3D咋显示一个透明物体啊,我显示那个根本不是透明嘛,设置代码一大堆!

0
悬赏园豆:5 [已关闭问题]

设置了这么多……

 

        Dim DispMode As DisplayMode = Manager.Adapters(Manager.Adapters.Default.Adapter).CurrentDisplayMode
Dim PresentParams As New PresentParameters
PresentParams.Windowed
= True
PresentParams.SwapEffect
= SwapEffect.Discard
PresentParams.EnableAutoDepthStencil
= True
PresentParams.AutoDepthStencilFormat
= DepthFormat.D16
PresentParams.BackBufferFormat
= DispMode.Format
Device
= New Device(Manager.Adapters.Default.Adapter, DeviceType.Hardware, Panel1, GetSettings, PresentParams)
Device.Transform.Projection
= Matrix.PerspectiveFovLH(Math.PI / 4, 1.33, 1, 1000)
Device.RenderState.ZBufferEnable
= True

Device.RenderState.AlphaBlendEnable
= True
Device.RenderState.AlphaDestinationBlend
= Blend.InvSourceAlpha
Device.RenderState.AlphaSourceBlend
= Blend.InvDestinationAlpha
Device.RenderState.AlphaTestEnable
= True

Device.RenderState.DestinationBlend
= Blend.InvSourceAlpha
Device.TextureState(
0).ColorOperation = TextureOperation.Modulate
Device.TextureState(
0).ColorArgument1 = TextureArgument.TextureColor
Device.TextureState(
0).ColorArgument2 = TextureArgument.Diffuse
Device.TextureState(
0).AlphaOperation = TextureOperation.Modulate
Device.TextureState(
0).AlphaArgument1 = TextureArgument.TextureColor
Device.TextureState(
0).AlphaArgument2 = TextureArgument.Diffuse


Device.VertexFormat
= CustomVertex.PositionNormalTextured.Format

 


 

头都大了,还是不透明。。。

显示出来是这样的:

而explor3d显示的是这样的:

现学3D现做,然后3DS里面导出已经很头疼了,又显示不正确……走过路过的大侠指点二三吧

zcsor~流浪dè风的主页 zcsor~流浪dè风 | 初学一级 | 园豆:5
提问于:2009-08-16 01:03
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册