gpt4 book ai didi

android - OpenGL FRONT_AND_BACK

转载 作者:行者123 更新时间:2023-11-29 21:32:41 25 4
gpt4 key购买 nike

我使用以下方法剔除我的对象:

fx.g.glEnable(GL10.GL_CULL_FACE);
fx.g.glCullFace(GL10.GL_BACK);

然而,当我为我的对象设置蓝色 Material 时,它们显示为灰色:

fx.g.glMaterialfv(GL10.GL_BACK, GL10.GL_AMBIENT, ambient, 0);
fx.g.glMaterialfv(GL10.GL_BACK, GL10.GL_DIFFUSE, diffuse, 0);
fx.g.glMaterialfv(GL10.GL_BACK, GL10.GL_SPECULAR, specular, 0);
fx.g.glMaterialfv(GL10.GL_BACK, GL10.GL_SHININESS, Ns, 0);

fx.g.glMaterialfv(GL10.GL_FRONT, GL10.GL_AMBIENT, ambient, 0);
fx.g.glMaterialfv(GL10.GL_FRONT, GL10.GL_DIFFUSE, diffuse, 0);
fx.g.glMaterialfv(GL10.GL_FRONT, GL10.GL_SPECULAR, specular, 0);
fx.g.glMaterialfv(GL10.GL_FRONT, GL10.GL_SHININESS, Ns, 0);

但是蓝色的

fx.g.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, ambient, 0);
fx.g.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, diffuse, 0);
fx.g.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SPECULAR, specular, 0);
fx.g.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SHININESS, Ns, 0);

环境光/漫反射/镜面反射和 ns 具有相同的值。

知道为什么会这样吗?似乎 GL_FRONT 和 GL_BACK Material 都被完全忽略了,但是 GL_FRONT_AND_BACK 工作得很好,不确定它们是否是使用它的性能问题,或者这是否意味着我在其他地方有错误!

最佳答案

it seems both GL_FRONT and GL_BACK materials are completely ignored

Working as intended :

face: Specifies which face or faces are being updated. Must be GL_FRONT_AND_BACK.

关于android - OpenGL FRONT_AND_BACK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19082916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com