IRIS GL and OpenGL Programming Tips and Pitfalls
IRIS GL
- If your GL/X11 app crashes with "error 93 ERR_WMANIPC " it's probably
caused by a bad X window ID being passed to an Xlib function.
- Whenever lmbind() is called the position of the light is re-transformed
by the current modelview matrix. So, enabling/disabling lighting can have
the unwanted side effect of moving your lights.
- IBM's implementation of GL on the GTO has a few problems:
- Polygons are not point sampled correctly; zero-area polygons appear
as speckled lines.
- Many useful GL functions in SGI's implementation are missing.
- The lighting arithmetic seems to be a bit different than SGI's.
- More to come...
OpenGL
- Problem: OpenGL rendering is just slower than expected.
Solution: Make sure you're using a direct GLX rendering
context if displaying locally.
See glXCreateContext().
- Problem: scaling your model causes the intensity of lighting
to change.
Solution: try glEnable(GL_NORMALIZE)
- Problem: you've defined a texture with glTexImage2d() and have
enabled texturing but don't see the texture on your model.
Solution: the default texture minification filter is
GL_NEAREST_MIPMAP_LINEAR but you haven't defined the mipmaps. Try
glTexParameter( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR )
- Problem: glDrawPixels() is much slower than GL's lrectwrite.
Solution: Make sure you disable all raster operations that aren't
needed such as GL_DEPTH_TEST, etc. Use the GL_RGB / GL_UNSIGNED_BYTE image
format as it's usually the fastest. Some implementations support the
GL_ABGR_EXT format which is faster on old systems.
- Problem: glRasterPos() doesn't position bitmaps where I want.
Solution: glRasterPos accepts model coordinates, not window
coordinates. The coordinate given to glRasterPos is transformed by the
modelview and projection matrices just like a vertex.
- More to come...