Help end child hunger
Apr 142011
 

When we call a function from the OpenGL API we may be calling it incorrectly, and this is what glGetError is good for. “Incorrectly” can mean several things, for instance, the parameters are not in a valid range, or a function is being called without a proper context.

Every time an error is detected a flag is set and a numeric code is recorded. Any errors afterwards won’t be recorded so we need to make sure we check for errors at the most significant points in your application.

This page describes in detail the behaviour of glGetError.

 

Apr 132011
 

AMD CodeAnalyst for Windows® | AMD Developer Central.

AMD CodeAnalyst Performance Analyzer for Windows is a suite of powerful tools that help developers optimize software performance. CodeAnalyst uses profiling to identify and analyze performance hotspots within an application, library, driver or kernel module. CodeAnalyst profiles both managed and native code. CodeAnalyst collects system-wide profile data with low overhead and is well-suited for multi-threaded, multi-core development. Software under analysis executes at full speed.

Apr 112011
 

GLUT was conceived by Mark Kilgard with the goal of providing a simple, yet powerful enough, toolkit to deal with the intricacies of the windowing system when building OpenGL applications. In my opinion GLUT was a very effective solution and completely fits the bill. As far as I know, GLUT is still the simplest toolkit around and yet it does most of what is needed for simple prototypes.

GLUT however is not free of criticism. Complaints about the lack of control on the event loop are abundant on the web and some extra functionality, context creation and multisampling, would be most welcome.

GLUT is not open source hence it could not be modified, so GLUT clones have appeared. These kept the API (all gluts functions are usually implemented exactly with the same name) but improved and extended it to address the above mentioned issues.

There are open source versions of GLUT, such as freeGLUT and OpenGLUT. They all kept the API so 99.9% of what will be presented in this tutorial is still valid. Nonetheless these new versions do have some extensions that make it worth a try. Check out the extensions in freeGLUT  here.

Apr 102011
 

When working with the newest OpenGL functionality most of us rely on third party libs to make the functions available to us. Some examples of these third party libs are GLEW and GLEE.

These libs do a wonderful job and most of the time they save us a lot of work. However, sometimes strange things happen. Consider an application that has requested an OpenGL context version 3.3, with the core profile, using GLEW version 1.5.8.

When calling

GLuint k = glGetUniformBlockIndex(p,"Matrices");

The application crashes with an Unhandled exception. The reason is that glGetUniformBlockIndex has not been loaded in GLEW.

According to GLEW documentation:

GLEW obtains information on the supported extensions from the graphics driver. Experimental or pre-release drivers, however, might not report every available extension through the standard mechanism, in which case GLEW will report it unsupported.

I would expect not to have this issue since I’m using the latest release drivers from nVidia, which clearly state that they support OpenGL 3.3 on my GPU.

Anyway, fortunately GLEW documentation also tells us how to solve the problem:

To circumvent this situation, the glewExperimental global switch can be turned on by setting it to GL_TRUE before calling glewInit(), which ensures that all extensions with valid entry points will be exposed.

Basically, instead of calling only glewInit() just write:

glewExperimental= GL_TRUE;
glewInit();

And that should solve it 🙂

Apr 092011
 

Bullet physics library version 2.78 released.

 

 

New in Bullet 2.78

  • Fracture and glueing demo that can break or glue child shapes of a btCompoundShape when certain impulse thresholds are exceeded.
    See Bullet/Demos/FractureDemo
  • Breakable constraints, based on an applied impulse threshold.
    See Bullet/Demos/ConstraintDemos
  • Improved binary .bullet file format with soft body serialization and
    See Bullet/Demos/SerializeDemo
  • Polyhedral contact clipping and optional separating axis test (SAT) as alternative to GJK/EPA and incremental contact manifold, for btPolyhedralConvexShape derived shapes such as btConvexHullShape
    See Demos/InternalEdgeDemo
  • OpenCL and DirectCompute cloth simulation improvements: GPU kernels for capsule collision detection and OpenCL-OpenGL interop
    See Demos/OpenCLClothDemo and Demos/DX11ClothDemo
  • Speculative/predictive contact constraints as a method to perform continuous collision response.

 

Apr 072011
 

GPU Tools | AMD Developer Central.

AMD has an excellent  collection of tools for OpenCL and Shader development in the GPU Tools area. Included are PerfStudio, a performance analysis and debugging tool, and ShaderAnalizer for analysing the performance of individual shaders. Currently they only work with Compatibility Profile, hope an update will cover the more recent versions.

Apr 072011
 

Assimp is a Cross-Platform Open Source Library to load 3D modes. Currently, as of version 2.0, it can import an impressive list of formats and it also exports to Collada and 3DS MAX. Once loaded, all the models attributes are easily accessible through the API.

The library also performs some post processing tasks on the imported models. These range from the common triangulation and conversion to left handed systems (Direct3D is an example), to mesh performance tunning and improve vertex cache locality.

Assimp is tailored at typical game scenarios by supporting a node hierarchy, static or skinned meshes, materials, bone animations and potential texture data.

It is fairly easy to use Assimp in an OpenGL context, and a few demos are provided in the release package.

See other libs that work great with OpenGL.