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

Jump to content

  • 37 Pages +
  • « First
  • 17
  • 18
  • 19
  • 20
  • 21
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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

#181 User is offline   pwillard 

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

Posted 20 January 2022 - 03:11 PM

 Genma Saotome, on 20 January 2022 - 12:14 PM, said:

I am under the impression that the only bump mapping in OR is zero, nada, and zip. Is that incorrect?


I understand it to be that way as well... (Which is why ADDING it eventually... someday... maybe... would be a good thing)

#182 User is offline   gpz 

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

Posted 21 January 2022 - 01:19 AM

In glTF the concept of a normal map exists instead of a bump map. Bump maps can be theoretically converted to normal maps, see: https://blender.stac...from-a-bump-map

#183 User is offline   gpz 

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

Posted 21 January 2022 - 08:49 AM

 Genma Saotome, on 19 January 2022 - 08:49 PM, said:

Actually I really want ray tracing but I'm not holding my breath for that.

As I've read, raytracing doesn't play good with open world, enormous number of photons needed to be simulated. It is impossible to do that with the current hardware. Most advanced games also do raytracing only in closed places, like rooms.

#184 User is offline   Sid P. 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 463
  • Joined: 12-February 13
  • Gender:Male
  • Location:Canada
  • Simulator:Open Rails / MSTS
  • Country:

Posted 21 January 2022 - 09:14 AM

 gpz, on 21 January 2022 - 08:49 AM, said:

As I've read, raytracing doesn't play good with open world, enormous number of photons needed to be simulated. It is impossible to do that with the current hardware. Most advanced games also do raytracing only in closed places, like rooms.


As I recall, in the POV-Ray raytracer program (which was once associated with early Blender versions) the scene has to be redrawn any time there is any movement or changes in the viewed scene objects, or change in the location of the viewpoint (camera).

#185 User is offline   ExRail 

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

Posted 21 January 2022 - 02:25 PM

This new glTF format seams to spark a lot of imagination, first PBR and now ray-tracing,
while Open Rails still not have DX9 type textures shading using separate textures:
Mytrain.dds - Mytrain_normal.dds - Mytrain_fx.cfg (with the settings)

Would this not be a good place to start, so S shapes also gets an update if so chosen and not only glTF ?

Looking for Monogame and normal mapping this comes up, is it much more complicated than this,
for the dev's who implemented the current shaders in Open Rails ?

https://github.com/S...alMappingEffect

#186 User is offline   gpz 

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

Posted 24 January 2022 - 06:39 AM

With added the environment map, that turned out to be inevitable for the correct PBR rendering, the colors and outlook are getting really close to the other reference tools:

http://www.kepfeltoltes.eu/images/2022/01/24/123gltf_2.png
http://www.kepfeltoltes.eu/images/2022/01/24/650gltf_1.png

#187 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 24 January 2022 - 06:52 AM

 Sid P., on 21 January 2022 - 09:14 AM, said:

As I recall, in the POV-Ray raytracer program (which was once associated with early Blender versions) the scene has to be redrawn any time there is any movement or changes in the viewed scene objects, or change in the location of the viewpoint (camera).


Hi Sid,

As someone who uses POVray all the time - that's my understanding. 3DC is also linked to POVray and allows 3DC to "Bake" textures via the 3DC interface. The lighting calculations are based on the position of the objects relative to the positions of the defined lights.

Regards,
Scott

#188 User is offline   pwillard 

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

Posted 24 January 2022 - 07:38 AM

 scottb613, on 24 January 2022 - 06:52 AM, said:

Hi Sid,

As someone who uses POVray all the time - that's my understanding. 3DC is also linked to POVray and allows 3DC to "Bake" textures via the 3DC interface. The lighting calculations are based on the position of the objects relative to the positions of the defined lights.

Regards,
Scott


While I remember POVray from early 3D Canvas days... I honestly never used it much. I agree that POVRAY was only really suited to high-quality renders and is quite similar to Blender's rendering... for static output. It doesn't really apply to game engine work unless you use it to create your texture (taking advantage of various layers like 'normals', Ambient Occlusion, etc.)

Again... I'm all-in on supporting modern solutions to 20-year-old topics/issues.






#189 User is offline   gpz 

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

Posted 01 February 2022 - 05:15 AM

I would like to give a status report on this project. I started to implement the new model format as having a new geometry model in my head, that is more widely supported and used than our beloved .s format. But at this stage it turns out more to be a refresh of the whole 3D graphics subsystem, including the lighting shaders, LOD and animations.

I'm actually quite satisfied how the glTF models are appearing in the sim. The test models are generally looking right, there are only one or two of them having some problems. Theese models are put here to help the engine developers to test and certify their glTF loader. There are some here that use extensions not supported by my loader, theese don't look right. But beyond theese I could name one, the SimpleSkin, where one node is not animating as it should, and I couldn't figure out the reason yet. But anyway, the animations everywhere else I tested work alright, even at complicated models.

I have also added Image Based Lighting, which turned out to be an essential participant of the PBL lighting, because this is the part that enlightens the darkness of the scene. It involves using a fake environment map, that reflects on the mirroring parts and glasses, packed as a PNG in RGBD format, where the "D" channel acting as a divisor (in range 0..1) of the RGB channels to allow high dynamic range (HDR) lighting. This method was suggested in the EXT_lights_image_based extension, although the extension itself is not implemented, because currently I use a sole central image for IBL, not allowing separate glTF-s to inject their own. But in the long-term future I could imagine to place IBL-only glTF-s in the routes for different places having different images reflected (an urban one, a rural one, a mountainous one, etc...). For now I donwloaded one with green plains, clouds and distant hills, this one will be fine for a start.

Btw the night illumination will need to be sorted out. Probably a different IBL image (actually two: diffuse + specular) will be needed for the night, and also we will need to agree how we want to use the glTF emission texture. FlightSim has a switch in the model whether the emission effect should follow the day-night cycle or should be in effect everytime. There is no "night texture" concept in the glTF, the PBL (with IBL) is a more advanced technique for lighting.

I've also implemented the LOD handling, according to the MSFT_lod extension (node level LOD only yet, not material level, but I plan to add that as well). However I ran into a problem here: The glTF JSON deserializer I am using (The sample loader from Khronos) is unfinished in regards of loading the "extras" field in the json structure. This field is used nowhere else as far as I know, only here in this extension, and I just couldn't figure out how to get the relevant data (the screen coverage array). The relevant piece is at around line 234 in the GltfShape.cs in my PR, if someone has an idea, don't hold it back. (A sample model with MSFT_lod can be found here, if someone wants to try it out.) Actually there seems to be an easy-like fix in the deserializer, but fixing that would mean we could no longer use the nuget package supplied, but rather we would need to maintain a copy of the lib in our own repository, and using the dll committed to the 3rdPartyLibs folder, as we do it with the openal-soft package currently with the increased number of sources.

Just an interesting fact regarding the screen coverage array: The MSFT_lod extension doesn't use distance-based lod-ding, it uses a different concept called screen coverage. As I figured out, probably it comes from the Unity, where the objects are lod-ded based on how much space is covered on the the screen by them. Actually Unity measures the height only, so I implemented it also this way: if the LOD level is set to have a screen coverage of e.g. 0.2, that means that it gets activated in case the object bounding box's visible height increases above 20% of the screen height.

There are quite a few of further extensions defined for the glTF specification. I've mentioned the EXT_lights_image_based and MSFT_lod above. But there are some more that is worth mentioning:

MSFT_packing_normalRoughnessMetallic,
MSFT_packing_occlusionRoughnessMetallic: Theese are different texture packings: what texture functions are packed together. Can easily be supported. Actually the shader support is already there, only the extension flag needs to be passed.

MSFT_texture_dds: glTF by its basic specification supports only jpg and png textures, this extension adds the dds. Because of MonoGame limitations, only BC1, BC2 and BC3 (DXT1, 3, 5) is supported, it is already implemented.

KHR_materials_clearcoat: This would add 3 additional textures to the model (beyond the current 5). Actually this would need to be supported, because how the people more aware of the math behind describe, metallic texture alone is only for showing the metalness of the material, but vehicle "metallic polishing" adds another layer to the material. This "metallic polishing" is what they call "clearcoat" in PBR terms. So if want to make this kind of effect visible, then we need to add support for clearcoat.

KHR_lights_punctual: This extension adds the possibility to attach a light source to a model node. Supporting this would lead to really interesting scenery configurations, by allowing the random trackside objects to have real light sources attached, of 3 types: directional, point and spot. The spot light is in fact the same as is currently used as a headlight. Since supporting this would need the light receiving part to be "backported" to the .s objects, this would naturally bring the possibility of having more than one headlights (e.g. for AI trains) in the scene. This is not implemented yet.

KHR_materials_variants: This would allow for a mesh to have different materials with different textures. This would allow to have models with e.g. summer-winter textures, or a vehicle with multiple "skins". Exact usage is to be defined.

Those who interested can check the list and descriptions of the specified extension here: https://github.com/K.../extensions/2.0

Unfortunately I had to elevate the GPU shader model version requirement to 4_0. In the last stable Openrails version it is 4_0_level9_1 and 4_0_level9_3, which is actually DirectX9.1 and DX9.3, but it was not possible to transfer enough data between the vertex shader and the pixel shader with those. So the glTF with PBR lighting minimum requirement is the major shader model 4_0 version, which is DX10 (or most probably DX10.1). This is why I had to pull the PR containing the glTF support from the unstable version, people were complaining that their shader compiler couldn't cope with the elevated requirements.

I think it's enough for today,

#190 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,347
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 01 February 2022 - 06:26 AM

Your work is much appreciated. I feel like you are on the right track with this project.

  • 37 Pages +
  • « First
  • 17
  • 18
  • 19
  • 20
  • 21
  • 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