If I recall correctly, putting the textures in the same folder as the gltf file is also valid, the name of the subfolder should not matter, as long as the name of the folder is exported correctly.
Exporting as PNG is correct, the glTF support will read png files.
Extra question: do you have Color/Alpha map textures, Metalness/Roughness map textures and normal maps for all of your texture files? I seem to remember that if one of the three is missing, this might render wonky results.
ORTS new shape format???
#342
Posted 18 November 2023 - 11:35 AM
About the dds problem I can say, it is not enough to replace the png texture by a dds. See here how to define that according to the standard: https://github.com/K...e_dds/README.md
I can investigate the material issue if you send me your model. It is hard to guess what the problem could be without seeing the model itself. :)
I can investigate the material issue if you send me your model. It is hard to guess what the problem could be without seeing the model itself. :)
#343
Posted 28 November 2023 - 05:56 AM
I was making manual edits to the gltf file and found if I removed the "COLOR_0":0, attribute then the texture would display correctly. I've made a boo boo in Blender with that material to cause the exporter to add the color attribute to material 0.
It's a step in the right direction and investigation continues as time permits.
"meshes":[
{
"name":"BODY_HIGH_DETAIL",
"primitives":[
{
"attributes":{
"COLOR_0":0,
"POSITION":1,
"NORMAL":2,
"TEXCOORD_0":3
},
"indices":4,
"material":0
}
]
},
{
"name":"WHEELS11",
"primitives":[
{
"attributes":{
"POSITION":5,
"NORMAL":6,
"TEXCOORD_0":7
},
"indices":8,
"material":1
}
]
},
It's a step in the right direction and investigation continues as time permits.
"meshes":[
{
"name":"BODY_HIGH_DETAIL",
"primitives":[
{
"attributes":{
"COLOR_0":0,
"POSITION":1,
"NORMAL":2,
"TEXCOORD_0":3
},
"indices":4,
"material":0
}
]
},
{
"name":"WHEELS11",
"primitives":[
{
"attributes":{
"POSITION":5,
"NORMAL":6,
"TEXCOORD_0":7
},
"indices":8,
"material":1
}
]
},
#344
Posted 28 November 2023 - 06:09 AM
Ah, glad you found the solution. I'm sorry for not looking into the issue yet. :( Yes, normally one applies either a color or a texture to a face, but not both. :)
#345
Posted 28 November 2023 - 07:27 AM
Please don't be sorry. I haven't looked at the model until today and a fresh more careful look at the glTF made more sense this time. Again thanks for your contribution to this area of OR.
#346
Posted 09 December 2023 - 08:18 AM
The cause of the material not displaying correctly was due to me having applied some vertex painting to the geometry at some time during construction. Removing the vertex painting from the 'problem' objects resolved the issue.
For Blender users who may be interested, I found the following series of tutorials on glTF very informative.
Part 1: Intro to using Blender to create glTF files
https://www.youtube....d_S3oSmdRcEiKCp
Exporting Blender animations to glTF and STK
https://www.youtube....h?v=pNA8ujgtogM
I'm currently trying to get the animations working on the external model and after that will delve deeper in the PBR side of things. Theory is one thing, practice is another.
For Blender users who may be interested, I found the following series of tutorials on glTF very informative.
Part 1: Intro to using Blender to create glTF files
https://www.youtube....d_S3oSmdRcEiKCp
Exporting Blender animations to glTF and STK
https://www.youtube....h?v=pNA8ujgtogM
I'm currently trying to get the animations working on the external model and after that will delve deeper in the PBR side of things. Theory is one thing, practice is another.
#347
Posted 19 December 2023 - 05:31 AM
I think we are going to need some OR specific doumentation on how to properly do glTF handling with Blender before long.
#348
Posted 19 December 2023 - 08:34 AM
The glTF or glb export from Blender is straight forward. The model has to be rotated 180 degrees in the Z axis if you want your loco facing 'forward'.
It's great that the textures are created and exported at the same time as the geometry and glb packs it all into a single file format.
Animations are not working yet.
Being able to import a glTF/glb file and be able to edit the geometry and texture mapping is going to open many more possibilities for modders.
It's great that the textures are created and exported at the same time as the geometry and glb packs it all into a single file format.
Animations are not working yet.
Being able to import a glTF/glb file and be able to edit the geometry and texture mapping is going to open many more possibilities for modders.
#349
Posted 19 December 2023 - 10:43 PM
Animations are working, just had been disabled by a setting until we decide if we want different names for them or not.
#350
Posted 22 December 2023 - 07:40 AM
I hope that at some near future time there will be some clear/concise documentation regarding the export of glTF or glb to OpenRails.
Steve
Steve