Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Sample Buffers
Forum Update on Monday, May 27th 2025

Sample Buffers

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Flurite
    wrote on last edited by
    #1

    What are sample buffers?

    I am learning the basics of OpenGL with Qt and it seems sample buffers are Qt specific, and I don't really understand what information they store for the screen.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is not Qt specific topic.

      This is called multisampling. It is a technique of anti-aliasing (getting rid of sharp, blocky edges).
      http://www.opengl.org/wiki/Multisampling

      This is an example how it looks ilke:
      http://doc.qt.digia.com/stable/opengl-samplebuffers.html

      To achieve this a special type of format is needed for front and back buffers (the ones you draw into).
      In vanilla OpenGL this is a platform specific feature. On windows you need to pass special attributes when creating OpenGL window (specifically WGL_SAMPLE_BUFFERS and WGL_SAMPLES).

      Qt handles it by calling setSampleBuffers(true) and setSamples(sampleCount) on QGLFormat before creating a GL widget.

      As for the quality - the more samples, the smoother the edges are. For now 2, 4 and in some cases 8 samples are supported I think, depending on your graphics hardware.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved