The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA color (where alpha is always set to 0.0) that is associated with every vertex.
The secondary color is interpolated and applied to each fragment during rasterization when GL_COLOR_SUM is enabled. When lighting is enabled, and GL_SEPARATE_SPECULAR_COLOR is specified, the value of the secondary color is assigned the value computed from the specular term of the lighting computation. Both the primary and secondary current colors are applied to each fragment, regardless of the state of GL_COLOR_SUM, under such conditions. When GL_SEPARATE_SPECULAR_COLOR is specified, the value returned from querying the current secondary color is undefined.
glSecondaryColor3b, glSecondaryColor3s, and glSecondaryColor3i take three signed byte, short, or long integers as arguments. When v is appended to the name, the color commands can take a pointer to an array of such values.
Color values are store

OpenGL维护了主副两个RGBA颜色值,副颜色在启用GL_COLOR_SUM时在光栅化过程中进行插值并应用于每个片段。当开启光照且指定GL_SEPARATE_SPECULAR_COLOR时,副颜色将被设置为光照计算的高光部分。glSecondaryColor系列函数用于设置副颜色,颜色值以浮点格式存储,并在写入颜色缓冲区前进行范围限制。
最低0.47元/天 解锁文章
2392

被折叠的 条评论
为什么被折叠?



