处理布料相互作用的非常接近的顶点(闪烁孔行为)

Handling very close vertices of cloth cloth interaction (twinkling holes behavior)

我的场景中有三个不同的 OBJ,一个 body,以及在 body 上模拟的衬衫和裤子(按此顺序渲染)。

在我的测试 android 设备上,渲染在某些点以某些 'holes' 的形式在裤子外面显示内衬衬衫,而在台式机上工作正常。

我猜有些点彼此非常接近,因此尝试了 highp 以提高精度,它开始在我的一些设备上正常工作(令人惊讶的是它在一年前的 Nexus 上不起作用!)

问。我是否确定了正确的问题,或者也可能是由于任何其他可能的原因。有什么办法可以在所有设备上解决这个问题吗?

问。我能否以某种方式至少了解哪些 GPU 会出现此问题,以便我可以相应地定位我的 APK?

使用:

Android 5.0

OpenGL ES 3.0


编辑:

为了以防万一,旋转场景或缩放时 in-out,这些孔显示 'twinkling behavior'。

highp 支持不是强制性的,而且 AFAICT 它也不是 'extension',所以你不能查询它并且对它的支持也没有记录在像 [=12 这样的 GLES 能力数据库中=]

您可以使用 glGetShaderPrecisionFormat ( http://docs.gl/es3/glGetShaderPrecisionFormat )

查询着色器的精度

当然,实际需要的实际精度取决于您的应用程序。而且这是运行时的,没办法提前知道。

好的,看来我已经解决了这个问题。

我引用 opengl archives :

12.040 Depth buffering seems to work, but polygons seem to bleed through polygons that are in front of them. What's going on?

You may have configured your zNear and zFar clipping planes in a way that severely limits your depth buffer precision. Generally, this is caused by a zNear clipping plane value that's too close to 0.0. As the zNear clipping plane is set increasingly closer to 0.0, the effective precision of the depth buffer decreases dramatically. Moving the zFar clipping plane further away from the eye always has a negative impact on depth buffer precision, but it's not one as dramatic as moving the zNear clipping plane.

同一页面有很多关于边界框和相关问题的详细信息。读得真好。

我有一个巨大的 BB。我缩小了尺寸并将相机移近了物体,所有设备的问题都解决了。