Results 1 to 8 of 8

Thread: Creating Optimal OpenGL Window

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Creating Optimal OpenGL Window

    Are there any rules for creating an optimal window for OpenGL? Specifically with ChangeDisplaySettings and SetPixelFormat? So if I tested and found my display was using 24 bit colour should I try to switch it to 16 bit or 32 bit colour?

    I also noticed that when I enable the depth buffer my framerate drops to half. I was wondering if I was ending up in some software only mode. If that is the case, what can I do to detect which modes are better than which on any computer and choose that best mode?

    I'm using VC 6 (no MFC, no GLUT) and I don't want to change that for now.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: Creating Optimal OpenGL Window

    Originally posted by Furrage:
    Are there any rules for creating an optimal window for OpenGL? Specifically with ChangeDisplaySettings and SetPixelFormat? So if I tested and found my display was using 24 bit colour should I try to switch it to 16 bit or 32 bit colour?
    Try to match display color depth and rendering depth.
    IE 16bit displaymode -> 16bit pixelformat w 16bit z, if required; 32 bit display ->32bit pixelformat w 32bit z.
    Now, if you really have a 24bit display, go for a 32bit pixelformat. If you can get a genuine 24bit pixelformat, you might as well go for it, but I doubt it. That's very uncommon, I believe Matrox was one of the few chip vendors with that option.

    I also noticed that when I enable the depth buffer my framerate drops to half. I was wondering if I was ending up in some software only mode. If that is the case, what can I do to detect which modes are better than which on any computer and choose that best mode?
    What kind of scene was that?
    If you tested that just with an (almost) empty screen, that's exactly what you should expect. After all, the card has to move twice the amount of data.

    If you hit a software path, performance usually drops drop a lot more.

  3. #3
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Creating Optimal OpenGL Window

    perhaps leave the window creation up to something like sdl?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: Creating Optimal OpenGL Window

    I tested a Sis6326 and a Sis597/598 and got the following results
    Device Mode Information (using EnumDisplaySettings)
    Code :
    Device mode	 dmBitsPerPel	 dmPelsWidth	 dmPelsHeight	dmDisplayFlags	 dmDisplayFrequency
    0	4	640	480	0	0
    1	8	640	480	0	0
    2	8	800	600	0	0
    3	8	1024	768	0	0
    4	16	640	480	0	0
    5	16	800	600	0	0
    6	16	1024	768	0	0
    7	24	640	480	0	0
    8	24	800	600	0	0
    9	24	1024	768	0	0
    10	24	1024	768	0	0
    Pixel formats that support OpenGL and double buffering (using DescribePixelFormat)
    Code :
    Pixel format	 dwFlags	 iPixelType	 cColorBits	 cAlphaBits	 cAccumBits	 cDepthBits	 cStencilBits	 cAuxBuffers
    3	 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER	PFD_TYPE_RGBA	24	0	64	32	8	0
    4	 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER	PFD_TYPE_RGBA	24	0	64	16	8	0
    7	 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER	PFD_TYPE_COLORINDEX 	24	0	0	32	8	0
    8	 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER	PFD_TYPE_COLORINDEX 	24	0	0	16	8	0
    What should I do in these cases. Also It says no Alpha. Does that mean I will not be able to show transparent objects?

    [Edit]How do I avoid/minimise software paths (I know these cards are not fully OpenGL compliant). And if I wanted the fastest rendering/texturing do I have to use trial and error or are there some guidelines for this. Assume I've already taken care of LOD, BSP Trees and other stuff that is not OpenGL specific. I'm more concerned about Device Mode, Pixel Format, and stuff to glEnable/glDisable. Face culling doesn't count here cause I am only experimenting with three Quads.

    [This message has been edited by Furrage (edited 04-15-2002).]

  5. #5
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Creating Optimal OpenGL Window

    >>Also It says no Alpha. Does that mean I will not be able to show transparent objects?<<

    thats destination alpha, u can still do blending/alpha test as long as the blending methods aint dest_alpha or 1-minus_dst_alpha

    >>How do I avoid/minimise software paths (I know these cards are not fully OpenGL compliant)<<

    Sis use the same data formats/methods as quake3

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: Creating Optimal OpenGL Window

    Originally posted by zed:
    Sis use the same data formats/methods as quake3
    I know nothing about quake 3's data formats and methods. Could you enlighten me or direct me to a site?

  7. #7
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Creating Optimal OpenGL Window

    http://www.quake3arena.com/news/glopt.html

    btw check first to see if quake3 does run at a reasonable speed on your machine first, if it doesnt get the latest drivers from sis + if that doesnt help perhaps u cant get opengl hardware acceleration

  8. #8
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: Creating Optimal OpenGL Window

    Thanks. I'll try some of the optimisations and see what happens.

Similar Threads

  1. OpenGL Creating Window
    By killermud in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-15-2013, 08:42 AM
  2. using opengl without creating window
    By shivmitra in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-02-2011, 05:40 AM
  3. Creating window, initializing opengl
    By kubow in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-13-2011, 05:30 AM
  4. Can I set up OpenGL Env without creating main window?
    By xiao in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-18-2002, 06:52 AM
  5. Creating menus in an opengl window???
    By StudentFYP in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-05-2001, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean