【发布时间】:2010-10-17 20:19:36
【问题描述】:
我在一个彩色立方体前面渲染 4 个顶点(一个正方形)。顶点颜色为白色,但在 0.5f 处混合。
请有人告诉我为什么彩色立方体在被半透明方块遮挡时显得更亮?
立方体呈现在前面没有正方形:
Normal cube http://img408.imageshack.us/img408/2853/normalcube.png
并且,用正方形渲染:
Cube with square http://img142.imageshack.us/img142/6255/brightsquare.png
请查看用于create the colored cube 的代码、用于实际draw the cube 的代码和code where the cube and square are rendered。
这是我的 init 函数中的代码:
glEnable(GL_CULL_FACE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
【问题讨论】:
-
所有链接都指向同一段代码
-
该死,谢谢提醒!现已修复...