孤岛危机教程:从3ds max输出到CryEngine2

时间:2015-10-20 来源:88130安卓下载 作者:佚名

从3ds max输出到CryEngine2

由于官方尚未发布有关的3ds max插件,所以我只是翻译一下,有错误还请指正。


screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" style="FILTER: ; WIDTH: 450px; CURSOR: hand; HEIGHT: 359px" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" height=359 alt="Click here to open new windowCTRL+Mouse wheel to zoom in/out" hspace=0 src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154621732.jpg" width=450 onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0 resized="true">

介绍:在这篇教程里面你要在3ds max中创建一个简单的物体并导出为CGF格式,假定你很熟悉3ds max的基础操作和多边形建模
文件夹结构:物体文件夹必须放置到游戏根目录下面,这篇教程中,我创建的物体叫Testbox,不放在游戏目录引擎就不能工作。

物体:这篇教程中,建立一个3-6米长度的盒子,因为Sandbox使用的测量单位也是米,你也可以使用厘米。

        3ds max中物体的轴心相应的也就是引擎中物体的轴心
         
        确保你创建的物体加入了光滑组命令(smoothing groups),引擎会为任何缺少光滑组的模型添加此效果。
   
        确保你的物体有UVW贴图(UVW mapping)

        你可以为你的物体添加任何修改堆栈,这不会影响你输出模型到引擎,你在引擎中看到的就和在3ds max看到的一样

        创建的模型面数越多,导入的时间越长,尽管导入很快

        你的模型必须是可编辑网格(editable mesh)和可编辑多边形(ditable poly)中的一种


0. 为物体创建材质:为使用纹理和着色器,你的模型需要材质。材质存储在MTL格式文件中。这里我们在3ds max中创建材质并把它



转换为MTL格式的文件,这可以被Sandbox的材质编辑器编辑。
1. 打开3ds max的材质编辑器(material editor)
2. 选择一个新的材质球,点击标准(Standard)按钮,材质类型为多维/子对象(Multi/Sub-Object)
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" style="FILTER: ; WIDTH: 450px; CURSOR: hand; HEIGHT: 466px" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" height=466 alt="Click here to open new windowCTRL+Mouse wheel to zoom in/out" hspace=0 src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154625550.png" width=450 onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0 resized="true">

3. 设置子材质数量为3个,引擎支持最大32个子材质,当然用的越多,效率越低。所以要尽可能减少多余子材质的使用

4. 给材质和子材质命名,材质的名称就是材质文件的名称。这里材质名为Testbox,材质文件名就是Testbox.mtl
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154628687.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

5. 打开各个子材质,更改着色器类型为Crytek Shader,你只能使用这个类型。




screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154628365.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

6. 你现在需要关注的是Physicalization下拉列表,里面有一些引擎预设的材质,目前需要注意的是Default 和 Physical Proxy类型
    * Default 是正常的材质类型。 你的大多数材质都用这一类型,它没什么特殊的。

    * Physical Proxy 是一种特殊的材质用来实现物理效果。它是看不见的。
7. 第三个子材质类型应该是physics proxy (等会解释),把它的physicalization type设置为Physical Proxy。

8. 勾选Physicalization下拉列表左面的Physicalize ,这会为材质添加物理属性,否则该物体就没有物理效果。
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154630327.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

9. 除了physics proxy子材质我们要为其他2个子材质指定纹理贴图



点开第一个子材质,贴图通道选择漫反射(Diffuse Color ),选择位图(Bitmap)
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" style="FILTER: ; WIDTH: 450px; CURSOR: hand; HEIGHT: 469px" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" height=469 alt="Click here to open new windowCTRL+Mouse wheel to zoom in/out" hspace=0 src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154632509.png" width=450 onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0 resized="true">
选择你要使用的纹理贴图,这个可以自己画或者修改素材得到,只要不是FLASH文件就可以了
然后,选择凹凸法线(Bump Normals)通道,也找一张位图(法线贴图)
最后,,为第二个子材质指定贴图,重复上面两步。

10. 将这个多维材质赋予物体
更改材质ID号,ID号数目不要超过子材质数量,这里只要2个ID号(1和2)即可

11. 为模型创建物理效果,需要第二个相同的模型来实现,并且是闭合的,第三个子材质的用途就在这里了
    在元素级别复制一个物体,然后把第三个子材质(physics proxy类型)赋予它



12. 创建材质文件,在工具(Tools)面板-更多(More)打开CryENGINE®2 Exporter Utility,把它拖到剩余按钮上去。

找到Material 折叠项目
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154633201.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
确认你的材质编辑器里选中的材质球在最上面一级即多维/子材质,而不是在子材质下面,点击Create Materia
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154634176.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
打开一个对话框输入文件名为testbox,和材质名是一样的,保存

screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154634529.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
这就是你导入的材质,关闭material editor



13. 模型导出,选中你的模型(可以一次性多选),点击Add Selected 按钮

screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154635415.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
点击Export Nodes导出模型,它会生成在MAX文件的同一文件夹下,你可以通过点击Explore来查看该文件夹,也可以在Geometry

Export Options里面更改文件名。

14. 在Sandbox里查看你的模型,载入一个关卡,点击Brush,找到你的物体,拖到视图中
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154635932.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154636376.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>



15.附加说明
你可以按M打开材质编辑器,找到你的材质,选中材质,赋予它(最左边的小按钮)

screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154642404.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
16. 允许阴影
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154643541.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

17.测试你的模型
按CTRL+G进入游戏模式测试你的模型,Reload按钮允许你再次载入在MAX中修改的模型

screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" alt="" src="http://img4.gamersky.com/Files/GamerSky/handbook_UploadFiles_4058/200711/20071105154643938.png" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

有时你会发现按了Reload按钮之后physicalized geometry没有发生变化,你可以删除物体然后按CTRL+Z,physicalized

geometry 就会变化当关卡再次载入的时候

Console command P_Draw_Helpers 1会显示physicalized geometry,设为0为不显示
Console command E_Debug_Draw 1会显示有关物体不同的信息,比如多边形数,材质数量等

原文地址:

Enforcer /游侠会员




>>孤岛危机 攻略秘籍专区



热门搜索

手游排行榜

  • 最新排行
  • 最热排行
  • 评分最高