游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2538|回复: 5

D3D的碰撞贴图

[复制链接]

29

主题

354

帖子

359

积分

中级会员

Rank: 3Rank: 3

积分
359
QQ
发表于 2006-9-13 18:46:00 | 显示全部楼层 |阅读模式

D3DDevice.BeginScene
    'All rendering calls go between these two lines
    D3DDevice.SetVertexShader FVF
      
    Dim Factor As Long
    Factor = VectorToRGBA(vLightPos, 0#)
   
    'Uncomment this next line if you only want to see the bump-mapping
    'CanDoBlending = False
        
    If CanDoBlending Then
        D3DDevice.SetVertexShader FVF2
        D3DDevice.SetTexture 0, BumpMapTex
        D3DDevice.SetTexture 1, TextureTex
        
        D3DDevice.SetRenderState D3DRS_TEXTUREFACTOR, Factor
        D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG1, D3DTA_TEXTURE
        D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_DOTPRODUCT3
        D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG2, D3DTA_TFACTOR
        
        D3DDevice.SetTextureStageState 1, D3DTSS_COLOROP, D3DTOP_MODULATE
        D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG1, D3DTA_CURRENT
        D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG2, D3DTA_TEXTURE
        
        D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TriStrip2(0), Len(TriStrip2(0))
    Else
        D3DDevice.SetVertexShader FVF
        D3DDevice.SetRenderState D3DRS_TEXTUREFACTOR, Factor
        D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG1, D3DTA_TEXTURE
        D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_DOTPRODUCT3
        D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG2, D3DTA_TFACTOR
        
        'uncomment this line to show the normal map (useful for debugging)
        'D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1
        
        D3DDevice.SetTexture 0, BumpMapTex 'Texture '//Tell the device which texture we want to use...
        D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TriStrip(0), Len(TriStrip(0))
    End If
   
   
    D3DDevice.SetTexture 0, Nothing
    D3DDevice.SetTexture 1, Nothing
    D3DDevice.SetVertexShader FVF
    D3DDevice.DrawPrimitiveUP D3DPT_POINTLIST, 1, vLightPt, Len(vLightPt)
   
D3DDevice.EndScene
sf_2006913184546.jpg

15

主题

2093

帖子

2093

积分

金牌会员

Rank: 6Rank: 6

积分
2093
发表于 2006-9-14 20:49:00 | 显示全部楼层

Re:D3D的碰撞贴图

楼上的楼上不是在回答吧,纯粹是来捣乱的

32

主题

1259

帖子

1351

积分

金牌会员

Rank: 6Rank: 6

积分
1351
发表于 2006-9-14 20:54:00 | 显示全部楼层

Re:D3D的碰撞贴图

不啊,他一看到"碰撞"两字,就以为他那代码可以"发彪"了.

32

主题

1259

帖子

1351

积分

金牌会员

Rank: 6Rank: 6

积分
1351
发表于 2006-9-14 21:09:00 | 显示全部楼层

Re:D3D的碰撞贴图

原来怕丑把贴删了.

270

主题

6442

帖子

6446

积分

论坛元老

Rank: 8Rank: 8

积分
6446
发表于 2006-9-14 21:10:00 | 显示全部楼层

Re: Re:D3D的碰撞贴图

Devil: Re3D的碰撞贴图

原来怕丑把贴删了.


我贴什么了??你也懂VB吗?写个游戏我们看看。

54

主题

2916

帖子

3765

积分

论坛元老

Rank: 8Rank: 8

积分
3765
QQ
发表于 2006-9-15 17:07:00 | 显示全部楼层

Re:D3D的碰撞贴图

恩!?突然发现(以前看头像没注意ID),楼上两位什么时候一个从2006变到2007和另一位从5世升迁到站长的?[em24]

你们还真幽默。 [em10]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 10:09

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表