Elvas Tower: DYNAMIC SHADOWS RENDERING. - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

DYNAMIC SHADOWS RENDERING. Rate Topic: -----

#11 User is offline   dennisat 

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

Posted 16 October 2016 - 11:44 PM

View PostJames Ross, on 16 October 2016 - 01:21 PM, said:

As it currently stands, everything which casts a shadow must be rendered 5 times - once for the screen, and once for each of the 4 shadow maps.


I've used the following settings for shadows almost since I started using OR. I get very acceptable shadowing with no performance problems. What are the pros and cons of these settings? A full OR log is also attached.

Dennis

DynamicShadows = (user set) True
ShadowAllShapes = (user set) True
ShadowMapBlur = (user set) False
ShadowMapCount = (user set) 1
ShadowMapDistance = (user set) 1000
ShadowMapResolution = (user set) 4096


Attached File  OpenRailsLog.txt (25.88K)
Number of downloads: 237

#12 User is offline   Hamza97 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 606
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 18 October 2016 - 11:19 PM

Dear @dennisat, you will easily experience smooth and silky frame rates, because you have a high-end PC, Ask me about FPS hit when enabling shadows... :sweatingbullets: :whistling:

#13 User is offline   jamesc25313 

  • Hostler
  • Group: Status: Active Member
  • Posts: 91
  • Joined: 28-July 12
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 18 October 2016 - 11:55 PM

View PostHamza97, on 18 October 2016 - 11:19 PM, said:

Dear @dennisat, you will easily experience smooth and silky frame rates, because you have a high-end PC, Ask me about FPS hit when enabling shadows... :sweatingbullets: :whistling:


A 3.0ghz+ and GTX770 is high end when it comes to OR. Having a 4.0ghz I7 like Dennis cant hurt, but over kill none the less and I'm assuming he uses this PC for other games besides OR? If someone is running Pentium 4's, or Pentium D's and cant run OR with shadows, who fault is that? The "high end" debate is non-existent now-a-days as even a budget PC can be put together for $300-$400 and run OR quite nicely. Even an old Dell with a 3570 and a GTX770 will run you a total of $350. Add $50-60 for a used PSU and you have a certified "high end" OR PC. Better yet, build it yourself for roughly the same price.

#14 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 October 2016 - 01:35 PM

View Postdennisat, on 16 October 2016 - 11:44 PM, said:

DynamicShadows = (user set) True
ShadowAllShapes = (user set) True
ShadowMapBlur = (user set) False
ShadowMapCount = (user set) 1
ShadowMapDistance = (user set) 1000
ShadowMapResolution = (user set) 4096

A rough idea of what each of these will do to performance:

  • DynamicShadows: enabled lowers performance, but improves visuals
  • ShadowAllShapes: enabled lowers performance, and occasionally has weird shadows-from-apparently-nothing artefacts (content-dependent)
  • ShadowMapBlur: enabled lowers performance, but improves visual quality of shadows when shadow map resolution is low
  • ShadowMapCount: higher lowers performance, but improves visual quality of shadows
  • ShadowMapDistance: higher lowers performance, and degrades visual quality of shadows
  • ShadowMapResolution: higher increases memory usage, but improves visual quality of shadows

You get the best nearby shadow visuals with DynamicShadows and ShadowAllShapes enabled, ShadowMapBlur disabled, ShadowMapCount at 4 (the max), ShadowMapDistance at a low distance (e.g. 500), and ShadowMapResolution as high as you can accept (it just consumes performance and lots of GPU RAM).

From there, you can increase ShadowMapDistance to get better shadows further away, and/or reduce ShadowMapResolution to get better performance. Just remember to turn ShadowMapBlur on if the resolution is low enough to cause saw-tooth edges.

I wouldn't normally consider lowering ShadowMapCount, but it will considerably improve performance at the cost of shadow quality. If ShadowMapDistance is low enough and ShadowMapResolution is high enough, that won't be a problem though.

The performance cost of ShadowAllShapes is very content-dependent, unlike most other options, as it switches between everything casting shadows to everything the content creator decided should cast shadows.

#15 User is offline   dennisat 

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

Posted 20 October 2016 - 08:43 AM

View PostJames Ross, on 19 October 2016 - 01:35 PM, said:

A rough idea of what each of these will do to performance:

  • DynamicShadows: enabled lowers performance, but improves visuals
  • ShadowAllShapes: enabled lowers performance, and occasionally has weird shadows-from-apparently-nothing artefacts (content-dependent)
  • ShadowMapBlur: enabled lowers performance, but improves visual quality of shadows when shadow map resolution is low
  • ShadowMapCount: higher lowers performance, but improves visual quality of shadows
  • ShadowMapDistance: higher lowers performance, and degrades visual quality of shadows
  • ShadowMapResolution: higher increases memory usage, but improves visual quality of shadows

You get the best nearby shadow visuals with DynamicShadows and ShadowAllShapes enabled, ShadowMapBlur disabled, ShadowMapCount at 4 (the max), ShadowMapDistance at a low distance (e.g. 500), and ShadowMapResolution as high as you can accept (it just consumes performance and lots of GPU RAM).

From there, you can increase ShadowMapDistance to get better shadows further away, and/or reduce ShadowMapResolution to get better performance. Just remember to turn ShadowMapBlur on if the resolution is low enough to cause saw-tooth edges.

I wouldn't normally consider lowering ShadowMapCount, but it will considerably improve performance at the cost of shadow quality. If ShadowMapDistance is low enough and ShadowMapResolution is high enough, that won't be a problem though.

The performance cost of ShadowAllShapes is very content-dependent, unlike most other options, as it switches between everything casting shadows to everything the content creator decided should cast shadows.


Thank you for the information, I can now make some better informed experiments. I settled on one shadow map early on (a year or two ago) because I was seeing artefacts when using the default 4. I now have a different PC/Graphics card so I'll try multiple shadow maps again.

Dennis

#16 User is offline   vince 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,314
  • Joined: 18-June 14
  • Gender:Male
  • Location:West of the Contental Divide
  • Simulator:ORTS_Running MSTS_Editing
  • Country:

Posted 28 October 2016 - 05:19 PM

Sorry for late reply reference this earlier post in this thread.
Regarding why shadows are cast on some but not all objects (shapes)

In the shape file that did NOT display shadows correctly, de_ELOldSta_spec_Platf.s;
I changed the named_shader ( BlendATex ) to named_shader ( TexDiff ) and now shadows appear correctly on the platcorm in question.
Attached Image: dyn shadow TexDiff OK.jpg
Much thanks for the ongoing discussion regarding shadows.
best regards,
vince

#17 User is online   Genma Saotome 

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

Posted 28 October 2016 - 07:59 PM

View Postvince, on 28 October 2016 - 05:19 PM, said:


I changed the named_shader ( BlendATex ) to named_shader ( TexDiff ) and now shadows appear correctly on the platcorm in question.
vince


Vince, I stopped using .tga files if they have no alpha mask and I now use .bmp files as a default. If I'm editing an older model in Sketchup and notice a .tga, I'll change it to .bmp if there is no alpha present. I made this change to .bmp because the differences in the shaders suggested to me that .bmp cost less in terms of work to render as compared to using .tga. This issue over shadows may also be a reason not to use .tga as your default art file.

#18 User is online   Genma Saotome 

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

Posted 28 October 2016 - 08:05 PM

View PostJames Ross, on 19 October 2016 - 01:35 PM, said:

You get the best nearby shadow visuals with DynamicShadows and ShadowAllShapes enabled, ShadowMapBlur disabled, ShadowMapCount at 4 (the max), ShadowMapDistance at a low distance (e.g. 500), and ShadowMapResolution as high as you can accept (it just consumes performance and lots of GPU RAM).


Excepting the number of shadow masks, is the performance loss that occurs when increasing the visual quality of shadows due to increased CPU work or increased GPU work?

#19 User is offline   vince 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,314
  • Joined: 18-June 14
  • Gender:Male
  • Location:West of the Contental Divide
  • Simulator:ORTS_Running MSTS_Editing
  • Country:

Posted 28 October 2016 - 10:22 PM

Regardless of GPU or CPU loading the troubling thing I see is the fact that dynamic shadow quality suffers as the view distance is increased suggests that even if dynamic shadows are enabled for only +-200m right of way objects, the quality suffers dearly. ( is that +-200m distance from the player?)
Maybe the game engine is busting a nut trying to compute ALL objects dynamic shadows ( within view? ) instead of what I think should be 'compute dyn shad only for objects n distance from player. ?? I dunno' . . . just throwing it out there.
regards,
vince

#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 20 November 2016 - 09:05 AM

View PostGenma Saotome, on 28 October 2016 - 08:05 PM, said:

Excepting the number of shadow masks, is the performance loss that occurs when increasing the visual quality of shadows due to increased CPU work or increased GPU work?

If you enable ShadowMapBlur or increase the ShadowMapResolution, you're adding GPU work (they're both basically bound by the fillrate of the GPU).

If you increase ShadowMapCount or ShadowMapDistance, you're adding CPU and GPU work. The latter in particular affects how much scenery needs to be rendered into the shadow maps - which means draw calls.

View Postvince, on 28 October 2016 - 10:22 PM, said:

Regardless of GPU or CPU loading the troubling thing I see is the fact that dynamic shadow quality suffers as the view distance is increased suggests that even if dynamic shadows are enabled for only +-200m right of way objects, the quality suffers dearly. ( is that +-200m distance from the player?)
Maybe the game engine is busting a nut trying to compute ALL objects dynamic shadows ( within view? ) instead of what I think should be 'compute dyn shad only for objects n distance from player. ?? I dunno' . . . just throwing it out there.

The default value of 0 for ShadowMapDistance means "ViewingDistance / 2", so increased viewing distance will mean decreased shadow quality. However, if you set ShadowMapDistance, then ViewingDistance no longer plays any part.

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