Unsupported — We cannot guarantee that this software will work properly on Mac OS 10.8 and above. Please be careful.

Release: GL Tools, v20071125

Release Type: Beta
Version: 20071125
Release Notes

This beta addresses some GL Errors in GL Point and GL Line. A portion of the glstate wasn't being preserved as it should have been.

GLTools-20071125.zip90.7 KB

yanomano's picture
Work really fast !

Woo... GL points and line seems to work faster ! (PowerPc/Leopard) And Like expected in multiples iterators ! Congratulations ! ...:)

Do you think It will be possible to have an image(with alpha) input in the GL point (for square texture) in a future version ?



cwright's picture
points are -- points :)

GL points are textureless primitives. If a texture is specified, it'll just pull a single pixel from it I think. I'll do some experiments and see if I'm totally wrong though.

If you're looking for square textures, use GL Quad :)

(Points and lines are faster because they're not causing QC to dump out lots of log messages saying the state is inconsistent — no idea how this slipped in before release...)

yanomano's picture
Yes but no>>>ARB_point_sprite

"Point sprites(ARB_point_sprite extensions) are hardware-accelerated billboards, which are capable of being textured. Point sprites are ideal for creating high-performance particle systems because you only have to send a single vertex point or point sprite for each particle instead of four vertices for a regular billboarded quad. Point sprites also do all the math involved in view aligning the final quad on the GPU ."


yanomano's picture
Point Sprite Doc

Point sprites are an exciting feature supported by OpenGL version 1.5 and later. Although OpenGL has always supported texture mapped points, prior to version 1.5 this meant a single texture coordinate applied to an entire point. Large textured points were simply large versions of a single filtered texel. With point sprites you can place a 2D textured image anywhere onscreen by drawing a single 3D point.

Probably the most common application of point sprites is for particle systems. A large number of particles moving onscreen can be represented as points to produce a number of visual effects. However, representing these points as small overlapped 2D images can produce dramatic streaming animated filaments. For example, screensaver on the Macintosh powered by just such a particle effect.

Before point sprites, achieving this type of effect was a matter of drawing a large number of textured quads onscreen. This could be accomplished either by performing a costly rotation to each individual quad to make sure that it faced the camera, or by drawing all particles in a 2D orthographic projection. Point sprites allow you to render a perfectly aligned textured 2D square by sending down a single 3D vertex. At one-quarter the bandwidth of sending down four vertices for a quad, and no client-side matrix monkey business to keep the 3D quad aligned with the camera, point sprites are a potent and efficient feature of OpenGL.

USING POINTS : Point sprites are very easy to use. Simply bind to a 2D texture, enable GL_POINT_SPRITE, set the texture environment target GL_POINT_SPRITE’s GL_COORD_REPLACEparameter to true, and send down 3D points: glBindTexture(GL_TEXTURE_2D, objectID); glEnable(GL_POINT_SPRITE); glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); glBegin(GL_POINTS); glEnd();

One serious limitation to the use of point sprites is that their size is limited by the range of aliased point sizes You can quickly determine this implementation-dependent range with the following two lines of code: GLfloat fSizes[2]; GLGetFloatfv(GL_ALIASED_POINT_SIZE_RANGE, fSizes);

Following this, the array fSizeswill contain the minimum and maximum sizes supported for point sprites, and regular aliased points.

TEXTURE APPLICATION : Point sprites obey all other 2D texturing rules. The texture environment can be set to GL_DECAL, GL_REPLACE, GL_MODULATE, and so on. They can also be mipmapped and multitextured. There are a number of ways, however, to get texture coordinates applied to the corners of the points. If GL_COORD_REPLACEis set to false, as shown here glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE); then a single texture coordinate is specified with the vertex and applied to the entire point, resulting in one big texel! Setting this value to GL_TRUE, however, causes OpenGL to interpolate the texture coordinates across the face of the point. All of this assumes, of course, that your point size is greater than 1.0!

POINT PARAMETERS : A number of features of point sprites (and points in general actually) can be fine-tuned with the function glPointParameter. Setting the GL_POINT_SPRITE_COORD_ORIGINparameter to GL_LOWER_LEFTplaces the origin of the texture coordinate system at the lower-left corner of the point: glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);

cwright's picture
I stand corrected...

... as is so often the case :) I'll see what I can whip up :)

Installation Instructions

Place the plugin file in
/Users/[you]/Library/Graphics/Quartz Composer Patches/
(Create the folder if it doesn't already exist.)

A set of patches for drawing GL primitives and modifying the GL environment.

Source code is available on GitHub.


Logo by @usefuldesign.au.

Known issues

  • The GL Field of View patch doesn't work properly on Mac OS 10.9 (it produces stretched output).