supertuxkart / stk-code

The code base of supertuxkart
Other
4.52k stars 1.06k forks source link

Improving performances on less powerfull GPU #2046

Closed MatthewsSam closed 7 years ago

MatthewsSam commented 9 years ago

Hi

I perfectly know we are in the process of making a release and we don't have too much time. But with increasingly more complex tracks and karts we might hit some hardware "hard" limit like using more VRAM than available.

In the VRAM case once you hit that limit will be unplayable and lagging because the OS starts to swap things. Especially if you don't have instancing (which might happen in some older Intel GPU (not sure of that)).

As an easy way to improve performances I suggest to add the possibility to flag library objects has "details" which means they aren't loaded and don't show in game. Of course tracks etc will be less detailed, but the most important thing is the ability to race with a good framerate.

Examples of objects that might be flagged (in cocoa temple or gran paradiso)

If someone add this possibility to stk I'm wiling to flags objects. It's a relatively easy operation to do. The main benefit is less polygons and not filling the VRAM with the textures.

Sam

MatthewsSam commented 9 years ago

I have made a custom scene.xml for the track cocoa temple. You can replace it to test and see if there is an improvement in performance or not

http://fpaste.org/202418/42724239/raw/

hiker commented 9 years ago

A bit subjective and in debug mode, but the FPS were around 5-7 fps faster.

MarkkusBoi commented 9 years ago

I will try it on my baytrail based laptop when I can.

MatthewsSam commented 9 years ago

Interesting so it helps a bit to improve performances :), that's interesting.

Just for comparison what was your FPS before ?

Also the question is how much do we remove. I tried to keep something still "beautiful", but we can remove all the vegetation and almost all library objects. However IMHO it's better to have something style cool to see ^^. Otherwise it's just the road with nothing.

MarkkusBoi commented 9 years ago

In older versions, I couldn't play the game without the advanced graphics pipeline (the WIP track "harvest" worked a bit) on my baytrail laptop, but that is fixed. I usually got 5 to 7 FPS with the advanced graphics pipeline. With the version I compiled, and without the advanced graphics pipeline, can get about 10 FPS max.

MarkkusBoi commented 9 years ago

I tried using the new "scene.xml" file you gave, SuperTuxKart just crashes when I load the track now, I will give the log.

[info   ] [FileManager]: Data files will be fetched from: '../../data/'
[info   ] [FileManager]: Data files will be fetched from:
'../../data/../../stk-assets/'
[info   ] [FileManager]: User directory is
'/home/markkus/.config/supertuxkart/0.8.2/'.
[info   ] [FileManager]: Addons files will be stored in
'/home/markkus/.local/share/supertuxkart/addons/'.
[info   ] [FileManager]: Screenshots will be stored in
'/home/markkus/.cache/supertuxkart/screenshots/'.
[info   ] [FileManager]: User-defined grand prix will be stored in
'/home/markkus/.local/share/supertuxkart/grandprix/'.
[info   ] [FileManager]: Asset 0 will be loaded from
'../../data/challenges/'.
[info   ] [FileManager]: Asset 1 will be loaded from '../../data/fonts/'.
[info   ] [FileManager]: Asset 2 will be loaded from '../../data/gfx/'.
[info   ] [FileManager]: Asset 3 will be loaded from
'../../data/grandprix/'.
[info   ] [FileManager]: Asset 4 will be loaded from '../../data/gui/'.
[info   ] [FileManager]: Asset 5 will be loaded from
'../../data/../../stk-assets/library/'.
[info   ] [FileManager]: Asset 6 will be loaded from
'../../data/../../stk-assets/models/'.
[info   ] [FileManager]: Asset 7 will be loaded from
'../../data/../../stk-assets/music/'.
[info   ] [FileManager]: Asset 8 will be loaded from
'../../data/../../stk-assets/tracks/'.
[info   ] [FileManager]: Asset 9 will be loaded from
'../../data/../../stk-assets/sfx/'.
[info   ] [FileManager]: Asset 10 will be loaded from '../../data/shaders/'.
[info   ] [FileManager]: Asset 11 will be loaded from '../../data/skins/'.
[info   ] [FileManager]: Asset 12 will be loaded from
'../../data/../../stk-assets/textures/'.
[info   ] [FileManager]: Asset 13 will be loaded from '../../data/po/'.
[verbose  ] translation: Env var LANGUAGE = 'en_US'.
[verbose  ] translation: Language 'English (United States)'.
[warn   ] [IrrDriver Temp Logger]: Level 2: X Error: GLXBadFBConfig

[warn   ] [IrrDriver Temp Logger]: Level 2: From call : unknown

[warn   ] [IrrDriver Temp Logger]: Level 3: Vertex shader compilation
failed at position -1:

[warn   ] [IrrDriver Temp Logger]: Level 3: Pixel shader compilation failed
at position -1:

[warn   ] [IrrDriver Temp Logger]: Level 3: Vertex shader compilation
failed at position -1:

[warn   ] [IrrDriver Temp Logger]: Level 3: Pixel shader compilation failed
at position -1:

[warn   ] [IrrDriver Temp Logger]: Level 3: Vertex shader compilation
failed at position -1:

[warn   ] [IrrDriver Temp Logger]: Level 3: Pixel shader compilation failed
at position -1:

[info   ] IrrDriver: OpenGL version: 3.3
[info   ] IrrDriver: OpenGL vendor: Intel Open Source Technology Center
[info   ] IrrDriver: OpenGL renderer: Mesa DRI Intel(R) Bay Trail
[info   ] IrrDriver: OpenGL version string: 3.3 (Core Profile) Mesa 10.1.3
[info   ] GLDriver: AMD Vertex Shader Layer Present
[info   ] GLDriver: ARB Base Instance Present
[info   ] GLDriver: ARB Draw Indirect Present
[info   ] GLDriver: ARB Texture Storage Present
[info   ] GLDriver: ARB Shader Atomic Counters Present
[info   ] GLDriver: ARB Multi Draw Indirect Present
[info   ] GLDriver: ARB Uniform Buffer Object Present
[info   ] irr_driver: GLSL supported.
[info   ] GUIEngine: scale: 1.287234
[info   ] GLWrap: Compiling shader : ../../data/shaders/texturedquad.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/texturedquad.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/texturedquad.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/uniformcolortexturedquad.frag
[info   ] HTTPRequest: Downloading
http://addons.supertuxkart.net/dl/xml/news.xml
[info   ] addons: Using cached addons.xml.
[warn   ] TrackManager: Track '20_harvest' is not supported by this binary,
ignored. (Track is version 5, this executable supports from 6 to 6).
[error  ] Irrlicht: Could not load texture:
../../data/../../stk-assets/tracks/20_luna/
[error  ] irr_driver: Texture '../../data/../../stk-assets/tracks/20_luna/'
not found.
[warn   ] Irrlicht: Could not open file of texture:
../../data/../../stk-assets/tracks/20_mansion/screenshot.jpg
[error  ] irr_driver: Texture
'../../data/../../stk-assets/tracks/20_mansion/screenshot.jpg' not found.
[warn   ] Irrlicht: Could not open file of texture:
../../data/../../stk-assets/tracks/20_newton/screenshot.jpg
[error  ] irr_driver: Texture
'../../data/../../stk-assets/tracks/20_newton/screenshot.jpg' not found.
[warn   ] track: Music information file
'TheDeadRocks-GreenSecretFromAmazonia.music' not found for track 'Shifting
Sands' - ignored.

[warn   ] TrackManager: Track 'xr591' is not supported by this binary,
ignored. (Track is version 5, this executable supports from 6 to 6).
[warn   ] TrackManager: Track 'addon_nolok-s-factory' is not supported by
this binary, ignored. (Track is version 5, this executable supports from 6
to 6).
[info   ] GrandPrixManager: Loading Grand Prix files from
../../data/grandprix/
[error  ] GrandPrixData: The Grand Prix file
'../../data/grandprix/2_offthebeatentrack.grandprix' contains a track
'cocoa_temple' that does not exist
[error  ] GrandPrixManager: Ignoring Grand Prix
../../data/grandprix/2_offthebeatentrack.grandprix (Unknown track)

[error  ] GrandPrixData: The Grand Prix file
'../../data/grandprix/3_tothemoonandback.grandprix' contains a track
'gran_paradiso_island' that does not exist
[error  ] GrandPrixManager: Ignoring Grand Prix
../../data/grandprix/3_tothemoonandback.grandprix (Unknown track)

[error  ] GrandPrixData: The Grand Prix file
'../../data/grandprix/4_atworldsend.grandprix' contains a track 'xr591'
that does not exist
[error  ] GrandPrixManager: Ignoring Grand Prix
../../data/grandprix/4_atworldsend.grandprix (Unknown track)

[info   ] GrandPrixManager: Loading Grand Prix files from
/home/markkus/.local/share/supertuxkart/grandprix/
[warn   ] Material: Unknown shader type <blend> for <waterparticles.png>
[warn   ] Material: Cannot determine texture full path : <shoes_gloves.png>
[error  ] material: Cannot find texture 'shoes_gloves.png'.
[error  ] ChallengeData: Undefined or incorrect value for 'gp' in challenge
file '../../data/challenges/gp2.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/gp2.challenge' : Undefined or incorrect value for
'gp' in challenge file '../../data/challenges/gp2.challenge'. challenge
will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'gp' in challenge
file '../../data/challenges/gp3.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/gp3.challenge' : Undefined or incorrect value for
'gp' in challenge file '../../data/challenges/gp3.challenge'. challenge
will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'gp' in challenge
file '../../data/challenges/gp4.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/gp4.challenge' : Undefined or incorrect value for
'gp' in challenge file '../../data/challenges/gp4.challenge'. challenge
will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'track' in
challenge file '../../data/challenges/islandtrack.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/islandtrack.challenge' : Undefined or incorrect
value for 'track' in challenge file
'../../data/challenges/islandtrack.challenge'. challenge will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'track' in
challenge file '../../data/challenges/jungle.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/jungle.challenge' : Undefined or incorrect value for
'track' in challenge file '../../data/challenges/jungle.challenge'.
challenge will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'track' in
challenge file '../../data/challenges/startrack.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/startrack.challenge' : Undefined or incorrect value
for 'track' in challenge file '../../data/challenges/startrack.challenge'.
challenge will be ignored.
[error  ] ChallengeData: Undefined or incorrect value for 'track' in
challenge file '../../data/challenges/xr591.challenge'.
[warn   ] unlock_manager: An error occurred while loading challenge file
'../../data/challenges/xr591.challenge' : Undefined or incorrect value for
'track' in challenge file '../../data/challenges/xr591.challenge'.
challenge will be ignored.
[info   ] ClientNetworkManager: Host initialized.
[info   ] ClientNetworkManager: Ready !
[info   ] GLWrap: Compiling shader : ../../data/shaders/coloredquad.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/coloredquad.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/colortexturedquad.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/colortexturedquad.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass1.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/objectref_pass1.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/grass_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/objectref_pass1.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/normalmap.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass1.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_objectref_pass1.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/instanced_grass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_objectref_pass1.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/encode_normal.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_normalmap.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass2.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/objectref_pass2.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_unlit.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/splatting.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getPosFromUVDepth.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/objectpass_spheremap.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/detailledobject_pass2.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/grass_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/grass_pass2.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass2.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_objectref_pass2.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_unlit.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getPosFromUVDepth.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_objectpass_spheremap.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_object_pass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_detailledobject_pass2.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getworldmatrix.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/instanced_grass.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getLightFactor.frag
[info   ] GLWrap: Compiling shader :
../../data/shaders/instanced_grass_pass2.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/object_pass.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/transparent.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/screenquad.vert
[info   ] GLWrap: Compiling shader :
../../data/shaders/utils/getRGBfromCIEXxy.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/utils/getCIEXYZ.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/tonemap.frag
[info   ] GLWrap: Compiling shader : ../../data/shaders/screenquad.vert
[info   ] GLWrap: Compiling shader : ../../data/shaders/passthrough.frag
[warn   ] LayoutManager: Statically sized widgets took all the place!!
[warn   ] LayoutManager: Statically sized widgets took all the place!!
[verbose  ] RaceManager: Nb of karts=1, ai:0 players:1

[warn   ] Material: Cannot determine texture full path :
<stktex_tropicalPlant_a.png>
[error  ] material: Cannot find texture 'stktex_tropicalPlant_a.png'.
[warn   ] Material: Cannot determine texture full path :
<stktex_redFlower_a.png>
[error  ] material: Cannot find texture 'stktex_redFlower_a.png'.
[warn   ] Material: Cannot determine texture full path :
<stktex_greenBrush_a.png>
[error  ] material: Cannot find texture 'stktex_greenBrush_a.png'.
[warn   ] Material: Cannot determine texture full path :
<stktex_redParrot_a.png>
[error  ] material: Cannot find texture 'stktex_redParrot_a.png'.
[warn   ] Material: Cannot determine texture full path :
<stktex_fern_diff_a.png>
[error  ] material: Cannot find texture 'stktex_fern_diff_a.png'.
[warn   ] Material: Cannot determine texture full path :
<stklib_liana_diff_a.png>
[error  ] material: Cannot find texture 'stklib_liana_diff_a.png'.
[info   ] Singleton: Destroyed singleton.
[error  ] EventHandler: While loading track
'../../data/../../stk-assets/tracks/30_chocolate/track.xml'
[error  ] Irrlicht: Could not load mesh, because file could not be opened:
: ../../data/../../stk-assets/tracks/30_chocolate/cocoa_temple_track.b3d
[error  ] irr_driver: Cannot load mesh
<../../data/../../stk-assets/tracks/30_chocolate/cocoa_temple_track.b3d>

[fatal  ] track: Main track model 'track' in 'cocoa_temple_track.b3d' not
found, aborting.

On Wed, Mar 25, 2015 at 9:27 AM, samuncle notifications@github.com wrote:

Interesting so it helps a bit to improve performances :), that's interesting.

Just for comparison what was your FPS before ?

Also the question is how much do we remove. I tried to keep something still "beautiful", but we can remove all the vegetation and almost all library objects. However IMHO it's better to have something style cool to see ^^. Otherwise it's just the road with nothing.

— Reply to this email directly or view it on GitHub https://github.com/supertuxkart/stk-code/issues/2046#issuecomment-86049715 .

hiker commented 9 years ago

@MarkkusCraft123 your driver is too old, you need 10.3 - you were already told that in #2047. I also don't know exactly what version of stk you are using, but you need to use latest stk-code and stk-assets to use this xml file.

MarkkusBoi commented 9 years ago

When I get on my computer again I will do a git pull. But I checked my mesa drivers and it said that I had mesa 10.1. I look in synaptic and it says that it doesn't need updating. I am using a SuperTuxKart from the source code, not the package that is distributed on the blog page. I think it may be a week old.

Flakebi commented 9 years ago

Unfortunately your Ubuntu repositories version don't provide a newer mesa package (which you need for the git and beta versions). It is possible to install more up to date mesa versions through other repositories but I don't know exactly how this works because I don't use Ubuntu at the moment.

It seems like Utopic Unicorn and newer versions have a recent enough mesa package in their standard repositories (>=10.3). It's not possible to run the SuperTuxKart development version with the standard Ubuntu 14.04 repositories.

MarkkusBoi commented 9 years ago

Ubuntu has an update command to update the version, my brother was able to upgrade to 14.10, but I wasn't when I tried the command.

deveee commented 9 years ago

You need to modify file: /etc/apt/sources.list

Add there repositories for newer Ubuntu version, and then use: apt-get update apt-get dist-upgrade

But to be honest, don't do it if you don't know precisely what you are doing, because you can break your system.

vampy commented 9 years ago

@Flakebi actually I am running mesa 10.3.2 with official ubuntu repos on 14.04.2 Ubuntu has something called "Hardware Enablement Stack", see https://wiki.ubuntu.com/TrustyTahr/ReleaseNotes#LTS_Hardware_Enablement_Stack But you must be careful and know what you are doing :P if some apps break because of that.

MatthewsSam commented 7 years ago

I implemented a proof of concept in the blender exporter, I just committed the new script if anyone wants to test.

It has 3 levels: 0 = always displayed (default) 1 = displayed when quality is set to medium or higher 2 = displayed when quality is set to high or higher

Now the remaining part is to change SuperTuxKart to take into account the parameter.

MatthewsSam commented 7 years ago

I just pushed my modifications in the branch geometry_detail. Currently there is an option named: Geometry detail and it's saved in the user options. I will do the remaining work (but probably after christmas). If someone wants to give it a try and do it before feel free.

qwertychouskie commented 7 years ago

This has been merged and should be closed.

qwertychouskie commented 7 years ago

This feature has been merged and this issue should be closed.

deveee commented 7 years ago

Ok, closed