Elvas Tower: Use model instancing feature - Elvas Tower

Jump to content

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Use model instancing feature Rate Topic: -----

#1 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 06 April 2014 - 03:42 PM

Wow, this is a nice way to lower the draw calls, and it looks good in game. For a quick test i've seen 7 fps (29 to 36) improvement on a very populated area, and the drawn primitives are fallen from 5400 to 3700 with this feature, also lowers the shadow primitive count.
If it will work without the "Always use highest detail objects" feature, maybe even more improvement can be expected. Very nice to see that instancing works in OR "on the fly" and not like in TS2014 where you need to use specific object types on routes to make those instanced ("asset block"), and lower the CPU overhead.

#2 User is offline   captain_bazza 

  • Chairman, Board of Directors
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 13,931
  • Joined: 21-February 06
  • Gender:Male
  • Location:Way, way, way, South
  • Simulator:MSTS & OR
  • Country:

Posted 06 April 2014 - 04:03 PM

This is news to me, would you please explain?

Cheers & thanks,
Bazza.

#3 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 07 April 2014 - 03:34 AM

These openworld games are usually CPU limited, because a lot of objects should be drawn. Each drawn object or texture needs a draw call to be generated by the CPU in every single frame, and send this draw call to the GPU. But directx is wasting the resources, so to generate a draw call needs a lot of cpu resources, and in addition it's only works in single thread (so can be done only on one CPU core), so the computing power of one CPU core(on which the render process runs) will limit the game's performance. That's why AMD made the Mantle API, and that's why microsoft started to work on Directx 12, and the use of modern OpenGL extensions are encouraged, which can do this work in multiple threads, and also needs less computing power to generate the draw calls.
But directx 9 which is used by OR also have a trick to make the number of draw calls lower. However still not as good as a modern API, but can help very much. This is the hardware instancing. Without it, if there is are 2000 pieces of the same tree object in the visible range in game, then 2000 draw calls are needed to draw these trees. But with instancing, identical objects are only drawn once, so that 2000 trees can be drawn by 1 draw call, as the GPU just copies them instead of drawing them individually. Depending how many identical objects in the view, this can lower the load on the CPU, and somewhat on GPU too.

#4 User is offline   captain_bazza 

  • Chairman, Board of Directors
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 13,931
  • Joined: 21-February 06
  • Gender:Male
  • Location:Way, way, way, South
  • Simulator:MSTS & OR
  • Country:

Posted 07 April 2014 - 04:18 AM

Thanks for the explanation.

Cheers Bazza.

#5 User is offline   dennisat 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 474
  • Joined: 16-February 13
  • Gender:Male
  • Simulator:Open Rails & MSTS
  • Country:

Posted 07 April 2014 - 07:27 AM

I've been testing this feature on Dorset Coast and it certainly reduces the number of draw calls (loads up the GPU somewhat more of course) and increases frame rates.

However, I am seeing some weird effects around some shapes. When pulling into Clapham Junction, for instance, the platform canopies flicker really badly. I haven't managed to capture pictures of this yet. Attached, though, is a screenshot of a misplaced shape. It looks like the night light cone of one of the station lights. So far, this has happened consistently every test I've run. When instancing is turned off the flicker effect around Clapham Junction does not occur, nor the misplaced shape.

Dennis

Attached Image: Open Rails 2014-04-07 09-10-16.png

#6 Inactive_AlFitz_*

  • Group: Status: Passengers (Obsolete)

Posted 07 April 2014 - 10:42 AM

I'd hate to overestimate the improvement as I've seen to much of that sort of thing in the past but the frame rate on my machine rose in one area from about 35 to over 200 after turning it on! This does sound a bit much judging from from earlier posts but I could provide some screenshots I suppose

#7 Inactive_AlFitz_*

  • Group: Status: Passengers (Obsolete)

Posted 07 April 2014 - 10:53 AM

Here are two shots from virtually the same location, one with instance on and one without, that is the only difference.

Attached thumbnail(s)

  • Attached Image: Open Rails 2014-04-07 07-48-01.png
  • Attached Image: Open Rails 2014-04-07 07-46-30.png


#8 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 07 April 2014 - 11:39 AM

wow, 29 vs 210 fps :sign_thanks: That route seem to have really repetitive scenery.

#9 User is offline   SVRy_Steve 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,073
  • Joined: 07-January 04
  • Gender:Male
  • Location:Chiloquin, OR
  • Simulator:OR
  • Country:

Posted 07 April 2014 - 11:57 AM

Did I miss something here???? What and where is it? I'm clueless!

Steve

#10 User is offline   James Ross 

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

Posted 07 April 2014 - 12:11 PM

View PostAlFitz, on 07 April 2014 - 10:53 AM, said:

Here are two shots from virtually the same location, one with instance on and one without, that is the only difference.


That's pretty awesome. It looks like about 9700 primitives reduces down to just 1100 so there must be an absolute load of repetition (quite possibly those forested areas are all individually placed shapes).

View PostSVRy_Steve, on 07 April 2014 - 11:57 AM, said:

Did I miss something here???? What and where is it? I'm clueless!


There is a new experimental option, "Use model instancing", which helps reduce the CPU workload on highly repetitive scenes (think forests, dense built-up areas, etc.). The amount it'll help will vary a lot by route and location.

#11 Inactive_AlFitz_*

  • Group: Status: Passengers (Obsolete)

Posted 07 April 2014 - 12:26 PM

View PostJames Ross, on 07 April 2014 - 12:11 PM, said:

That's pretty awesome. It looks like about 9700 primitives reduces down to just 1100 so there must be an absolute load of repetition (quite possibly those forested areas are all individually placed shapes).



There is a new experimental option, "Use model instancing", which helps reduce the CPU workload on highly repetitive scenes (think forests, dense built-up areas, etc.). The amount it'll help will vary a lot by route and location.


The ECML does have a lot of repeated scenery but it's very long, the stations are pretty accurate however.

It's good you've been able to implement this as I thought it was DX11?

#12 User is offline   James Ross 

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

Posted 07 April 2014 - 12:30 PM

View PostAlFitz, on 07 April 2014 - 12:26 PM, said:

The ECML does have a lot of repeated scenery but it's very long, the stations are pretty accurate however.

It's good you've been able to implement this as I thought it was DX11?


Yeah, this is part of what I posted yesterday when I added the option:

James Ross said:

Until a few days ago, I thought that hardware instancing needed DirectX 10+ but a friend of mine pointed out that not only is Efficiently Drawing Multiple Instances of Geometry possible in DirectX 9, it is supported in XNA 3.1 (it's also supported in XNA 4.0, with a slightly different API).


So there we are, working instancing. :D

#13 Inactive_AlFitz_*

  • Group: Status: Passengers (Obsolete)

Posted 07 April 2014 - 01:52 PM

View PostJames Ross, on 07 April 2014 - 12:30 PM, said:

Yeah, this is part of what I posted yesterday when I added the option:



So there we are, working instancing. :sign_rockon:


Cool! :D

#14 User is offline   That Genset Foamer 

  • Superintendant
  • Group: Status: Inactive
  • Posts: 1,459
  • Joined: 14-September 12
  • Gender:Male
  • Location:Somewhere on the ATSF 4th District
  • Simulator:OpenRails
  • Country:

Posted 07 April 2014 - 03:47 PM

This looks like it'll bode well for the Salinas Valley route. Downloading the new build, gonna test it out tonight!

#15 User is offline   Csantucci 

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

Posted 07 April 2014 - 11:17 PM

Starting from X2157 I recommend to everyone checking this option: I just noticed a frame rate rise from 17 to 22 FPS in a big yard!

  • 4 Pages +
  • 1
  • 2
  • 3
  • 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