Archived

This topic is now archived and is closed to further replies.

MENTAL

OpenGL OpenGL vs Monitor Refresh Rates

Recommended Posts

As I type this I''m happily in 1024x764x32, running at 85hz. When run my opengl apps in fullscreen, i''m still in 1024x764x32, but i''m running at 60hz. My own demos, quake 3, someone else''s demos, everything. anyone care to explain?

Share this post


Link to post
Share on other sites
its bcuz the damn f***ing detonator drivers use a default refreshrate of 60hz (in newer versions u can set them 4 directx but not 4 opengl)... but u can use tools like powerstrip (not free) to set refreshrates 4 each resolution independent if u use opengl or directx...

there was also a tool called hzres or similar, but u should NOT use it if u dont know what ur doing (otherwise ur monitor will visit a service center :D)


T2k

Share this post


Link to post
Share on other sites
hey, i found i really good program called ReForce which sets all default refresh rates to the highest ones the monitor can handle and it works fine.

damn, i thought that problem only existed on windows xp.

*sniff* there goes my last reason by being crap at quake 3 :''(

Share this post


Link to post
Share on other sites
what are you yapping about?

When you change the displaysettings you can set the freq as well, and if you enumrate the displaymodes and the user is smart enough to NOT uncheck the ''hide modes that the monitor cannot display'' then you only get valid freq modes..

and if you like, you can let the user choose the mode from the list of modes you get when you enumrate..

Share this post


Link to post
Share on other sites
Mazy

under windows 2000 the refresh rate will always go to 60hz when switching to fullscreen OpenGL or DirectX. This was because the "Always use best option" was removed from the frequency settings, meaning that EVERY directx or ogl app going into fullscreen was forced to use 60hz.

if you read carefully i did say that this was when i was running fullscreen opengl apps...

besides, since when could you enumerate anything with opengl?

Share this post


Link to post
Share on other sites
quote:
Original post by MENTAL
besides, since when could you enumerate anything with opengl?


You don''t enumerate with OpenGL. You use the Win32 API call EnumDisplaySettings(). Once you''ve obtained the settings you want, you pass them to ChangeDisplaySettings(). One of the members of the DEVMODE structure is dmDisplayFrequency...

Share this post


Link to post
Share on other sites
We covered this subject a while back in this thread http://www.gamedev.net/community/forums/topic.asp?topic_id=163391

Towards the bottom you''ll find code snippets from myself and someone else outlineing the changes that have to be made to the dmScreenSettings structure used to switch teh display to full screen mode (pay attension to teh flags used)

Share this post


Link to post
Share on other sites
Mental : in opengl you dont have a fullscreen option, you just set the resolution with win32 commands and make a borederless maximized window, so therefore you cannot blame the drivers opengl ''fullscreen mode''

Share this post


Link to post
Share on other sites
So the problem may come from Glut ? I use glut for creating the window and i let him manage all that stuff. To switch to full screen i use a glut function (glutFullScreen) , and may be this function sets a default refresh rate of 60 Hz ?

Although, there is still the problem of frame rate drop down from 60FPS to 30FPS ... Have to do with vsync i guess, but even NVRefresh didn''t solve my problem .

No one here use glut and can tell me his experience ?

Share this post


Link to post
Share on other sites
quote:
Original post by MazyNoc
Mental : in opengl you dont have a fullscreen option, you just set the resolution with win32 commands and make a borederless maximized window, so therefore you cannot blame the drivers opengl ''fullscreen mode''



From MSDN ChangeDisplaySettings


dwflags
[in] Indicates how the graphics mode should be changed. This parameter can be one of the following values.
...
CDS_FULLSCREEN
...

This looks like an explicit notification that we''d like fullscreen mode.

And given that the caller has to explicitly specify use my frequency by setting the DM_DISPLAYFREQUENCY flag in DEVMODE.dmFields, not setting it implies that Windows and/or the display driver should choose a value. So when Windows and/or the driver is given the opportunity to choose a refresh rate and it chooses 60Hz I feel justified in calling that poor, broken behavior that should be fixed. The fact that NVidia drivers provide a table in the driver settings for DirectX default refresh rates but not for OpenGL refresh rates shows they recognize that ppl do not expect every game to choose a refresh rate, but still refuse to do it for OpenGL.

Share this post


Link to post
Share on other sites
Well, ChangeDisplaySettings is a Win32 API function, NOT an OpenGL function. It is the OpenGL specification that (deliberately) lacks a means for setting the display mode and has nothing to do with the drivers.

The method of preparing the hardware and OS for OpenGL rendering is different for each OS. It is up to the OS to provide a means of said preparation. For Windows, that method is ChangeDisplaySettings plus the wiggle functions.

Since DirectX is platform-specific, it is able to include it''s own means of setting up the hardware. That is why nVidia provides a table in the driver settings for DirectX, but not OpenGL - OpenGL does not support such a table.

At any rate, as MazyNoc said, OpenGL does not have a fullscreen mode. CDS_FULLSCREEN is a Win32 thing, not an OpenGL thing.

Share this post


Link to post
Share on other sites
quote:
Original post by Dave Hunt
Well, ChangeDisplaySettings is a Win32 API function, NOT an OpenGL function. It is the OpenGL specification that (deliberately) lacks a means for setting the display mode and has nothing to do with the drivers.

...

Since DirectX is platform-specific, it is able to include it''s own means of setting up the hardware. That is why nVidia provides a table in the driver settings for DirectX, but not OpenGL - OpenGL does not support such a table.

At any rate, as MazyNoc said, OpenGL does not have a fullscreen mode. CDS_FULLSCREEN is a Win32 thing, not an OpenGL thing.



Fine -- lets call it a Windows Full Screen mode. 60Hz is an undesirable refresh rate for any full-screen application, whether its DirectX, OpenGL, GDI or otherwise. Regardless of that, NVidia''s display driver is responsible for all these drawing modes anyway.

NVRefreshTool manages to set default refresh rates for OpenGL modes by tweaking the NVidia drivers, so arguing about whether or not the driver is capable of doing it is pointless.

Share this post


Link to post
Share on other sites
As has been stated, ChangeDisplaySettings() CAN change the refresh rate, even with nVidia drivers. The NVRefresh tool was created to work around the issue where Windows doesn''t request the best refresh rate when changing display modes. The problem of defaulting to 60hz is actually a Windows (certain versions) problem, not a driver problem.

Share this post


Link to post
Share on other sites
Actually, on LCD displays you often have a responsetime that are around 16ms and that will max on 62.5Hz, anything faster doesnt give you anything. And when you dont have digital input to the display then the analog to digital converter is more accurate the lower the frequency you have, and since you dont get flickering in 60Hz on a regular LCD then 60Hz is the prefered speed.

So maybe the selection of 60Hz isnt a bug, its an assumption that all ppl have LCD monitors

Share this post


Link to post
Share on other sites

  • Announcements

  • Forum Statistics

    • Total Topics
      628356
    • Total Posts
      2982252
  • Similar Content

    • By test opty
      Hi all,
       
      I'm starting OpenGL using a tut on the Web. But at this point I would like to know the primitives needed for creating a window using OpenGL. So on Windows and using MS VS 2017, what is the simplest code required to render a window with the title of "First Rectangle", please?
       
       
    • By DejayHextrix
      Hi, New here. 
      I need some help. My fiance and I like to play this mobile game online that goes by real time. Her and I are always working but when we have free time we like to play this game. We don't always got time throughout the day to Queue Buildings, troops, Upgrades....etc.... 
      I was told to look into DLL Injection and OpenGL/DirectX Hooking. Is this true? Is this what I need to learn? 
      How do I read the Android files, or modify the files, or get the in-game tags/variables for the game I want? 
      Any assistance on this would be most appreciated. I been everywhere and seems no one knows or is to lazy to help me out. It would be nice to have assistance for once. I don't know what I need to learn. 
      So links of topics I need to learn within the comment section would be SOOOOO.....Helpful. Anything to just get me started. 
      Thanks, 
      Dejay Hextrix 
    • By mellinoe
      Hi all,
      First time poster here, although I've been reading posts here for quite a while. This place has been invaluable for learning graphics programming -- thanks for a great resource!
      Right now, I'm working on a graphics abstraction layer for .NET which supports D3D11, Vulkan, and OpenGL at the moment. I have implemented most of my planned features already, and things are working well. Some remaining features that I am planning are Compute Shaders, and some flavor of read-write shader resources. At the moment, my shaders can just get simple read-only access to a uniform (or constant) buffer, a texture, or a sampler. Unfortunately, I'm having a tough time grasping the distinctions between all of the different kinds of read-write resources that are available. In D3D alone, there seem to be 5 or 6 different kinds of resources with similar but different characteristics. On top of that, I get the impression that some of them are more or less "obsoleted" by the newer kinds, and don't have much of a place in modern code. There seem to be a few pivots:
      The data source/destination (buffer or texture) Read-write or read-only Structured or unstructured (?) Ordered vs unordered (?) These are just my observations based on a lot of MSDN and OpenGL doc reading. For my library, I'm not interested in exposing every possibility to the user -- just trying to find a good "middle-ground" that can be represented cleanly across API's which is good enough for common scenarios.
      Can anyone give a sort of "overview" of the different options, and perhaps compare/contrast the concepts between Direct3D, OpenGL, and Vulkan? I'd also be very interested in hearing how other folks have abstracted these concepts in their libraries.
    • By aejt
      I recently started getting into graphics programming (2nd try, first try was many years ago) and I'm working on a 3d rendering engine which I hope to be able to make a 3D game with sooner or later. I have plenty of C++ experience, but not a lot when it comes to graphics, and while it's definitely going much better this time, I'm having trouble figuring out how assets are usually handled by engines.
      I'm not having trouble with handling the GPU resources, but more so with how the resources should be defined and used in the system (materials, models, etc).
      This is my plan now, I've implemented most of it except for the XML parts and factories and those are the ones I'm not sure of at all:
      I have these classes:
      For GPU resources:
      Geometry: holds and manages everything needed to render a geometry: VAO, VBO, EBO. Texture: holds and manages a texture which is loaded into the GPU. Shader: holds and manages a shader which is loaded into the GPU. For assets relying on GPU resources:
      Material: holds a shader resource, multiple texture resources, as well as uniform settings. Mesh: holds a geometry and a material. Model: holds multiple meshes, possibly in a tree structure to more easily support skinning later on? For handling GPU resources:
      ResourceCache<T>: T can be any resource loaded into the GPU. It owns these resources and only hands out handles to them on request (currently string identifiers are used when requesting handles, but all resources are stored in a vector and each handle only contains resource's index in that vector) Resource<T>: The handles given out from ResourceCache. The handles are reference counted and to get the underlying resource you simply deference like with pointers (*handle).  
      And my plan is to define everything into these XML documents to abstract away files:
      Resources.xml for ref-counted GPU resources (geometry, shaders, textures) Resources are assigned names/ids and resource files, and possibly some attributes (what vertex attributes does this geometry have? what vertex attributes does this shader expect? what uniforms does this shader use? and so on) Are reference counted using ResourceCache<T> Assets.xml for assets using the GPU resources (materials, meshes, models) Assets are not reference counted, but they hold handles to ref-counted resources. References the resources defined in Resources.xml by names/ids. The XMLs are loaded into some structure in memory which is then used for loading the resources/assets using factory classes:
      Factory classes for resources:
      For example, a texture factory could contain the texture definitions from the XML containing data about textures in the game, as well as a cache containing all loaded textures. This means it has mappings from each name/id to a file and when asked to load a texture with a name/id, it can look up its path and use a "BinaryLoader" to either load the file and create the resource directly, or asynchronously load the file's data into a queue which then can be read from later to create the resources synchronously in the GL context. These factories only return handles.
      Factory classes for assets:
      Much like for resources, these classes contain the definitions for the assets they can load. For example, with the definition the MaterialFactory will know which shader, textures and possibly uniform a certain material has, and with the help of TextureFactory and ShaderFactory, it can retrieve handles to the resources it needs (Shader + Textures), setup itself from XML data (uniform values), and return a created instance of requested material. These factories return actual instances, not handles (but the instances contain handles).
       
       
      Is this a good or commonly used approach? Is this going to bite me in the ass later on? Are there other more preferable approaches? Is this outside of the scope of a 3d renderer and should be on the engine side? I'd love to receive and kind of advice or suggestions!
      Thanks!
    • By nedondev
      I 'm learning how to create game by using opengl with c/c++ coding, so here is my fist game. In video description also have game contain in Dropbox. May be I will make it better in future.
      Thanks.
  • Popular Now