OpenGL: Should I always copy glColor * f values ​​myself?

This may seem silly ... but I was wondering if it matters if I send a value greater than 1.0f in the glColor * f function?

Are old gfx cards / drivers supported differently? Does OpenGL use the direct color value that I give it, or does it clamp it myself? Should I stop execution if (r> 1.0f) r = 1.0f ;? Is there any danger in excess of 1.0f that will lead to nonspecific behavior?

I can't seem to do anything more than 1.0f.

+4
source share
2 answers

From manpage :

“Neither the number of floating point values ​​nor the signed values ​​are bound to the range [0,1] until the current color is updated. However, the color components are clamped to that range before they are interpolated or written to the color buffer.”

+4
source

OpenGL will automatically clamp values ​​in the range [0, 1].

+2
source

Source: https://habr.com/ru/post/1334216/


All Articles