内に含ま
その他のドキュメント
サポート リソース
| PDF 文書ファイルをダウンロードする
- CHAPTER 5
Tips and Techniques
- This chapter presents miscellaneous topics that you may find useful as you port your application to the OpenGL for Solaris software.
Avoiding Overlay Colormap Flashing
- Colormap flashing may occur when your application uses overlay windows. This problem stems from several characteristics of the Creator3D system: the overlay visual is not the default visual, the Creator3D is a single hardware colormap device, and X11 allocates colormap cells from pixel 0 upward. When the application renders to the overlay window, it must use a non-default visual, and a non-default colormap is loaded. In this case, colormap flashing between the default and non-default colormaps can occur.
- The best solution to this problem is to allocate the overlay colors at the high end of the overlay colormap. In other words, if you have n colors to allocate, allocate them in the positions colormap_size -n -1 to colormap_size -1.This avoids the colors in the default colormap, which are allocated upward starting at 0. To allocate n colors at the top of the overlay colormap, first allocate colormap_size-n read/write placeholder cells using XAllocColorCells. Then allocate the n overlay colors using XAllocColor. Finally, free the placeholder cells. This solution is portable; it works on both single- and multiple-hardware colormap devices.
Changing the Limitation on the Number of Simultaneous GLX Windows
- There is a limitation on the number of GLX windows that an application can use simultaneously. Each GLX window that has an attached GLX context uses a file descriptor for DGA (Direct Graphics Access) information. You can find the current number of open file descriptors using the limit(1) command:
-
-
% limit descriptors
descriptors 64
- The system response tells you that you have up to 64 direct GLX contexts, assuming that you have no other processes concurrently using file descriptors.
- You can increase the per-process maximum number of open file descriptors using the limit command as follows:
-
-
% limit descriptors 128
- This command changes the number of file descriptors available for DGA and other uses to 128. Use the sysdef(1M) command to determine the maximum number of file descriptors for your system.
Hardware Window ID Allocation Failure Message
- On Creator3D, when a program calls glXMakeCurrent(3gl) to make a window the current OpenGL drawable, the system will attempt to allocate a unique hardware window ID (WID) for the window. This allows double buffering and hardware WID clipping to be used. Because hardware WIDs are a scarce resource and can be used for other purposes, there might not be any WIDs available when glXMakeCurrent is called. If this should happen, the following message is displayed:
- OpenGL/FFB Warning: unable to allocate hardware window ID
- In this situation, double buffering will not be provided for the window, and the window will be treated as a single-buffered window.
Getting Peak Frame Rate
- The frame rate that ogl_install_check prints out is synchronized to monitor frequency. It measures the time it takes to render the frame, wait for vblank, then swap the buffers. Since FFB can render the ogl_install_check image very quickly, even on an FFB1 Electron 167 mhz machine, the bottleneck is waiting for the monitor vblank. So, under normal circumstances, ogl_install_check is never going to be able to get a frame rate faster than the monitor frequency.
- However, there is an environment variable called OGL_NO_VBLANK that you can set to see the peak, unsynchronized frame rate. When set, this environment variable swaps buffers immediately, without waiting for vblank.
Identifying Release Version
- You can identify the Release Version Number of the OpenGL Library by:
-
- Using the what(1) or mcs(1) command:
-
-
% what /usr/openwin/lib/libGL.so.1
% mcs -p /usr/openwin/lib/libGL.so.1
2. Programatically, by calling glGetString (GL_VERSION)
(see the glGetString man page for more details)
3. Running the OpenGL for Solaris install_check demo program:
% /usr/openwin/demo/GL/ogl_install_check
Pixmap Rendering
- OpenGL for Solaris does not support GLX pixmaps with direct rendering contexts. Use indirect rendering contexts (see the glXCreateContext(3gl) man page for indirect rendering contexts).
Determining Visuals Supported by a Specific Frame Buffer
- To determine what visuals a specific frame buffer supports, use /usr/openwin/ demo/GL/xglinfo.
Creator3D Fog
- There is a hardware problem with the linear perspective fog on Creator3D that causes the fog color to overtake the scene color faster than it should for a given depth. As a workaround, you can increase the start and end linear fog parameters appropriately. For instance, in a scene where the fog start and end parameters are equal to the start and end of the perspective view frustum, you should increase the start parameter to be as close as possible to the start of the geometry. You can increase the end parameter to attenuate the effect of the scene getting dark too rapidly. Also, it helps to modify the Z begin and Z end values of the view frustum so that they are closer together.
- This problem is fixed in Creator3D Series 2.
|
|