Jump to content

glTF Export


Josh

2,565 views

 Share

The glTF importer took a very long time to develop, but it much easier to write a glTF save routine. In one day I got an exporter working with support for everything except skinning and animation. To save a model in glTF format, just call Model::Save("mymodel.gltf") and it will work! Entire scenes can also be saved in glTF format.Here is a model that was loaded from Leadwerks MDL, MAT, and TEX files and saved as glTF. The textures are converted to PNG files. (Microsoft has an official extension for adding DDS textures into the file, and I plan to implement that next.)

gltf.thumb.jpg.2433524ac68e588c58011a0f78ee270e.jpg

Take a look at the exported file in your favorite modeling application:

station.zip

So you can load a model from any format supported by import plugins, and then save it as glTF flawlessly. Or, you can set up an automatic conversion in your project settings, so that the editor will automatically convert files from one format to another any time they added or resaved in your project.

Image1.thumb.jpg.f71484d6ac265ee6151bc048d92c7016.jpg

Ultra Engine uses the most widely compatible file formats available, and loads assets directly from the standard computer file system, so your game assets are always easy to access, modify, and replace.

  • Like 5
 Share

8 Comments


Recommended Comments

Does that mean I can build a level out of for example 50 csgs  and save the entire complex level in one glTF model ? If yes will this collapse the meshes?

Link to comment
3 minutes ago, Marcousik said:

Does that mean I can build a level out of for example 50 csgs  and save the entire complex level in one glTF model ? If yes will this collapse the meshes?

Leadwerks does this automatically when a scene is loaded.

I probably would leave all objects as separate objects when exporting a glTF.

  • Like 1
  • Upvote 1
Link to comment

Here's the same model saved as a single .glb file with embedded textures, loaded in Blender with no problem:
gltfblender.thumb.jpg.83319a576be2c20aefde6bb54a939267.jpg

  • Like 3
Link to comment
19 minutes ago, Vida Marcell said:

i think nobody asked this question before, so what libary/sdk does leadwerks made with?

C++ and OpenGL?

  • Like 1
Link to comment

There's quite a lot of options. Blender or 3ds max won't load DDS or KTX textures, so you want to consider whether your models should be editable after they are saved. However, you can always load a GLB with KTX or DDS textures in Ultra Engine and resave it in the exploded GLTF format, with textures saved as PNG files for editing in a modeling program.

.glb with KTX2 textures is going to provide the fastest loading time and the smallest file size, by a lot.

Image1.thumb.jpg.f9a149d443f1066df4e4c37b6aaf1149.jpg

  • Like 1
Link to comment

Ok sounds good we can convert to glb + ktx in final stages of a game.

Ktx format will be coming to blender soon enough most likely.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...