I set the color (0.5,0,0,0.5) to an vertex, but the value in p-buffer is (0.50195313,0,0,0.50195313). What is wrong with my p-buffer?
Thanks very much!
I set the color (0.5,0,0,0.5) to an vertex, but the value in p-buffer is (0.50195313,0,0,0.50195313). What is wrong with my p-buffer?
Thanks very much!
maybe the problem is in the way the float value is internally converted. instead of
glColor3f(0.5, 0.5, 0.5);
you should better use
glColor3ub(128, 128, 128);
when your display is set to 24 bit depth, the three unsigned bytes are used without being converted.
Thank you for your reply.
But I can’t set ubyte color in my program, because I need to set the output of vertex processor to colors, which is float.
Will other float buffer, such as PBO, avoid this problem?
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=012619
Quick rehash:
128/255 is approximately 0.50196. This is the closest you get to 0.5 with 8 integer bits per channel. So it appears like somewhere during processing, the value is converted to 8 bit (per channel) integer.
I have not tried your method, but I believe your method will success. You have easily solve my supicious on the strange number of 0.5019.
Thank you very much!