leezer3 / OpenBVE

OpenBVE- A free train simulator
http://www.openbve-project.net
280 stars 52 forks source link

Lag in 1.5.3 #212

Closed PieSuperPAC closed 6 years ago

PieSuperPAC commented 6 years ago

I get substantially lower framerates in v1.5.3 than I got in v1.5.2 and v1.5.0.9 with the exact same settings.

leezer3 commented 6 years ago

Which route / train combo please?

Can I have some sample numbers too- Substantially lower doesn't tell me anything useful :)

Your system details might also be useful.

On 7 Jan 2018 3:17 am, "PieSuperPAC" notifications@github.com wrote:

I get substantially lower framerates in v1.5.3 than I got in v1.5.2 and v1.5.0.9 with the exact same settings.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leezer3/OpenBVE/issues/212, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVQNRtzwf0YMz5trhEMlbEw_XtV_Zj7ks5tIDdkgaJpZM4RVhYA .

PieSuperPAC commented 6 years ago

Using the R142A and the 5 line my frames have dropped from the low 20s into the low teens.
Processor: Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz, 2301 Mhz, 4 Core(s), 4 Logical Processor(s) 12 GB of RAM Graphics card is a NVIDIA GeForce GTX 960M I run Windows 10 if that matters.

leezer3 commented 6 years ago

I'll see what I can find- FPS shouldn't be dropping much if anything between builds.

The main issue though is the R142 (I'm assuming the 2017 HQ version?), and it's textures. It's using multiple textures over 2048px in size, none of which conform to the power of two rule.

This means that the textures get upsampled to the next size (4096px), and the train is eating ~1gb of system memory and ~2gb of VRAM. When the entire program can only address 2gb of system memory due to 32-bit limitations, I'm not at all surprised this is a mess.

Most of the textures should be about a quarter of the size they are at the minute, and if resampled correctly, you would be able to see no difference.

leezer3 commented 6 years ago

Been testing, and I can't reproduce this one, my FPS is broadly similar across all builds.

My specs on the main box are as follows: Windows 8 GTX 1060 6gb 16gb RAM Core i7 3770

On the NYCTA routes, I float at around 60fps in the cab, and 30fps when viewing externally.

Please try this build though: https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2018-01-07.zip

This makes the loading process where the R142A is in use considerably faster (It now caches the train exterior objects, as opposed to loading them for each train in the sim), and has also bumped the openTK version internally, which has an outside chance of helping.

Realistically though, the R142A needs the author to significantly optimize it, and there's not a lot I can do from my end.

cwfitzgerald commented 6 years ago

What is the internal cause of the power-of-two rule? I know in theory power of two textures are faster in theory, but as of right now, we are using so little GPU, I think that limitation should be lifted and to let the driver/GPU sort it out. If anything, we should be dropping down to the next lowest POT.

PieSuperPAC commented 6 years ago

Turns out this my computer was using integrated graphics with this version, I set it to run with my GPU and now I'm getting a solid 30 FPS.

cwfitzgerald commented 6 years ago

That's good.

Oh nVidia Optimus, I don't really know how it decides which OpenGL apps get which GPU. I'm not sure there really is a way to control that.