OpenGL新手问题:什么是背面剔除? [英] OpenGL newbie question: what is back face culling?

查看:111
本文介绍了OpenGL新手问题:什么是背面剔除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OpenGL中,背面剔除到底是什么?你能举一个具体的例子吗?一个三角形?

What exactly is back face culling in OpenGL? Can you give mi a specific example with e.g. one triangle?

推荐答案

如果仔细看,您可以在许多视频游戏中看到此示例.每当相机意外地在对象中移动物体时(通常是像字符一样的移动物体),请注意世界如何继续正确渲染.那是因为形成角色皮肤的三角形的背面没有被渲染;它们实际上是透明的.如果不是这种情况,那么每次相机不小心在一个对象内移动时,屏幕都会变黑(因为该对象的内部没有点亮),或者您会以一个奇异的视角看待对象的皮肤外观从内部.

If you look carefully you can see examples of this in a lot of video games. Any time the camera accidentally moves through an object - typically a moving object like a character - notice how the world continues to render correctly. That's because the back sides of the triangles that form the skin of the character are not rendered; they are effectively transparent. If this were not the case then every time the camera accidentally moved inside an object either the screen would go black (because the interior of the object is not lit) or you'd get a bizarre perspective on what the skin of the object looks like from the inside.

这篇关于OpenGL新手问题:什么是背面剔除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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