29/03/2014 OpenGL Samples Pack 4.4.2.0 released

The OpenGL Samples Pack 4.4.2.0 leverage the work on the new framework introduced in 4.4.1 by adding 26 new OpenGL samples. They essentially focus on catching up with OpenGL 4.4, 4.3 and ARB extensions functionalities.

Release notes
  • Added 'caps' samples for each version of OpenGL
  • Added in source build option
  • Added 440-texture-sparse-arb sample
  • Added 440-texture-cube-arb sample
  • Added 440-texture-bindless-arb sample
  • Added 440-shader-invocation-nv sample
  • Added 440-query-occlusion sample
  • Added 440-multi-draw-indirect-id-arb sample
  • Added 440-multi-draw-indirect-count-arb sample
  • Added 440-glsl-vote-arb sample
  • Added 440-fbo-without-attachment sample
  • Added 440-buffer-storage
  • Added 440-atomic-counter
  • Added 430-query-occlusion sample
  • Added 430-query-conditional sample
  • Fixed 430-multi-draw-indirect sample, alignment access in shader issue
  • Added 430-fbo-without-attachment sample
  • Added 430-fbo-invalidate sample
  • Added 400-texture-cube sample
  • Added 330-query-occlusion sample
  • Added 330-query-conditional sample
  • Added 320-primitive-line-msaa sample
  • Added 320-primitive-point-clip sample
  • Added 320-primitive-point-quad sample
  • Updated multiple samples to use shader storage buffer instead of VAOs
  • Updated multiple samples to use texture 2d array instead if texture 2d
  • Fixed FreeImage link issue

A look at point rendering

Point rendering with OpenGL is a mess. I don't know how it is with other APIs but that's something I'd like to get better. The following screenshots are based on gl-320-primitive-point-clip sample but it produces pretty difference outputs for each vendors.

AMD point rendering: The green point is clipped because its center went outside the window
AMD point rendering: The green point is clipped because its center went outside the window
Intel point rendering: The green point is clipped because its center went outside the window and the point size is clamp to it's maximum.
Intel point rendering: The green point is clipped because its center went outside the window and the point size is clamp to it's maximum.
NVIDIA point rendering: Render the three points with guard band clipping which is not a standard behaviour
NVIDIA point rendering: Render the three points with guard band clipping which is not a standard behaviour

NVIDIA not following the specification is the only approach that really makes sense. Clipping at the point center leads to visible popping artifacts on the border of the window. This makes point rendering an unacceptable solution.

AMD, Intel and NVIDIA maximum point sizes is respectively 8192.0, 255.0, 2047.0 pixels. The drivers are pretty buggy with these as AMD, Intel and NVIDIA drivers report respectively 63.0, 20.0 and 189.875. If we look at the code to query the point size, the fixed function queries return the numbers we can observe but the programmable query returns wrong numbers.

Querying min and max point sizes:
  • // Fixed function min point size, compatibility profile only:
  • glGetFloatv(GL_POINT_SIZE_MIN, &POINT_SIZE_MIN);
  • glGetFloatv(GL_POINT_SIZE_MAX, &POINT_SIZE_MAX);
  • // Programmable range point size, returns min and max in one query:
  • glGetFloatv(GL_POINT_SIZE_RANGE, &POINT_SIZE_RANGE[0]);

One possible alternative is to use geometry shader to expand each point into a triangle strip so that each point is clip as a quad. This provides reliable rendering as we can see with gl-320-primitive-point-quad sample. OpenGL ES doesn't support geometry shader but also specified a different clipping rule for points which is no clipping at all which effectively behaves like NVIDIA implementation.

AMD point rendering through geometry shader expansion
AMD point rendering through geometry shader expansion
Intel point rendering through geometry shader expansion
Intel point rendering through geometry shader expansion
NVIDIA point rendering through geometry shader expansion
NVIDIA point rendering through geometry shader expansion
GLM 0.9.5.3 released >
< OpenGL 4.4 and ES 3.0 Pipeline Maps available in SVG
Copyright Christophe Riccio 2002-2016 all rights reserved
Designed for Chrome 9, Firefox 4, Opera 11 and Safari 5