在OpenGL中平滑脸部边缘的技术 [英] Techniques to smooth face edges in OpenGL

查看:142
本文介绍了在OpenGL中平滑脸部边缘的技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用人脸法线在OpenGL中点燃人体模型时,每个人脸在模型上的位置非常明显.使用顶点法线可以使照明变得更加平滑,但仍然引人注目.是否有任何技术可以平滑有机模型而无需添加其他顶点(例如细分)?

When I light my human model in OpenGL using face normals it is very apparent where each face is on the model. The lighting becomes considerably smoother using vertex normals but still noticeable. Is there any technique available to smooth organic models without adding additional vertices (ex. subdivisions)?

推荐答案

如果您看到具有每个顶点法线的单个面,则可能忘记了启用平滑面:

If you are seeing single faces with per vertex normals you might have forgotten to enable smooth facing:

glShadeModel(GL_SMOOTH);

如果这没有帮助,请确保所有具有相同位置的顶点也具有相同的法线.但是,这应该由Blender自动完成.您的模型也可能有太多的多边形.如果是这种情况,您要么必须使用更多的多边形,要么要做basszero所说的. 创建法线地图并将其与GLSL着色器一起使用.

If that's not helping make sure all vertices with the same position also have the same normal. This should be done by blender automatically however. It's also possible that your model has just too few polygons. If that's the case you either have to use more polygons or do what basszero said. Create a normal map and use that together with a GLSL shader.

这篇关于在OpenGL中平滑脸部边缘的技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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