Elvas Tower: ORTS new shape format??? - Elvas Tower

Jump to content

  • 37 Pages +
  • « First
  • 13
  • 14
  • 15
  • 16
  • 17
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

ORTS new shape format??? Rate Topic: ****- 3 Votes

#141 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 18 January 2022 - 06:20 AM

I have created a pull request with adding experimental glTF 3D file format support. I have also tried to modify the scenery shader to support the needed PBR lighting (including normal map, emissive map, occlusion and metallic, roughness textures). One can make a try with loading a gltf format model by e.g. modifying the kiha31.eng WagonShape() function to reference a gltf file there instead of a .s

I've also added animation support for the gltf files. For this tech demo purposes I temporarily assign the "ORTSITEM1CONTINUOUS" name in the gltf loader automatically for the first animation clip found. This is a looping animation controller, that can be activated by the <Shift+,> (comma) key sequence in the default configuration. If the gltf loaded contains an animation sequence, then it starts playing.

For example download this nice rhino: https://sketchfab.co...ea9e3fd421f55b4
When it is loaded as a kiha31 engine and the animation is activated, he starts his idle loop animation by moving around his head and screwing ears.

But many other gltf-s will work, although some don't yet. Some have extensions that are not yet supported, but some others just don't show up properly. Some more work definitely will be needed on this.

EDIT: I've limited the number of the skinning bones to 50. I believe the current architecture's (DX10) hard limit is 128, but I have no clue if it is good or bad to maintain a lower limit than that, just 50 looked like a good number. :-)

#142 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 18 January 2022 - 06:39 AM

View Postgpz, on 18 January 2022 - 06:20 AM, said:

I have created a pull request with adding experimental glTF 3D file format support. I have also tried to modify the scenery shader to support the needed PBR lighting (including normal map, emissive map, occlusion and metallic textures). One can make a try with loading a gltf format model by e.g. modifying the kiha31.eng WagonShape() function to reference a gltf file there instead of a .s

I've also added animation support for the gltf files. For this tech demo purposes I temporarily assign the "ORTSITEM1CONTINUOUS" name in the gltf loader automatically for the first animation clip found. This is a looping animation controller, that can be activated by the <Shift+,> (comma) key sequence in the default configuration. If the gltf loaded contains an animation sequence, then it starts playing.

For example download this nice rhino: https://sketchfab.co...ea9e3fd421f55b4
When it is loaded as a kiha31 engine and the animation is activated, he starts his idle loop animation by moving around his head and screwing ears.

But many other gltf-s will work, although some don't yet. Some have extensions that are not yet supported, but some others just don't show up properly. Some more work definitely will be needed on this.


Hi Peter,

PBR textures were a "game changer" when introduced in Flight Sim - I'm intrigued. Thanks for your efforts.
:)

Regards,
Scott

#143 User is offline   Eldorado.Railroad 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 977
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 18 January 2022 - 09:35 AM

View PostSerana, on 10 January 2022 - 06:13 PM, said:

- Microsoft and Asobo have decided to use glTF 2.0 as a shape file format for Microsoft Flight Simulator. So they recognize the format is mature enough to base their game on it and the user base is growing quickly. (https://docs.flights..._Principles.htm)



Would you happen to know if they have DRMed there files? This is what happened with Trainz and FBX. It needs to be "converted" to a .trainzmesh format before it can be used!

#144 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 18 January 2022 - 10:11 AM

glTF is not a Microsoft standard, it is open.

#145 User is offline   Eldorado.Railroad 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 977
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 18 January 2022 - 10:22 AM

View Postgpz, on 18 January 2022 - 06:20 AM, said:

I have created a pull request with adding experimental glTF 3D file format support. I have also tried to modify the scenery shader to support the needed PBR lighting (including normal map, emissive map, occlusion and metallic, roughness textures). One can make a try with loading a gltf format model by e.g. modifying the kiha31.eng WagonShape() function to reference a gltf file there instead of a .s

I've also added animation support for the gltf files. For this tech demo purposes I temporarily assign the "ORTSITEM1CONTINUOUS" name in the gltf loader automatically for the first animation clip found. This is a looping animation controller, that can be activated by the <Shift+,> (comma) key sequence in the default configuration. If the gltf loaded contains an animation sequence, then it starts playing.

But many other gltf-s will work, although some don't yet. Some have extensions that are not yet supported, but some others just don't show up properly. Some more work definitely will be needed on this.


I have looked at these sites to get a better understanding:

https://en.wikipedia.org/wiki/GlTF

https://www.khronos.org/gltf/


This of course is a trial run to perhaps understand performance parameters. I suppose we will ONLY support version 2.0? While 2.0 seems to have been around since 2017, I wonder if there is movement afoot to expand on this format? Already there are giTF file viewers online that do NOT support 1.0. Modelers will want some stability to work with. While this is still experimental for OR, backwards compatibility will be important. The redeeming quality of the MSTS shape file is that it is frozen. If suddenly there is a 3.0 version of giTF are we going to support it as well, even if the file is not backwards compatible?

This issue already occurs with .blend files, where version X will not load in version Y and vice-versa. Also I am worried about the maintenance of exporters for programs like Blender, not many of us are willing to invest in expensive modelling programs and Blender for all its shortcomings is at least free.

The intriguing aspect of giTF is the binary version, where everything is in a single file. Blender apparently allows you to load such a file, but does it also break down the constituent parts, such that I can extract the animations, textures, mesh etc? Are we going to support the binary only version of giTF? However simple this might be to deliver, it is NOT my first choice.

I am not sure whether 50 bones limit is a good idea. Speaking of the outside of a train model, there are situations right now that the .s file cannot address. These include louvers for radiators, which can have multiple vanes that could chew up 50 bones with little effort. Additionally, the inside of a 3D cab can and will have more than moving needles to deal with, these can include many switches/levers/wipers etc. The 50 bone limit might be too little. But as stated, this is a trial only.

From a modelers point of view, the sheer number of parameters to deal with, compared with a .s file will be a very steep learning curve! While not conclusive, there seems to be multiple instances where the expected results are not what was programmed into the model. There are some giTF models at the Smithsonian Institute website, but oddly enough the .obj formats are full resolution, but the giTF are not. This is a shame, as the examples provided have a lot of nice textures and mesh detail to work with. I am a bit of a coward for trying out "new" things, until there are good examples to work with and to learn from. I hope a rather detailed model of a train will show up in the giTF format that I can learn from.

Our opinions at times vary greatly, but I acknowledge that you are a courageous trailblazer when you have the time and energy to do it. So above all, thank you, for moving ahead with this. I hope it is not too much of a programming headache to accomplish.

Steve

#146 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 18 January 2022 - 11:31 AM

I wrote my gltf loader 3-4 years ago for the 1.0 version, but I rewrote it entirely in favor of the 2.0 version, and I abandoned the original code, so v1.0 gltf-s are no longer possible to load. But as the wikipedia page writes, 2.0 is so different in many aspects, and so much more "game friendly" (as opposite to the 1.0 which was webgl friendly), that there is no point in supporting the 1.0 version. Honestly, working with 1.0 was a bit confusing, it didn't entirely fit to the Openrails needs, I just didn't know what to do with those built-in shader parameters. Seemed like that was written for supporting platforms not having a proper shader in the background, or don't know. But in 2.0 all these tentacles got dropped, a new concept of lighting (PBR) had been added. It got brought up to a first class game background format, that perfectly fits the needs of professional games, as far as I can tell. It also has reference implementations with free licenses, which was important to me, since I am not a professional programmer, and I am not a mathematician either, so I needed places to get inspiration from. I adapted these pieces for the OR functions.

I haven't read about any upcoming 3.0 version. Companies not satisfied with the feature set add extensions to the 2.0 format, which can also be done in a standardized way, see e.g. https://github.com/K...Vendor/MSFT_lod

I would like the binary version be also supported, actually I think as much of the gltf ecosystem would be good to be supported as possible. There's nothing wrong with supporting anything standard, the problems come when we need semi-standards to be supported, like the definition of whether the emissive texture follows the day-night cycle or not, and such.

The 50 bones limit only applies to a "skin", not the overall number of nodes. The "skin" term here means the vertex shader's skinning math, not the textures, that we sometimes also call as skins. Probably this type of skinning would not be used at all for vehicle and building models. It's main use is to model real skins, like the human skin, or the rhino skin I showed above as an example.

#147 User is offline   ExRail 

  • Fireman
  • Group: Status: Active Member
  • Posts: 155
  • Joined: 31-December 21
  • Gender:Male
  • Simulator:ORNYMG
  • Country:

Posted 18 January 2022 - 12:37 PM

This sounds great, I read up on the format the other day but looking at the 3D rhino moving I imminently thought of the floating 2D cows I saw yesterday while exploring a otherwise beautiful route (Ruta Zona Centro)
Now I imagine grazing 3D animals blocking the track and getting spoked by the train whistle and start running away :-)
okay collision maps and interaction between player and scenery objects aside (but that's working for the turntable I assume)
for a start it would be great if it was just in 3D and was moving a bit.

I'm hoping for a 3D file format that I can open directly in Blender and export again after a few changes and see the results,
just like the PNG's in the Content folder, or DDS's when using Gimp, with no converting prolonging the process,
glTF sounds like a step in that direction.

#148 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 18 January 2022 - 11:07 PM

View PostEldorado.Railroad, on 18 January 2022 - 10:22 AM, said:

There are some giTF models at the Smithsonian Institute website, but oddly enough the .obj formats are full resolution, but the giTF are not. This is a shame, as the examples provided have a lot of nice textures and mesh detail to work with.

Just out of curiosity, can you provide a source for this statement? I'm asking because this doesn't sound logical to me, given that Smithsonian seems to have its own obj to gltf converter: https://github.com/S...n/dpo-meshsmith
Anyway, the model library is really interesting, indeed. I haven't heard about it before, thanks for the heads up!

Answering your other question: binary and non-binary gltf-s can be converted one from the other, they have the same data content, just stored differently. See for example: https://marketplace....ium.gltf-vscode

#149 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 805
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 19 January 2022 - 03:17 AM

while I applaud any path forward that uses open standards, I mostly support any ideas that get us out of 2000 era texture standards. If this option can support PBR textures, I'm all for it. I'm not saying PBR is something I understand yet or that I'm good at it... but this at least brings us into a modern era with regards to visual capabilities. Anything that works with Blender also gets my support.

#150 User is offline   Eldorado.Railroad 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 977
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 19 January 2022 - 06:53 AM

View Postgpz, on 18 January 2022 - 11:07 PM, said:

Just out of curiosity, can you provide a source for this statement? I'm asking because this doesn't sound logical to me, given that Smithsonian seems to have its own obj to gltf converter: https://github.com/S...n/dpo-meshsmith
Anyway, the model library is really interesting, indeed. I haven't heard about it before, thanks for the heads up!


The website for the Smithsonian Institution, 3D Digitization, in general:
https://3d.si.edu/explore

Items that are more "mechanical" in nature (Keep in mind this is the USA!):
https://3d.si.edu/ex...m%2BCollection

Something you might have seen/heard about:
https://3d.si.edu/ob...25-120ff7f8d652

In every case the hover/pull down menu for downloads indicate FULL RESOLUTION 3D Mesh for .obj format only, all other downloads are in low resolution. Hard to explain why this is.

View Postgpz, on 18 January 2022 - 11:07 PM, said:

Answering your other question: binary and non-binary gltf-s can be converted one from the other, they have the same data content, just stored differently. See for example: https://marketplace....ium.gltf-vscode


How I wish this was a standalone tool and NOT integrated into Visual Studio. I will have to see what Blender does with binary .glb files, whether it can load and "dissect" them into mesh/textures/effects etc. Maybe Mr. Willard might want to take a look at this (please)? I cannot run the latest version of Blender in Win7, which also has a "newer" giTF importer/exporter. I can most likely run the latest version of Blender in Linux Mint, live from a USB thumb drive.

For anybody who might like to look at this I will attach a free .gib I found yesterday:
Attached File  GroundVehicle.zip (5.36MB)
Number of downloads: 161

Steve

  • 37 Pages +
  • « First
  • 13
  • 14
  • 15
  • 16
  • 17
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users