游戏开发论坛

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

How to merge meshes and remove duplicated materials

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2008-11-6 20:05:00 | 显示全部楼层 |阅读模式
I has a special purpose to merage the meshes those materials maybe be duplciaed.
How do I remove the redundant materials.

  1. hr=D3DXConcatenateMeshes(ppMeshes,NumMeshes,Options,pGeomXForms,NULL,elems,m_pD3DDevice,&pMeshOut);
  2. hr=D3DXSaveMeshToX(L"xfile1.x",pMeshOut,NULL,merge_mat,NULL,nMaterials,D3DXF_FILEFORMAT_BINARY|D3DXF_FILEFORMAT_COMPRESSED);
复制代码

19

主题

638

帖子

638

积分

高级会员

Rank: 4

积分
638
发表于 2008-11-6 23:01:00 | 显示全部楼层

Re:How to merge meshes and remove duplicated materials

First modify you material list, then modify attribute table to reflect material changes, and then re-optimize mesh to make vertices of the same attribute adjacent.

19

主题

638

帖子

638

积分

高级会员

Rank: 4

积分
638
发表于 2008-11-7 14:51:00 | 显示全部楼层

Re:How to merge meshes and remove duplicated materials

lz已经在gamedev.net上得到相同答案了

本帖可沉
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-20 23:27

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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