Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low frame rates in forest levels. #1851

Closed
diablo488 opened this issue Oct 15, 2021 · 34 comments
Closed

Low frame rates in forest levels. #1851

diablo488 opened this issue Oct 15, 2021 · 34 comments

Comments

@diablo488
Copy link

diablo488 commented Oct 15, 2021

**SuperTux version:SuperTux-v0.6.2-852-g515d0c069-win64
System information: windows 8.1 | i7 3770 | intel hd 4000(gpu)|1366x768 resolution
skybox missing/black
in some levels eg: above the artic skies in world one, welcome to Antarctica first level in world 1
Screenshot (205)
Screenshot (206)

And low frame rates\fps in level selector menu and in some levels where many layers of background and foreground /transparent exists goes below 40 fps and 30 fps in level selection menu | screenshots below

Screenshot (204)
Screenshot (207)

my pc can play halo 4 and crysis , so its not the gpu
I am running it in windowed mode to take screenshots otherwise its always fullscreen

@diablo488
Copy link
Author

cave levels is also having low frame rate issues

@Rusty-Box
Copy link
Member

I fixed the missing skyboxes, however I'm not so sure about the low frame rate.
Someone else with more knowledge should have a look at this.

@diablo488
Copy link
Author

ok, I am currently replaying the entire game if i see any more bugs i will report it,
the fps is very low in the forest levels , i will continue to comment in this issue#1851 as i am playing through the game

@diablo488
Copy link
Author

Screenshot (208)

18fps ,Forest levels are almost unplayable

@Zwatotem Zwatotem changed the title Missing skybox in some levels and low frame rates Low frame rates Oct 15, 2021
@Zwatotem
Copy link
Member

Please, in the future report separate problems in separate GitHub issues. That way it's easier to track the progress on them.

@Zwatotem Zwatotem changed the title Low frame rates Low frame rates in forest levels. Oct 15, 2021
@diablo488
Copy link
Author

do you guys remember the old forest world map in the contrib levels the one with the keys in the top left corner
why dont you guys put that at the end of the game like collect the keys unlock castle defeat nolok get penny back
its just a idea which popped up in my mind while playing the game i thought all the levels from the old game is going to be in the new forest world map. I am going to play the old version from 2010 again for nostalgia

@Semphriss
Copy link
Member

The story is still in development; we have a lot of ideas and not enough hands to implement them. The story is still far from finished, but there are many things which are already planned and/or are currently in development. Content will come over the next releases, until, I presume, version 1.0 comes out.

As for the lag, this is a known issue. As it's not easy to fix, it might take a while until improvements come. In the meantime, I'm afraid the only option is to try with a more performant device.

@HybridDog
Copy link
Contributor

A somewhat related issue: #1301
You could try the opengl20 renderer. For me it's a lot faster than the default opengl renderer in rainy levels.

@diablo488
Copy link
Author

And how do i do that(change to opengl20)

@HybridDog
Copy link
Contributor

I don't know how to do it on Windows, but I assume you can add (video "opengl20") to the video section of the config file.
The beginning of my config file looks like this:

(supertux-config
  (profile 1)
  (show_fps #t)
  (show_player_pos #f)
  (show_controller #f)
  (developer #t)
  (confirmation_dialog #f)
  (pause_on_focusloss #t)
  (custom_mouse_cursor #t)
  (integrations
    (hide_editor_levelnames #f)
  )
  (editor_autosave_frequency 5)
  (transitions_enabled #t)
  (locale "")
  (repository_url "")
  (video
    (fullscreen #f)
    (video "opengl20")
    (vsync #t)

I use GNU/Linux, so my config file is at ~/.local/share/supertux2/config and the opengl20 setting was automatically added when I started supertux with the --renderer opengl20 arguments.

@diablo488
Copy link
Author

I will try

@diablo488
Copy link
Author

diablo488 commented Oct 16, 2021

It worked and graphics didn't change at all to my eyes atleast but it went from 18fps in the shocking level to above 60 with draw redundant frames on
And on some levels its going over 200fps
The fps is soo good like why isn't the opengl20 renderer the default

@diablo488
Copy link
Author

Idea: if there were a option in the settings to change the renderers it would have been easy to change it for normal peoples who doesn't know how to edit config files and easier for testing purpose too.
Just like the option to change direct x version in gta 5 as an example

@diablo488
Copy link
Author

Idea: The vsync cannnot be completely disabled by the options menu
Have to go to the config file for that , and a uncap fps/draw redundant frames button would be helpful for those who have high frame rate monitors and help to decrease input lag. And actually vsync increases the input lag and as a platformer game it affects the accuracy of jumps and other stuff

@Semphriss
Copy link
Member

IIRC, changing renderers was initially meant for devices which did not support a certain renderer at all, which would make the game entirely unusable (see #1667). That's why changing renderers is usually done outside the game. An in-game option wouldn't hurt, although it might not be as easily implemented as regular options.

It picks OpenGL 3.3 by default since that's usually the fastest on the devices that support it well; other options are available when certain versions of OpenGL aren't available. Note that using a weaker rendering engine will turn off certain graphic features (such as refraction, reflection on empty bonus blocks, etc.)

@Semphriss
Copy link
Member

As for the v-sync, press Ctrl+F2 while in-game to enable developer mode, and toggle the appropriate options. When in developer mode, you can access the debug menu by pressing F2 anytime.

(You can also press F1 for some super-secret options ;p)

@diablo488
Copy link
Author

I have been using the cheat menu since version 0.3.5a 😅

@diablo488
Copy link
Author

Idea:The show controller option in config is actually really nice for speedrunning And its amusing to watch which key i press. An option in the menu will also help (I have nothing going on in my life right now thats why i comment often, only if you are wondering)

@tobbi
Copy link
Member

tobbi commented Oct 16, 2021

Can you guys please see whether the commit above improves anything?

@HybridDog
Copy link
Contributor

HybridDog commented Oct 17, 2021

In the rainy level I get ca. 70 FPS with 5a883af (master) and 6914916 (before the changes) with opengl renderer. With opengl20 renderer I get ca. 160 FPS. I have an intel GPU. When I opened #1301 I had a much older graphics driver and operating system, so I may no longer be able to reproduce the problem.

@Busybody64
Copy link

The reason why the skyboxes were black, is because somebody decided to get rid of the sky parts, in case people wanted to use multiple backgrounds at once. Story mode wasn't really updated with this in mind, last i checked.
I feel like the skies should become their own backgrounds, in case this happened.

@tobbi
Copy link
Member

tobbi commented Oct 26, 2021

Instruments.run.trace.zip

This is an XCode Instruments of the Going Down level (which contains a rain particle system). I didn't finish playing, I just spent a few seconds jumping around in the rain.

I'm not sure if it's useful. We spend most time inside GLPainter::draw_texture(TextureRequest const&) (as somewhat expected) which calls OpenGL functions.

No idea how to improve that.

@tobbi
Copy link
Member

tobbi commented Oct 26, 2021

Did b0aff6a improve any of the framerate issues with rain particles?

@diablo488
Copy link
Author

i can't download the latest build because the artifact button is missing for me for some reason so i can't test

@diablo488
Copy link
Author

The old way to download #1793 doesn't work anymore

@diablo488
Copy link
Author

nevermind found it

@diablo488
Copy link
Author

Did b0aff6a improve any of the framerate issues with rain particles?

the shocking level went from 17 fps to 35 with auto renderer in config

@tobbi
Copy link
Member

tobbi commented Oct 31, 2021

I've taken another stab at trying to improve the rendering speed. Can you check the latest nightly?

@diablo488
Copy link
Author

I've taken another stab at trying to improve the rendering speed. Can you check the latest nightly?

on SuperTux-v0.6.2-890-g4600d4453-win64 its still 35 fps no change. the last change "b0aff6a" made the level Shocking go from 17 to 35
if you did something after the 890 build idk bc the latest is 890 as of right now as i am commenting

tobbi added a commit that referenced this issue Nov 11, 2021
@tobbi
Copy link
Member

tobbi commented Nov 11, 2021

The commit above improves this even further, but I still believe that this is probably the wrong place to fix it. The Opengl33Context is the culprit here, but I don't know enough about this.

@HybridDog
Copy link
Contributor

If I understand the compositor code correctly, with Opengl33 it renders almost everything two times per frame, which often halves the frame rate:
http://github.com/SuperTux/supertux/blob/7fbeeda8efd3766e2ae3894e09758818dd853e49/src/video/compositor.cpp#L92
For the reflections the fragment shader needs to access neighbouring pixels from the current image, but a fragment shader cannot read its output image since it's unfinished, so the compositor renders the image one time without reflections and then another time with reflections, where the neighbouring pixels for the reflections are taken from the first rendered image.
With opengl20 there are no reflections, so it probably renders everything only one time per frame.

@weluvgoatz
Copy link
Member

Is this bug to be considered fixed yet?

@diablo488
Copy link
Author

i cant download the windows nightly releases
Screenshot (41)

@diablo488
Copy link
Author

I bought a gpu.and the fps is always above 150 with draw redundant frames. So i think there is no need for this issue to be open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants