UE4 FBX Static Mesh Pipeline
来源:互联网 发布:太空电梯 知乎 编辑:程序博客网 时间:2024/05/19 16:49
The StaticMesh support in the FBX import pipeline makes getting meshes from 3D applications into Unreal Engine 4 a simple, painless task. When meshes are imported, the textures used in the materials applied to those meshes in their respective 3D application (diffuse and normal map only) are also imported and, in turn, used to generate the materials applied to the mesh in UE4.
Features supported for importing Static Meshes using FBX:
Static Meshes with materials including textures
Custom collision
Multiple UV sets
Smoothing groups
Vertex colors
LODs
Multiple separate Static Meshes (can also be combined into a single mesh at import)
General Setup
In general, you are free to create Static Meshes using any tools and methods you want. There are some stipulations as far as setting up UVs, placement of the mesh, etc. that you need to account for in order for the exporting and importing to go smoothly and for the mesh to work properly in Unreal Editor.
Pivot Point
The pivot point of the mesh in Unreal Engine determines the point around which any transformations (translation, rotation, scale) will be performed.
The pivot point is always located at the origin (0,0,0) when exporting from a 3D modeling application. Because of this, it is best to create your meshes at the origin, with the origin generally being located at one corner of the mesh to allow for proper alignment when snapping to the grid inside of Unreal Editor.
Triangulation
Meshes in Unreal Engine must be triangulated as the graphics hardware only deals with triangles.
There are several ways you can ensure your mesh is triangulated.
Model the mesh with only tris - best solution, provides the most control over the end result.
Triangulate the mesh in the 3D app - good solution, allows cleanup and modification before export.
Allow the FBX exporter to triangulate the mesh - okay solution, allows no cleanup but can work for simple meshes.
Allow the importer to triangulate the mesh - okay solution, allows no cleanup but can work for simple meshes.
It will always be best to manually triangulate the mesh in the 3D application, controlling the direction and placement of edges. Automatic triangulation can lead to undesirable results.
UV Texture Coordinates
The import of multiple UV sets is supported by the FBX pipeline in Unreal Engine 4. For Static Meshes, this is generally used to handle one set of UVs for the diffuse. There are no special requirements for setting up the UVs for Static Meshes using the FBX pipeline.
Creating Normal Maps
Normal maps can be created for your meshes directly inside of most modeling applications by creating both a low-res render mesh and a high-res detail mesh.
The geometry of the high-res detail mesh is used to generate the normals for the normal map. Epic uses a workflow internally that introduces XNormal into the process and generally results in much better normals when rendering inside of Unreal Engine 4. For details on this process, see Normal Map Creation Guide.
Materials
The materials applied to meshes modeled in external applications will be exported along with the mesh and then imported into Unreal. This streamlines the process as textures do not need to be imported separately in Unreal, materials do not need to be created and applied, etc. The import process is capable of performing all of these actions when using the FBX pipeline.
These materials also need to be set up in a specific way, especially when the mesh has multiple materials or the order of the materials on the mesh is important (i.e. for character models where material 0 needs to be the body and material 1 needs to be the head).
For complete details of setting up materials for export, see the FBX Material Pipeline page.
Collision
Simplified collision geometry is important for optimizing collision detection in-game. Unreal Engine 4 provides basic tools for creating collision geometry within the Static Mesh Editor. Some circumstances, though, are best handled by creating custom collision geometry within your 3D modeling application and exporting it with the render mesh. Generally, this is true for any mesh with an opening or concave area that objects need to not collide with.
For instance:
Doorway meshes
Walls with window cutouts
Oddly shaped meshes
Collision meshes are identified by the importer based on their name. The collision naming syntax should be:
Caveats and Considerations
RenderMeshName
must be identical to the name of the render mesh the collision mesh is associated with in the 3D application. So if you have a render mesh named **Tree_01
** in your 3D application, your collision mesh should be in the scene with that mesh and namedUCX_Tree_01
, and then exported along with the render mesh to the same FBX file. If you need more than one collision object for a mesh, you can extend their names with further identifiers, such as:UCX_Tree_01_00
,UCX_Tree_01_01
,UCX_Tree_01_02
, etc... and they all will be associated as collision for that mesh.
Currently, spheres are only used for rigid-body collision and Unreal's zero-extent traces (e.g. weapons), not non-zero extent traces (e.g. Player movement). Also, spheres and boxes do not work if the StaticMesh is non-uniformly scaled. In general you probably want to createUCX primitives.
Once your collision objects are set up, you can export both the render and collision mesh in the same .FBX file. When you import the .FBX file into Unreal Editor, it will find the collision mesh, remove it from the render mesh, and turn it into the collision model.
Breaking up a non-convex mesh into convex primitives is a complex operation, and can give unpredictable results. Another approach is to break the collision model into convex pieces yourself in Max or Maya.
In the case of an object whose collision is defined by multiple convex hulls, results are best when the hulls do not intersect with one another. For example, if the collision for a lollipop were defined by two convex hulls, one for the candy and one for the stick, a gap should be left between the two as in the following illustration:
UCX_Candy
Small gap between collision surfaces
UCX_Stick
Vertex Colors
Vertex colors for Static Meshes can be transferred using the FBX pipeline. No special setup is necessary
Export Mesh
Static Meshes can be exported individually or multiple meshes can be exported to a single FBX file. The import pipeline will separate multipleStatic Meshes into multiple assets within the destination package unless specified to combine the meshes by enabling the Combine Meshessetting at the time of import.
Import Mesh
Click the button in the Content Browser and choose Import. Navigate to and select the FBX file you want to import in the file browser that opens. Note: you may want to select in the dropdown to filter out unwanted files.
Choose the appropriate settings in the Import dialog. The defaults should be sufficient in most cases. See the FBX Import Dialogsection for complete details of all of the settings.
Click the button to import the mesh(es). The resulting mesh, material(s), and texture(s) will be displayed in the Content Browserif the process was successful.
By viewing the imported mesh in the Static Mesh Editor and enabling the display of collision, you can determine that the process worked as expected.
- UE4 FBX Static Mesh Pipeline
- UE4 FBX Content Pipeline
- UE4 Static Mesh LODs
- UE4 BP Instanced Static Mesh
- Mesh---mesh(fbx)的获取
- UE4 动态创建Actor并且附加static mesh
- UE4 Procedural Mesh Generation
- UE4 Runtime Mesh Component
- Ogre3D Mesh转换到FBX格式
- UE4 FBX静态网格物体通道
- ue4-UDecalComponent组件,紧贴Mesh的材质
- ue4 如何动态改变mesh材质
- UE4实现在UI Widget上显示Mesh
- [UE4]如何替换角色Mesh上的Material材质
- Pipeline
- PIpeline
- pipeline
- Pipeline
- boost线程之类成员函数
- 数组组成最小数字
- UE4 Static Mesh LODs
- 2015多校联合第三场5319painter
- 程序=方案+代码
- UE4 FBX Static Mesh Pipeline
- Objective-C语法之代码块(block)的使用
- 深度学习
- java list转换为树形
- 20150902学习记录
- 数据结构中排序算法- 二叉树排序(7)
- OC中得Protocol
- sql 触发器快速入门
- mybatis生成Java类和xml文件工具包