glColor*f vs glColor*ub

Started by
13 comments, last by Zeu5 20 years, 11 months ago
My mental sanity is OK, trust me!
AnywayZ, for a speedy code use vbo or at least glDrawArrays. May be tuff for dynamic objects though. Secondly, GL is state machine & I doubt you are specifying those colors THAT much to get some kind of bottleneck! Finally, 123kb/34kb on !@* translates 128 MB (131072 KB), you are laughing or what?
BTW, prove me wrong, but vp/fp uses float & half as standart color variables ''usually'', I guess ther''s some point. I guess vertices are calculated in float, but colors are using, at least mostly, the same kind, if not the same pipe! That stands for 128/32/24/16/8 bit color and those old 256(ub!) color modes!
And, that loop time, if you are using identical loops, they MUST take exactly the same amount of time in f and u (arghh. ub) test!


______________________________
Madman
______________________________Madman
Advertisement
" GL is state machine & I doubt you are specifying those colors THAT much to get some kind of bottleneck! Finally, 123kb/34kb on !@* translates 128 MB (131072 KB)"


I agree, but some try to optimism a much as possible; I think there was a thread a few weeks ago on this (trying to store as much geometry as possible using the least amount of room). Generally speaking it''s not neccessary because of the resources available on todays cards; it is however,still important to to note that there is a difference in terms of storage bewteen the two, so my point is valid.
if you are using glColor* command format doesn''t matter that much becouse the function all overhead is killing your performance..

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
quote:Original post by Mihail121
And we get back to the question.Quake2 is based on immediate mode and i don''t find it slow.Especially when i have played it on P 120 with 16 ram and 2 mb video....

The PAIN is coming...this summer!!!In cinemas everywhere.


It is NOT, read the source

and now to answer the question.... from MSDN.

Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to –1.0. Floating-point values are mapped directly.

Neither floating-point nor signed integer values are clamped to the range [0,1] before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

This topic is closed to new replies.

Advertisement