openGL之API学习(一六八)gl_SecondaryColor

OpenGL维护了主副两个RGBA颜色值,副颜色在启用GL_COLOR_SUM时在光栅化过程中进行插值并应用于每个片段。当开启光照且指定GL_SEPARATE_SPECULAR_COLOR时,副颜色将被设置为光照计算的高光部分。glSecondaryColor系列函数用于设置副颜色,颜色值以浮点格式存储,并在写入颜色缓冲区前进行范围限制。
摘要由CSDN通过智能技术生成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值