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

Jump to content

  • 37 Pages +
  • « First
  • 21
  • 22
  • 23
  • 24
  • 25
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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

#221 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,491
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 19 February 2022 - 04:32 PM

 gpz, on 06 February 2022 - 05:07 AM, said:

Before, I would like to try to implement the ligths extension, I find that exciting, and that is a feature missing already from the possibilities. And for this I have to move the whole lighting calculation to the pixel shader, so I will be able to decrease the number of float4 slots of the vertex shader output back to be within the limits. However I already see that the next limit I run into is the number of used constant registers (31). I will see how far I can get in working around that, but I fear when I do so, there will be yet another kind of limit... DX9 is getting old...

Yes, it is. It would be very nice to drop feature levels 9_1 and even 9_3, moving the minimum up to 10_0.

 btrs, on 13 February 2022 - 08:23 AM, said:

No, this is just great to finally being able to drop support for EOL'ed API's anyway. You already bit the hard pill when OR 1.4 dropped Win XP support, so Win 7 was needed as default anyway (which has DirectX 10 as standard). OK, I know that doesn't mean every GPU supports Direct3D 10, but do you really want provide support for 15+ year old hardware ? Heck, even GeForce 9000/Radeon HD3000 cards (from 2008) already had Direct3D 10 support, so I think it's time to move on and upgrade to Direct3D 10.

Too bad for those on Intel onboard graphics, but then you're not a serious OR user anyway (or just limit yourself to basic branch line operation with few requirements..)

I'm afraid to tell you that we support non-serious Open Rails users as well as serious ones. Intel integrated graphics are important to support, as many people use laptops these days and many laptops use Intel integrated graphics.

Luckily many Intel integrated graphics versions do support DirectX feature level 10_0, but the biggest problem we have here is a lack of data. We simply do not know how many people would be affected by dropping support for either 9_1 or 9_3.

The current (Jan 2022) data in the Steam hardware survey seems to say that 1.46% of people do not have 10_0-capable graphics, and I feel this could be biased towards game-centric machines.

Unfortunately, Unity removed their stats page, which would have been more representative, I think.

In any case, I would like Peter to finish implementing glTF 2.0 using whatever requirements it needs to work correctly. Only once we are at that point can we really figure out the way forward with shader versions.

#222 User is offline   gpz 

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

Posted 05 March 2022 - 12:32 PM

I think I reached a state where my test models look satisfyingly on my computer, and I noticed that I am just doing some small modifications here, some there, but nothing "big" anymore, I can't move much more forward alone. Normally at this stage a PR should go to the unstable release for having a wider test, and to wait for reviews. But unfortunately I cannot just enable this for unstable, because I couldn't really make it work on our current 4_0_level_9_3 feature level of graphics shader. I tried, there is in the committed shader some initiative of that work, but anywhere I tried to satisfy the compiler, I reached an other kind of limit. And at one stage I reached a limit where the error message returned was not even true anymore, leaving me in the field to guesses what could be the problem. (All this happened only while trying to make the multilight-allowed shader to work for .s objects, not even came to the part to try to fit the PBR part into the 9_3 limits.) After spending a couple of days with this problem I came to a conclusion that every hour I put into fitting this whole thing into the 9_3 limits is a waste of my own time. So I gave up on this "backporting" thing. I was able to make this PR to work only on Direct3D level 10.0 hardware. If anyone with the appropriate knowlegde could make it work on Direct3D level 9.3 graphics, that would be very welcome, but this seems to be beyond my abilities.

But the good news is, that for me it works pretty well! I have implemented the lights extension as well, so theoretically any glTF can carry light sources too. The infrastucture of displaying multiple light sources is in place, although I tested everything with only one-two models at a time, and to see how this all works in practice would need some extensive testing. I would also be interested in the speed. The fact that my one-two test models at a time run with 200-500 FPS on my mid-to-highend computer doesn't show much. I also limited the number of the total lights to 20 currently, but that is completely arbitrary, bacause I have no idea how much load an additional light puts on the GPU...

Essentially I would like to ask what could be the way forward. I am happy to make changes on this PR if someone reviewed it, or we can enable this for the unstable, knowing that there will be complaints from the people with old hardware, that the cannot run the game. Or we can do the same thing as with my MonoGame port: wait 7 years and merge after. :) :) (Just kidding)

#223 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,359
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 05 March 2022 - 01:14 PM

Peter, it seems your situation is very similar to Carlo's work on Monogame. Perhaps a fork of OR is the right thing to do for testing until it is possible to merge it back into the "official" OR code and let us all hope it won't take 7 years. :lol2:

#224 User is offline   Rj Zondervan 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 40
  • Joined: 09-March 11
  • Gender:Male
  • Simulator:MSTS/ORTS
  • Country:

Posted 05 March 2022 - 01:15 PM

Just an idea for the DirectX problem: would it be an idea to introduce a switch for older hardware to disable the DirectX10 functionality? If not, I would not have objections to breaking compatibility with DirectX 9, but that is not up to me.

Another part of the way forward: I would like some information about, i.e. how models should be prepared for export to glTF, most importantly: what should we do differently to preparing for export to .s, will we have to work with new naming conventions?

Furthermore, I'm curious to learn if there are plans for implementing extra possibilities for animations, i.e. animations that change due to inputs (for example steam engine gearings of which the behaviour changes depending on the position on the reverser).
However, I am perfectly happy for the moment with this, see this topic for an example of how I'm using PBR images for a new steam engine.

#225 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 05 March 2022 - 01:37 PM

I don't have the ambition that my more-than-10-year-old laptop is the gold standard for an old computer, but I had a check with dxdiag on the d3d feature level supported, and got the attached file (excerpt), that seems to state that my video card supports feature level 10_0. So can we assume that there aren't many computers around that don't support 10_0?
Peter, if this can be of interest as test case, I could try to run your code on my computer, if ths is not complicated to set up.

Attached File  GeForce120.txt (9.21K)
Number of downloads: 154

#226 User is offline   gpz 

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

Posted 06 March 2022 - 03:58 AM

 Genma Saotome, on 05 March 2022 - 01:14 PM, said:

Peter, it seems your situation is very similar to Carlo's work on Monogame. Perhaps a fork of OR is the right thing to do for testing until it is possible to merge it back into the "official" OR code and let us all hope it won't take 7 years. :lol2:

I would not like to maintain my own fork, because that maent a lot of extra work, and given the examples of the current forks, there is a high chance that a fork will never ever be fully merged back, it is just diverging more and more by the time. I think there are at least 5 forks exist (if not more), and neither of them seems to be certain of ever wanting to get merged back. This is not my way.

 Rj Zondervan, on 05 March 2022 - 01:15 PM, said:

Just an idea for the DirectX problem: would it be an idea to introduce a switch for older hardware to disable the DirectX10 functionality? If not, I would not have objections to breaking compatibility with DirectX 9, but that is not up to me.

Another part of the way forward: I would like some information about, i.e. how models should be prepared for export to glTF, most importantly: what should we do differently to preparing for export to .s, will we have to work with new naming conventions?

Furthermore, I'm curious to learn if there are plans for implementing extra possibilities for animations, i.e. animations that change due to inputs (for example steam engine gearings of which the behaviour changes depending on the position on the reverser).
However, I am perfectly happy for the moment with this, see this topic for an example of how I'm using PBR images for a new steam engine.

That is the point, I can't disable DirectX10, because it is not the functionality that steps up, but rather the number of used constant buffers, number of instructions in a shader stage, etc. So there is no new kind of functionality used, only more in numbers of the existing ones. Like if someone told me that I need to write a program that must fit into 1000 lines of code, and I can use only maximum of 10 variables. But if a program exceeds a certain kind of complexity, than it becomes impossible to fit within those limits, unless I am a genius like Steve Jobs.

With handling animations, I am also learning how to do that and what is possible, because I haven't touched the animation code before this. New, not currently existing functionality will have to go to another PR for sure. BBut what I see regarding the glTF is, that it is not the nodes that need to be named, unlike in .s. But rather animations have to be defined in their own hierarchy structure, where an animation can target (link to) nodes via animation channels. In .s an animation is measured in number of frames, but in glTF it is in seconds. So e.g. in .s one may define an animation with 8 frames, but in glTF that must be defined as e.g. 20 second long (or any other number of seconds). It doesn't mean we cannot play an animation faster or slower than defined, or backwards for that matter, but this is the key idea behind this. If I understand well, there is also a default FPS defined for the .s files, isn't there? Maybe 1.5 FPS? I'm not sure about it, it is also a learning curve for me. I learned, there are animations, like the wheels, that don't really have their own animation "clip", rather they're just tagged with certain names, and they just "happen to work", handled by the ORTS code internally. We need to define this tagging method for the glTF-s, it is not programmed yet, because I didn't have any real ORTS glTF content to test with, I've used only downloadable models (like a prosche and a rhino and a military ground vehicle, and all the Khronos test models, as I named a few in my previous posts). Actually it would be nice to have a real railways test model to do the final fine-tuning of the glTF handling with!

I see your new steam locomotive, it looks really impressive! The glTF metallic effect might indeed give an illustrious outlook to the shiny copper and ferric surfaces. They look special in glTF compared to the traditional MSTS outlook because they reflect the lights and the fake environment map, and this gives the illusion of being almost like real metals.

 Csantucci, on 05 March 2022 - 01:37 PM, said:

I don't have the ambition that my more-than-10-year-old laptop is the gold standard for an old computer, but I had a check with dxdiag on the d3d feature level supported, and got the attached file (excerpt), that seems to state that my video card supports feature level 10_0. So can we assume that there aren't many computers around that don't support 10_0?
Peter, if this can be of interest as test case, I could try to run your code on my computer, if ths is not complicated to set up.

Carlo, I would appreciate if you could test the code with your laptop. Your tests are always extremely useful, in any case, it had been proven to me during our many years of work together! I don't think it would be complicated to set this up, because I store all my relevant code in this github PR: https://github.com/o...nrails/pull/570
Setting up a test case is as easy as downloading a model from the net, e.g. one of my test models was this porsche: https://sketchfab.co...e59499f0dbed21e
I've just copied the gltf, bin and texture files to the KIHA31 folder in the trainset, and modified the kiha31.eng to reference the downloaded .gltf file instead of the original kiha31.s.

If the model has an animation defined, then the first of these can be played by hitting <Shift+,> (comma), as I temporarily assigned the first found animation clip to the "ORTSITEM1CONTINUOUS" command. Among others I played with this rhino's animaion: https://sketchfab.co...ea9e3fd421f55b4

By the spec level 10.0 should be enough for this to work, I haven't used any more advanced features. But we will see. :)

#227 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 March 2022 - 09:11 AM

Hi Peter,
I made a first test by using the patched OR, but with the original Kiha.
I get following crash, before the logfile opens
Attached Image: gitfcrash.jpg

By the way I got two rejected hunks by applying the patch. While there is no problem for the Shapes.cs hunk, I have a doubt for the other one, that is where to add the two missing lines. because in the actual Materials.cs file
                    ShaderPasses.Current.Apply();

is before
                    graphicsDevice.SamplerStates[0] = item.Material.GetShadowTextureAddressMode();

and not after, and the two lines to be added are just in between. I've put them before the Apply() line.

Attached File  Materials.cs.rej.txt (688bytes)
Number of downloads: 138
Attached File  Shapes.cs.rej.txt (343bytes)
Number of downloads: 140

#228 User is offline   gpz 

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

Posted 06 March 2022 - 11:32 PM

For the latter issue see this bug fix: https://github.com/o...nrails/pull/580
Setting the sampler state has no effect if it is done prior to ShaderPasses.Current.Apply(), so the correct order everywhere is apply the passes, then set the sampler states.

#229 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 March 2022 - 02:33 AM

 Csantucci, on 06 March 2022 - 09:11 AM, said:

I get following crash, before the logfile opens

Regarding the shader compiler crash, I wonder if your GPU was able to go with standard vs_4_0 and ps_4_0 at all. By the spec you uploaded it would, but just as a quick test, could you maybe remove all "_level_9_3" and "_level_9_1" occurances from the SceneryShader.fx file in your unpatched, original branch, and try?

#230 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 March 2022 - 01:30 PM

Peter,
removing the occurrences you mentioned from SceneryShader.fx in the master release still generates an OR which runs on my computer.
Re the Materials.cs.rej issue, my question is not about the sequence of setting the sampler state and ShaderPasses.Current.Apply(), but where to apply these two added lines

+                    if (item.ItemData is Matrix[] bones)
+                        shader.Bones = bones;


  • 37 Pages +
  • « First
  • 21
  • 22
  • 23
  • 24
  • 25
  • 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