OpenGL深度排序 [英] OpenGL depth sorting
问题描述
我正在使用深度排序进行基本的对象透明化.作为深度,我使用从相机到模型三角形每个中心的距离(平方),我将其计算为{(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屋!