18
gamblet
7y

That moment when you finally optimized your game to run on 60FPS from 20-40 FPS. I love OpenGL.

Comments
  • 0
    Curious, why do you use OpenGL instead of Vulcan? Is OpenGL easier?

    I legit don't know..
  • 0
    It's because I am really fluent in Python and Pyglet is a pretty powerful library with OpenGL support.
    Also, the game is a 2D RPG platformer so Vulkan might be overly complicated.
    Another reason is that I don't know C++ that well yet, which I plan to get into more after I finish my current project.
    I will definitely look into Vulkan once I start making 3D stuff in the future though, thanks!
  • 2
    @inukinator I'm c++ dev so I don't know about other languages. Basically opengl is super easy because you can just tell it what to do and it just does it while vulkan is a really low level api where you have to tell the GPU exactly what to do. I needed like 1000lines to draw a fucking triangle. The benefit of vulkans low level access to hardware, as you might guess, is that it can be optimized so fucking good but you can also do mistakes you will regret. Think of it like programming something in assembler because java is to slow
  • 2
    @rkajaste You CAN do that but I failed really hard because its just too much to remember and to understand (in my case). I wanted to make a game in c++ and vulkan but it was simply too difficult. So I'm making it in ogl now. Maybe later when its working completely I'll add vulkan rendering :D but vulkan is really good with multicore CPUs. But maybe you should decide like that: do you want to make a huge graphical fps with millions of objects flying around and stuff, then use vulkan. If you want a good looking game that doesn't look like battlefield 1, use ogl. It just saves you a lot time. Also you should take in care that switching from python to c++ will give you a huge performance improvement
  • 3
    I did lots of work with OpenGL in past 13 years and can tell you that OpenGL and c++ are absolutely the only dev option I would recommend to anyone. Games or apps, doesn't matter what you do.

    Use SDL, Qt, WxWidgets or whatever cross platform lib for UI, and GL for render and there is no platform you cannot develop with max possible performance. Just see blender.org - professional 3d modeling and rendering software all done in GL.

    No other combinations will give you that.

    If u want to see actual performance of ur c++ OpenGL game, switch off vertical sync. Otherwise fps is locked to your screen refresh rate (60,30,15...).
  • 0
    @sinisas 15Hz screen? Wait... If you have an 60Hz monitor and only have like 50fps vsync locks it at 30fps so it looks kinda ok? And same for 30Hz screen can get locked at 15fps?
  • 0
    @b3b3 hehe no, not like that.

    Vertical sync is usually by default on in driver, to prevent visual effects called "tearing"

    https://en.m.wikipedia.org/wiki/...

    That happens when app refreshes GL context in rate that is different than screen rate, basically for split moment u can see part of one frame in top half of the screen and part of another frame in bottom half.

    Vertical sync locks fps to always be in sync with refresh rate of the screen.

    So if your app is actually running on 75.8fps, will be locked to 60fps.

    If it runs on 59fps, will actually be locked to 30fps.

    And so on.

    You can disable vertical sync in your code, unless driver is set to override application level settings.
  • 0
    @sinisas I actually would rather lower visual settings than enabling vsync. Vsync always makes games feel so unresponsive... Spongy... However you call it in english
  • 1
    @b3b3 oh I am all for disabling it that's why I advised in my first post to do so.
  • 0
    V-Sync is actually really useful in 2D, I keep it on because otherwise tiles get "fuzzy" when moving around on screen.
  • 0
    I optimized cs go from 20-30 fps to 100+ fps
Add Comment