Intro to GL3 in Jitter

What is GL3?

Jitter’s standard OpenGL engine, while very capable and rich, is based on an older version of the OpenGL Specification. The GL3 package provides support for the newer OpenGL Core Profile for most Jitter GL objects and functionality.

OpenGL Core Profile

Briefly, with the release of OpenGL 3.1 support for legacy OpenGL functionality went away. This includes the fixed function pipeline and immediate mode drawing. Modern GL contexts that don’t support legacy functionality are said to implement the Core Profile. These contexts use programmable shaders and buffer objects in place of the fixed function pipeline. There are many reasons to support the Core Profile in Jitter, but primary is support for modern GLSL versions. To learn more about GLSL version features, read the specs.

What does that mean for Jitter?

In many cases, you won’t notice much difference to the standard geometry objects, as Jitter provides automated shader generation behind the scenes to replicate the familiar fixed functionality features. You can compare this to how jit.gl.material already operates. On the other hand, GL3 encourages the use of custom GLSL to get much more control over your geometry rendering. If you are already customizing and writing your own GLSL shaders for use with jit.gl.shader and jit.gl.slab, you will find that Jitter conveniently converts the older GLSL to the newer syntax on load. Send the message get_gl3_shader to supported objects to discover what this converted code looks like. While the GL3 engine is forward-looking and offers new features, you may find for some projects that it’s best to stick with the classic rendering engine.

Swappable GL Rendering Engine

Support for GL3 is facilitated through a new swappable render engine framework. This allows you to change the backend rendering engine via a Max application preference (OpenGL Engine). The design of this engine framework was informed and inspired by the video engine framework introduced in Max 7. However unlike with video engines, you can’t override the render engine preference on a per-object basis (i.e. there is no jit.gl @engine attribute). The preference will persist from Jitter initialization to application shutdown. After changing this preference, you will need to restart Max to see the effects.

How do I use GL3?

  • Install the GL3 package from the Package Manager (File->Show Package Manager).
  • After installing, open the Max Preferences window
  • Scroll down to the OpenGL Version pref and change the value to 'gl3'
  • Restart Max and make a jit.world object and enable rendering on it.
  • You should see your current OpenGL version number printed in the Max console. You are now using gl3.

See Also

Name Description
GL3 Package Topics GL3 Package Topics