AFrame 文本组件不呈现 'logarithmicDepthBuffer=true'

AFrame Text component does not render with 'logarithmicDepthBuffer=true'

当我在 AFrame 渲染器组件中设置 logarithmicDepthBuffer: true; 时,text 组件的所有实例根本不再渲染。

为了解决这个问题,我从场景中删除了所有其他实体,文本仍然没有渲染。我还尝试使用包装的 <a-text> 组件,我尝试了 alphaTest: 0.5 ,设置 depthTest: true 并设置 sortObjects: false 只是为了看看我是否可以获得任何结果,但没有发现任何结果会产生任何结果。

<a-scene renderer="logarithmicDepthBuffer: true;">
    <a-text value="The quick Brown Fox Jumps over the Lazy Dog"></a-text>
</a-scene>

文本根本没有出现。控制台中没有渲染瑕疵或错误。

尝试在渲染器周围使用 []

<a-scene [renderer]="logarithmicDepthBuffer: true;">
    <a-text value="The quick Brown Fox Jumps over the Lazy Dog"></a-text>
</a-scene>

你应该在 AFrame github 上为此提出一个问题。我之前看到这个问题出现在其他人身上..

作为一种解决方法,我不知道 aframe 的具体细节,但是你可以在 material 上使用 .polygonOffset 作为文本来避免你试图用 logarithmicDepthBuffer 抵消的 zfighting 吗?

logarithmicDepthBuffer 是一项很酷的技术,但启用后,所有与深度交互的着色器都必须知道它,并且其中一些在编写时并没有考虑到它。

但如果您要修复 z-fighting,polygonOffset 是比较经典的解决方案之一。