OpenGL深度排序 [英] OpenGL depth sorting

查看:139
本文介绍了OpenGL深度排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用深度排序进行基本的对象透明化.作为深度,我使用从相机到模型三角形每个中心的距离(平方),我将其计算为{(x1 + x2 + x3)/3,(y1 + y2 + y3)/3,(z1 + z2 + z3)/3}.尽管结果几乎可以,但是仍然存在一些错误.

I'm doing basic object transparency using depth sort. As depth i use distance (squared) from camera to every center of model's triangles, which i calculate as {(x1+x2+x3)/3, (y1+y2+y3)/3, (z1+z2+z3)/3}. Although result is almost fine, but there are some mistakes.

没有分类的猴子头

具有排序

我可以针对这些错误采取任何措施吗?

Is there anything i can do about those errors?

推荐答案

没有办法以完美的方式对三角形进行排序.查看opengl.org Wiki上透明度排序文章末尾的示例.

There is no way to sort the triangles in a perfect way. Look at the examples at end of the Transparency Sorting article on opengl.org wiki.

@kos: 看看具有双深度剥离功能的订单独立透明性覆盖的Alpha .

@kos: Give a look at Order Independent Transparency with Dual Depth Peeling and Alpha to Coverage.

这篇关于OpenGL深度排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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