OpenGL 中平滑面边缘的技术

发布于 2024-07-24 04:48:06 字数 109 浏览 5 评论 0原文

当我在 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)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温馨耳语 2024-07-31 04:48:06

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

glShadeModel(GL_SMOOTH);

如果这无助于确保具有相同位置的所有顶点也具有相同的法线。 然而,这应该由搅拌机自动完成。 您的模型也可能具有太少的多边形。 如果是这种情况,您要么必须使用更多多边形,要么按照 basszero 所说的操作。 创建法线贴图< /a> 并将其与 GLSL 着色器一起使用。

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

glShadeModel(GL_SMOOTH);

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.

追星践月 2024-07-31 04:48:06

如果您可以访问更高分辨率的模型/网格,或者可能有一个不错的 3D 建模工具,可以创建通过细分或其他奇特方法的高分辨率模型...

GLSL 每像素照明 + 法线贴图

更新:

http://www.blender.org/development/release-logs/blender-246/render-baking/

If you've got access to a higher resolution model/mesh or perhaps a decent 3d modeling tool that can create a highres model via subdivisions or other fancy methods...

GLSL per-pixel-lighting + normal maps

UPDATE:

http://www.blender.org/development/release-logs/blender-246/render-baking/

半﹌身腐败 2024-07-31 04:48:06

是的,有很多不同的技术。 一种是首先计算每个面的法线(您可能正在将其用于面中的顶点),然后使用这些法线计算每个顶点的新法线。

这是一个,您可以在其中计算五个相邻三角形的平均值。

干杯!

Yes there are many different techniques. One is to first calculate a normal for each face (which you probably are using for the vertices in the face) and use these normals to calculate new normals for each vertex.

Here's one where you calculate the average of five adjacent triangles.

Cheers !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文