OpenGL ES 1.1是可能有 - vertexColors和照明? [英] OpenGL ES 1.1 is it possible to have both - vertexColors AND lighting?

查看:209
本文介绍了OpenGL ES 1.1是可能有 - vertexColors和照明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个网格使用vertexColors然后启用GL_LIGHTING,那么vertexColors将被忽略并被计算的光照替换。

If I have a mesh that uses vertexColors and then enable GL_LIGHTING, then the vertexColors will be ignored and replaced by the calculated lighting.

在OpenGL中有一种方法ES1.1同时具有同时 - 顶点颜色&动态照明?

Is there a way in OpenGL ES 1.1 to have both at the same time - vertex colors & dynamic lighting?

感谢!

推荐答案

p>

You can use

glEnable(GL_COLOR_MATERIAL);

使材料参数跟踪当前颜色。在桌面OpenGL实现上,还有 glColorMaterial 可以配置颜色被应用为扩散值的环境,在OpenGL-ES中我认为它同时适用于两者。

to have the material parameters track the current color. On desktop OpenGL implementations there is also glColorMaterial to configure if the color is to be applied as the ambient of diffuse value, in OpenGL-ES I think it alway applies to both.

这篇关于OpenGL ES 1.1是可能有 - vertexColors和照明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆