当前位置:网站首页>Feasibility of importing UE4 using gltf with instances

Feasibility of importing UE4 using gltf with instances

2022-06-24 01:16:00 Jean

author :Huang Jiahe

Catalog

Use... With instances Gltf Import UE4 The feasibility of 1. Used by jinhengyu js A containing instance is generated Gltf 2. take Gltf Import UE4 3. Conclusion Take the artificial island as an example file size Import effect And FBX Comparison file size Name Open source

Use... With instances Gltf Import UE4 The feasibility of


1. Use js A containing instance is generated Gltf

File size is :21K

Gltf Contains a cube Mesh,Cube be known as :Cube.009

1. "meshes": [
2.  {
3.  "name": "Cube.009",
4.  "primitives": [
5.  {
6.  "attributes": {
7.  "POSITION": 0
8.  },
9.  "indices": 1
10. }
11. ]
12. }
13. ]

The scene is 10*10 individual Cube Example [ common 100 individual ], Of each model Name by : Number of columns _ Row number

1. "nodes": [
2.  {
3.  "mesh": 0,
4.  "name": "0_0",
5.  "translation": [
6.  0,
7.  0,
8.  0
9.  ]
10. },
11. {
12. "mesh": 0,
13. "name": "0_1",
14. "translation": [
15. 0,
16. 0,
17. 10
18. ]
19. },.....
20. ]

Gltf You can ask jinhengyu about the format requirements of , I don't know if there are other requirements for this .

2. take Gltf Import UE4

Use Datasmith Plug in import Gltf

Parameter selection :Gltf The middle coordinate is expressed in m In units of ,UE4 Middle coordinates in cm In units of , So you have to multiply all the coordinates by 100

Import results :

Only one... Was imported Cube Model , And generate... In the world outline 10*10 A model , and Gltf In the agreement , In line with expectations .

The name of the model in the scene is also the same as Gltf Agreement , It is convenient for subsequent construction ID Corresponding . After testing, it can also support Chinese , however : If UE4 There is already a model with the same name in , New model name suffix will be added _2

There is only one model asset , Of the model UE4 The asset size is 86K, If put 100 individual Cuhe, The total asset size is 8.4M, Greatly reduce the number of models .

Be careful :Gltf in "translation": [ 0, 0, 10] They correspond to each other UE4 Medium X,Z,Y

3. Conclusion

Gltf The model with instantiation is very useful for us . And it can better support .

The test coordinates are 30 It can be imported normally from km away .

Take the artificial island as an example

file size

FBX The models in are pure models

With HZMB-EI-DY-OSD-01-S3_1.fbx For example ,FBX It contains 630 A model , Among them is 627 All of them are the same model

FBX File size is : 23M

Import it into Bentley,Dgn File size is : 33M

Import it into UE4 In the following ,UE The asset size is : 76M

Import effect

To import Bentley As an example

You can see that most models are identical , But it is not a shared component , Will cause the file to be on the hard disk 、 A large amount is stored in the memory .

3dmax A screenshot of the model

Gltf Model files can use instantiated models , That is, if there is... In the model file 300 An example of the same model , Only the position of the model is changed 、 rotate 、 The zoom , In this case Gltf Save only one copy of the model , Other models reuse this model , It can greatly reduce the file size , Improve file reading speed .

And FBX Comparison

file size

FBX The stored model does not contain instance effects , File storage is large , Reading files is slow .

Gltf Can store instance models , File storage is small , Read files faster .

If the models of the whole bridge are available in the future , The amount of model data will be very large , It is a burden for both hard disk and memory . To make it easier to view the model , It requires a lot of memory , Use Gltf Instance model can reduce memory and hard disk

Name

FBX The name contained in is garbled

Gltf The name of , Strictly follow the... In the field name name , Easy to control

Open source

FBX The disadvantage of the format is that it is a closed format . visit FBX The only official way to use the data in the file is to use the official SDK.

Gltf The format is open 3D Model and scene formats , It aims to effectively transmit rich scenes 3D data .

Gltf Easy to read and write , You can use one of several open source libraries to glTF The file is read into the custom application , You can also write your own import program .glTF Format use JSON Descriptor file , This document describes glTF Contents and properties of .

原网站

版权声明
本文为[Jean]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211119134223327R.html