Blending and lighting in single/double buffer

Blending and lighting in single/double buffer

Post by Suryani L » Tue, 21 May 1996 04:00:00



Hi !

I am using OpenGL on Indy, Irix 5.3.
I want to create a transparent 3 dimensional cube and I have to rotate
the cube. I turned on the blending and 4 lights, the colour of the
material, and lights are all white. The cube looks very different
when drawn on a single or double buffer window. On a single buffer window,
the cube is blended properly. But on a double buffer window, small greenish
squares can be seen on the cube (I use glXSwapBuffers in the double
buffer window). Unfortunately, I can not use the single buffer window,
because of the flickering.

My question is : do I have to use other function calls in a double
buffer window ? My main program looks something like (glw is the
drawing area):

topLevel = XtAppInitialize
           (&AppContext,     /* Application context  */
           "Display",    /* application class name   */
           (XrmOptionDescList)NULL,
           (Cardinal) 0,  (int *)&argc,  (String*)argv, fallback_resources,
           (ArgList)NULL, 0);

glw = XtVaCreateManagedWidget("glw", glwMDrawingAreaWidgetClass,
                              topLevel, NULL);

in the resource file, I set doublebuffer to TRUE for double buffer
and to FALSE for single buffer window:
.
.
*glw.doublebuffer: TRUE
.
.

My illustration probably is not very clear, so if you need to look at
my codes, I will send them to you.

Any comments are very much appreciated.

Thank you.

Suryani.

 
 
 

Blending and lighting in single/double buffer

Post by Ran Yaki » Mon, 27 May 1996 04:00:00


Quote:> Hi !

> I am using OpenGL on Indy, Irix 5.3.
> I want to create a transparent 3 dimensional cube and I have to rotate
> the cube. I turned on the blending and 4 lights, the colour of the
> material, and lights are all white. The cube looks very different
> when drawn on a single or double buffer window. On a single buffer window,
> the cube is blended properly. But on a double buffer window, small greenish
> squares can be seen on the cube (I use glXSwapBuffers in the double
> buffer window). Unfortunately, I can not use the single buffer window,
> because of the flickering.

Are you, by any chance, using an 8 bit INDY ? Try running 'hinv' and see what
kind of INDY graphics you have (last line).
When using doublebuffer mode, your total number of bitplanes is divided by
two. Meaning, if you have 24 bits for single buffer, you'll have 12 bits per
buffer in double buffer mode. 12 bits means 4 bits per component (red, green
and blue). The INDY graphics compensates for that by dithering colors, to give
you the illusion of 24 bits. There is a quality difference between 24 and 12
bits, which may be the source of your problems. However, if you have 8 bits,
you are already dithering in single buffer mode. While this might be OK with
the single buffer's 256 colors, when you go to double buffer (4 bits !!!) you
really have only 16 colors, which are used by the dithering mechansim t
ocreate an illusion of 16 million colors ... In that case, you are bound to
see all kinds of weird colors.

Ran

 
 
 

1. switching from double buffered to single buffered mode

Does anyone know of a gracefull way to switch back and forth between
single and double buffered mode in a OpenGl drawing widget, i.e. a
widget created by
glwidget = XtVaCreateManagedWidget ( "glwidget",
                                     glwMDrawingAreaWidgetClass,
                                     GLwNdoublebuffer, True, ...);?

Thanks, Hans

--
--------------------------------------------------------------

Scientific Volume Imaging BV,
J. Geradtsweg 181,
1222 PS Hilversum, The Netherlands.

URL: http://www.svi.nl/

tel: (0)35-6859405 or (0)653-345445
fax: (0)35-6837971

2. KODAK IS92p & IS70cp-ac high speed printers.......

3. ---> glx double buffer/ single buffer <-------

4. ULEAD MediaStudio Pro 6.5 UPGRADE NOW AVAILABLE

5. Double buffer/single buffer switching

6. TImage doesn't always display, depending on computer

7. single/double buffer in GLX mode

8. ---- SGI 3030 ---- Help needed ----

9. : how to switch between single<->double buffering in mixed model

10. GLX double/single buffer and resize

11. GLUT double/single buffering

12. double buffer -> double image

13. HELP! : single buffer disable z buffer