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

Jump to content

  • 37 Pages +
  • « First
  • 34
  • 35
  • 36
  • 37
  • You cannot start a new topic
  • You cannot reply to this topic

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

#351 User is offline   superheatedsteam 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 506
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 23 December 2023 - 01:42 AM

Firstly my standard disclaimer that I'm self taught, I'm not an expert but this is what I did to export a glTF locomotive model that works in the unstable version of OR. The PBR side is considerably more involved and something I am still in the process of learning and applying to this model. I have only applied roughness and metallic maps to this model so far but the procedures to apply the others is similar.

I have posted it before and I will keep posting the following link to a series of videos on how to export a glTF model from Blender.

https://www.youtube....d_S3oSmdRcEiKCp

It provides insights into the format beyond just the workflow. I have watched a number of other Blender/glTF videos as well in order so see a variety of techniques and find the ones that I need to get the results I want for my models.

The Blender help page on glTF is also a valuable resource.

https://docs.blender...cene_gltf2.html

The more you know about glTF and PBR the better placed you will be to achieve the results you want in your model.

The export to glTF from Blender is very much like exporting to .S.

Go into right view and the front of the locomotive should be facing left. This is the reverse orientation if you are exporting a .S file. If your model is not facing to the left in 'Right' view, rotate the model 180 degrees in the Z axis. Rotations may/probably will need to be reset on all objects, but as animations are not enabled as yet I'm not sure about this. If the model is already animated then I don't know the impact of having to rotate the model would be on animations. The sooner you orient the model to the reverse to MSTS standard the less cleanup you have to do later. Then select all the objects you want exported and use:

File>Export>glTF 2.0 (.glb / .glTF)

In the Format drop down menu select which format you want. I've started to use the .glb as textures and geometry are bundled into a single file. If you want your textures separate or are sharing the same texture on multiple models then choose glTF. Any further reference to glTF or glb should be considered the same thing.

In the Include section ensure Limit to Selected Objects is checked. Here you can see the other selection options available to you.

Transform section should have a tick for +Y Up.

Because animations are not enabled yet this section does not need to be changed but I would suggest examining all the export options to see what is possible.

The exporter uses the textures that you have plugged into the PrincipledBSDF shader as a 'source', but the glTF exporter in Blender creates it's own textures that it saves where you instruct the exporter to save them, but I would suggest saving into the same folder as the glTF file if you want to view your model with some external 3D viewers. I use PNG to retain texture quality. JPG can be used to decrease file size but may result in compression artefacts that may have undesired results. Watch the videos in the link above for an example of these artefacts.

Once exported to the TrainSim\TRAINS\TRAINSET\my_locoName folder, edit the ENG/WAG file and change the shape file name from my_loco.S to my_loco.glb or my_loco.glTF as appropriate and save and test in game.

If you have Windows 10 or later it has a built in 3D viewer that you can view your model in as you would with ShapeFileViewer. If you don't have 3D Viewer on your computer there are other programs and online sites that you can use to observe your model external to the game engine.

The screen shot below shows how I have setup my model in Blender. This is not the only way to setup the shader so research to find a workflow that suit you.

Attached Image: glb_blender.jpg

The au_bhpb_sd70ACe_4096a.png file has the whole body UV mapped to it and then the AO is baked in Blender to another texture called AO_Bake_4096.png. This image is then saved from Blender and imported into GIMP. The AO_Bake_4096.png layer is the top most layer with a 'Multiply' mode applied to it. I then paint the livery colours on layers below the AO layer so the 2 are merged together to form a colour map with the baked AO multiplied to it. This is then exported and used as the 'BaseColor' in the PrincipledBSDF shader input. If I export this model as glTF now it would look like a MSTS model assuming roughness was set to 1.

Note the the alpha channel on this 'colour' texture file is also applied the the model on export.

On the bottom right is the au_bhp_sdf70ACe_4096a.rgh.png file. This is a hand made roughness map with stark contrast intentionally added to really emphasise how it influences the reflectivness of the material. This texture file is applied to the 'Roughness' input in the PrincipledBSDF shader.

When exported to glTF the colour map, roughness map, and any other maps are compiled together. Any black areas in the roughness map will make the corresponding area on the colour map 100% reflective. Any white area on the roughness map will make the corresponding area on the colour map non reflective. Gradients of grey between the black and white in the roughness map will result in corresponding levels of roughness from 0 to 1. This is the same principle as using alpha channels that control the level of translucency of objects in MSTS/OR models.

I draw your attention to the ColorSpace for the roughness map has been changed from sRGB to NonColor. Watch the videos in the link above for more insights into this setting.

The material view of the locomotive shows the starkness of the angled 100% smooth section over the BHP logo. The effect of the 'motted' part of the roughness map can be seen on the side of the cab. In reality the roughness map would consist of less black and white and a more subtle grey scale transitions as required to control how rough or smooth, and therefore reflective, respective parts of your model are.

Note that I am not limited to just using a texture file. I could and probably will end up using a procedural texture and plug it into the Roughness input (or any other input) and the glTF exporter will take those inputs and create it's own texture file to include/imbed into the model during the export process.

The screenshot below shows the same model in OR. Note this is a work in progress with a number of issues but I have included it for demonstration purposes. You will see the completely non rough area around the BHP letters is highly reflective and you can see the environment map reflected in it. The roughness in the cab side is a little bit more subtle as it it mottled but it still reflects the environment map because it's not 100% rough.

The window frames have an issue that I have yet to tackle. The rims of lights at the front of the cab as well as the wheel treads have 100% metallic map applied and as expected, look like shiny metal. The screenshot from Blender does not show the metal texture itself, but you can see the texture au_bhpb_sd70ACe_4096a.mat.png plugged into the Metallic node of the PrincipledBSDF shader.

The dynamics of the material are more apparent when moving your viewpoint in the game engine.

Attached Image: gltf_OR.jpg

Something to bear in mind is the 'openess' of glTF/glb if you are going to share or sell your models. If you open Blender and then import the glTF or glb file you can then edit the textures and geometry on the model as you desire. This will be of great benefit for the repainters that are prepared to learn a few operations in Blender. They will be able to tell where each face is mapped to on the texture sheet and if it does not fit in with the livery they are working on then they can move the mapping and edit geometry as it suits them.

I hope this helps others if they wish to move to this shape format.

#352 User is offline   SYogurt 

  • Fireman
  • Group: Status: Active Member
  • Posts: 142
  • Joined: 29-March 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 06 February 2024 - 02:10 PM

If animations could be properly supported in OR with this format, is there any reason at all NOT to use it from here on out? This seems like an improvement in so many ways once we can get trucks turning and wheels rolling. The openness of the format is a problem only if you are intending on selling models or care about people editing them, but given the niche community I can't see that being a bad thing for freeware.

#353 User is offline   superheatedsteam 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 506
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 06 February 2024 - 03:23 PM

View PostSYogurt, on 06 February 2024 - 02:10 PM, said:

is there any reason at all NOT to use it from here on out?


That is really up to the model builder and why they are doing all this in the first place. It takes more effort and requires learning new concepts and skills.

Subsequent to my last post, I have been unable to get a glTF/glb 3D cab view or a scenery object to work in OR as yet.

Also the glTF format may not make the OR 1.6 release (https://www.elvastow...post__p__303898).

#354 User is offline   Laci1959 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 950
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Alföld
  • Country:

Posted 06 February 2024 - 11:28 PM

View PostSYogurt, on 06 February 2024 - 02:10 PM, said:

If animations could be properly supported in OR with this format, is there any reason at all NOT to use it from here on out? This seems like an improvement in so many ways once we can get trucks turning and wheels rolling. The openness of the format is a problem only if you are intending on selling models or care about people editing them, but given the niche community I can't see that being a bad thing for freeware.


Hello.

Yes.
My biggest problem is that no utility knows it. Consist editors are activity editors.
I would like to use it as a landmark in track construction, but for the above reason I will not do so for the time being.

Sincerely, Laci1959

#355 User is offline   gpz 

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

Posted 07 February 2024 - 12:18 AM

View Postsuperheatedsteam, on 06 February 2024 - 03:23 PM, said:

Subsequent to my last post, I have been unable to get a glTF/glb 3D cab view or a scenery object to work in OR as yet.

It is not checked, that the format is accepted everywhere in the code yet. These are small changes to make them work, but they weren't the priority.

#356 User is offline   superheatedsteam 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 506
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 07 February 2024 - 02:29 AM

View Postgpz, on 07 February 2024 - 12:18 AM, said:

It is not checked, that the format is accepted everywhere in the code yet. These are small changes to make them work, but they weren't the priority.


Thank you for the clarification and thanks again for your contributions to OR.

#357 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 07 February 2024 - 03:31 AM

Hi Marek,

Some pretty exciting stuff - there - and some absolutely gorgeous model work.

Are those tiny little panel fasteners 3D?
;)

You've got some mad skills.
:thumbup3:

Once the kinks are worked out - one of the best ways to move forward as a community - is to provide a working example of what could be.

Thanks for taking the time to write this up.

Regards,
Scott

#358 User is offline   SYogurt 

  • Fireman
  • Group: Status: Active Member
  • Posts: 142
  • Joined: 29-March 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 07 February 2024 - 08:41 AM

For the projects I'm working on, I'd be interested in trialling this format if it gets to the point of being viable. I hadn't thought of the utilities not recognizing it, that might be a bigger issue in the short term. For now I'll push along with .s. The biggest advantage of the new format seems to be the reflectivity/roughness mapping, if we could do this, and normal or bump maps, even with .s, that would go a long way.

#359 User is offline   SYogurt 

  • Fireman
  • Group: Status: Active Member
  • Posts: 142
  • Joined: 29-March 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 07 February 2024 - 01:28 PM

View PostWeter, on 07 February 2024 - 01:00 PM, said:

Hi, Kyle.
Did You see that:
https://www.elvastow...tch-steamengine

This is very cool! However, it is unfortunately not very useful if wheel/bogie animations are still not enabled. Once the model could be properly animated, it would make sense to do cabs and locomotive models in this new format as these texture tools will drastically improve the look of materials in game.

View PostWeter, on 07 February 2024 - 01:31 PM, said:

I've seen some videos (cars are in progress too), and they were animated, IIRC.
I don't understand, how that could be done, too.

If that is the case, and I can find some documentation to figure out how to move forward with parts naming and structure of the model, I'll make the push to utilize this format. The problems with creating a consist or using the rolling stock in any existing editors that don't support it remains a problem, though.

#360 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 7,015
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 07 February 2024 - 01:42 PM

I believe, that was this post
https://www.elvastow...post__p__294732
earlier in this same thread.

  • 37 Pages +
  • « First
  • 34
  • 35
  • 36
  • 37
  • 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