Elvas Tower: Use model instancing feature - Elvas Tower

Jump to content

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

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

#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: Status: Elite Member
  • Posts: 5,491
  • 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: Status: Elite Member
  • Posts: 7,000
  • 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!

#16 User is offline   gpz 

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

Posted 08 April 2014 - 12:31 AM

I would like to ask James, just out of curiosity, if wouldn't some draw call batching also be possible to be implemented? I mean for objects sharing the same material, the different geometries could be uploaded to VRAM and rendered in one pass. Maybe it is possible only for opaque and 1-bit-alpha objects, since for blended ones the alpha sorted rendering has higher priority. And even for them the effect for their shadow is questionable.

#17 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 08 April 2014 - 12:35 AM

View Postgpz, on 08 April 2014 - 12:31 AM, said:

I would like to ask James, just out of curiosity, if wouldn't some draw call batching also be possible to be implemented? I mean for objects sharing the same material, the different geometries could be uploaded to VRAM and rendered in one pass.


That's really hard work. You have to merge the vertex and index buffers first and (unlike instancing) I don't believe you can animate these primitives at all.

#18 User is offline   gpz 

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

Posted 08 April 2014 - 12:54 AM

But it might still worth doing it at least for tracks or terrain. E.g. on large stations there might be a lot of different type of tracks, where batching the many only-dozen-vertex objects into 1 draw call might help. I don't know if it is possible, but for tracks the batching of already-instanced objects might save some more drawcalls too. :)

#19 User is offline   dennisat 

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

Posted 08 April 2014 - 02:40 AM

View Postdennisat, on 07 April 2014 - 07:27 AM, said:

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...


I seem to be the only one with any problems with model instancing. I have been experimenting with X2157 on Dorset Coast this morning and have tried a lot of combinations of Nvidia graphic options, including defaults, with no improvement to the flickering transparent textures. Note the Clapham Junction platform canopies in the first two (static) screenshots below; with instancing turned off the flickering does not occur. So far, I have come across two artifacts which are the light cones of JP1.streetlight.s. This is used extensively as a platform light in this route. These always occur at the same locations and are not there when instancing is turned off. See last two screenshots below.

Is it my graphics card - GTX460? It is working hard but does not seem to be hitting max memory or GPU when these effects occur, according to GPU-Z.

Flickering transparent textures:
Attached Image: Open Rails 2014-04-08 09-39-22.png
Attached Image: Open Rails 2014-04-08 09-39-24.png


Random Artifacts:

Attached Image: Open Rails 2014-04-08 09-48-36.png
Attached Image: Open Rails 2014-04-08 09-49-40.png

#20 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 08 April 2014 - 02:48 AM

I've seen a single item misplaced in my journeys with instancing (a fence across the track in L&PS). I'm guessing the model hierarchy is confusing things in some way, like for your case of the street light. But I have not seen instancing cause flickering or unexpected transparent scenery and I don't have any good ideas how it could do so (the materials that control the actual rendering are unchanged), so that's currently a bit of a mystery.

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