Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Why the rendering color seems not smooth?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2003
    Location
    Beijing, China
    Posts
    18

    Why the rendering color seems not smooth?

    I program on WindowsXP platform.

    and set PIXELFORMATDESCRIPTOR members like such.

    PIXELFORMATDESCRIPTOR pfd = {
    sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
    1, // version number
    PFD_DRAW_TO_WINDOW | // support window
    PFD_SUPPORT_OPENGL | // support OpenGL
    PFD_DOUBLEBUFFER, // double buffered
    PFD_TYPE_RGBA, // RGBA type
    24, // 24-bit color depth
    0, 0, 0, 0, 0, 0, // color bits ignored
    0, // no alpha buffer
    0, // shift bit ignored
    0, // no accumulation buffer
    0, 0, 0, 0, // accum bits ignored
    32, // 32-bit z-buffer
    0, // no stencil buffer
    0, // no auxiliary buffer
    PFD_MAIN_PLANE, // main layer
    0, // reserved
    0, 0, 0 // layer masks ignored
    };

    and then go on ChoosePixelFormat(...) and SetPixelFormat(...)

    Every thing seems OK!

    I check the pixel color format with code:
    glGetIntegerv(GL_RED_BITS, &iParam);

    And iParam is 8(bit);

    But the rendering color is not smooth, looks just like in 256 color!

    Why?

    Thank you!

    Doggle

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Why the rendering color seems not smooth?

    Not enough informations to answer. What and how do you draw?
    Do a DescribePixelFormat() and check the other fields in the pixelformat.
    Try a simple triangle with three different colors at the vertices with lighting disabled.
    Make sure glShadeModel is set to the default GL_SMOOTH for Gouraud shading.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2003
    Location
    Beijing, China
    Posts
    18

    Re: Why the rendering color seems not smooth?

    Thank you, Relic!

    I have tried the function DescribePixelFormat(), the result is correct: 24 bit color depth, r, g, and b each share 8 bit.

    I render a 3D model with texture.

    I'm sure the model is correct, because I render it with 3d explore, a application programme, the result is smooth.

    It seems irrelevant to pixel format...

    I'm trying other things ...

    As I trying to draw an image in OpenGL with glDrawPixels(...), the image is strangely thrink! I think maybe the texture image is thrinked too, what makes the rendering looks not smooth.

    Doggle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •