游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1450|回复: 2

求助,关于vertex blending和index vertex blending

[复制链接]

11

主题

112

帖子

112

积分

注册会员

Rank: 2

积分
112
发表于 2007-6-1 19:11:00 | 显示全部楼层 |阅读模式
渲染骨骼动画时,比如arm和hand,hand被arm与parm影响,如果使用vertex blending渲染,那么压入parm, hand, arm 的矩阵,渲染出hand的mesh就行了。但是如果是body身体,因为身体连接到头,手,脚,影响body的矩阵已经超过了四个了,用vertex blending如何渲染?是不是把身体切成几个部分分开渲染呢?

如果用indexed vertex blending就好多了(SDK中有介绍,但非常少在SDK帮助文件中索引里填入indexed vertex blending就看到了)把手,头,身子,脚编个号,渲染身子时,就不会出现上面那种情况了。

好多人学骨骼动画,都用X文件,X文件里ConvertToBlendedMesh已经帮我们做好了一切,但是没有X文件时,就不知所错了。其实骨骼动画,vertex blending和indexed vertex blending两项技术(当然可以用HLSL自已实现)才是最重要的。不知道我理解得对不对?

11

主题

112

帖子

112

积分

注册会员

Rank: 2

积分
112
 楼主| 发表于 2007-6-1 19:25:00 | 显示全部楼层

Re:求助,关于vertex blending和index vertex blending

'D3DVBF_DISABLE - render using the standard 1-matrix transformation pipeline
'D3DVBF_0WEIGHTS - use first matrix only, but no weights specified in each vertex
'D3DVBF_1WEIGHT   - one weight value per vertex, use first two matrices
'D3DVBF_2WEIGHTS - two weight values per vertex, use first three matrices
'D3DVBF_3WEIGHTS - three weight values per vertex, use all four matrices
D3DDevice.SetRenderState D3DRS_VERTEXBLEND, D3DVBF_1WEIGHT

'standard code: tell D3D what data is being rendered next...
D3DDevice.SetVertexShader FVF_BLENDEDVERTEX2

11

主题

112

帖子

112

积分

注册会员

Rank: 2

积分
112
 楼主| 发表于 2007-6-2 09:44:00 | 显示全部楼层

Re:求助,关于vertex blending和index vertex blending

急切的等待回答!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-26 06:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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