Results 1 to 6 of 6

Thread: Color different?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    india
    Posts
    6

    Color different?

    We are having some problem regarding color index. We have an user defined palette of 67 colors.

    Case 1: Set the mode to RGBA in the pixel formatDescriptor. Draw a line setting color with glColor3ub

    Case 2: Set the mode to Color Index in the pixel formatDescriptor. Draw a line setting color with glIndex.

    The output in the above two cases differ slightly in color when the index corresponding to the same colorref variable is refered in the glIndex.

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: Color different?

    It depends on what you mean with "slightly". It can be a slight difference with color index mode since the VGA standard only uses 6 bits of each R,G and B in the palette.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    india
    Posts
    6

    Re: Color different?

    Hi their,
    Let me explain you the problem in detail.
    I am trying to draw both GDI and OpenGL figures in a single window. GDI is in RGB mode. OpenGL is in Color Index mode. For both, i am using an user defined palette.

    Hope so far is understood.

    Now
    Step1:- Fill the window background using FillRect by passing a brush created with an equivalent colorref of a color taken from the palette.
    Eg: sb = CreateSolidBrush(0xc0c0f0);
    FillRect(......,sb);
    where 0xc0c0f0 is a eqivalent to color index 17 in the palette.

    Step2:- For opengl set the index to 17 and draw a filled rectangle.

    Now if you check the output you can see a slight difference in the background color and the rectangle fill color, even though i am using the same color for both.

    I tried this in an NT with 65536 colours.

    Hope you got the problem.

    Is this because of what you mentioned earlier or some thing else.?

  4. #4
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: Color different?

    Well ... now i understand the situation a little better, and what i mentioned above shouldn't have anything do to with your problem ... but i don't have any answer to why the problem occurs, sorry ...

  5. #5
    Member Contributor
    Join Date
    Feb 2000
    Location
    Breda, Netherlands
    Posts
    57

    Re: Color different?

    Maybe this has something to do with OpenGL bleding something? Or a lighting effect?
    if these are disabled, I haven't got a clue either.

    John

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    india
    Posts
    6

    Re: Color different?

    Hi john,
    I tried enabling light and blending, still its not working. The problem comes only if you run the program in NT machine with 65536 colors.
    Sajith

Similar Threads

  1. Rainbow color band and color palettes in OpenGL?
    By rakeshthp in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 01-15-2013, 01:57 AM
  2. High color/true color troubles on Win2000
    By Lelik in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-22-2004, 04:39 AM
  3. Drawing color affected by texture color
    By yossi in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-14-2001, 03:56 AM
  4. How to show object-color through light-color?
    By jonn in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-18-2001, 09:25 PM
  5. color buffer color as source for register combiners
    By Kosta in forum OpenGL: General
    Replies: 1
    Last Post: 07-11-2000, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean