我的A-frame球在远处观看时边缘呈锯齿状——为什么?

huangapple go评论49阅读模式
英文:

My A-frame Spheres have jagged edges when viewed from a distance - why

问题

我想在不同高度站在一个VR球体上,但当我在一个半径为2000米的球体上方500米时,我的球体边缘变得很不平滑。

故障页面显示问题

我的A-frame球在远处观看时边缘呈锯齿状——为什么?

我是A-frame和VR网页设计方面的新手。

我希望球体的边缘看起来是平滑的。我尝试过更改segmentsHeight和segmentsWidth,但似乎没有帮助。

我还尝试过<a-scene renderer="antialias: true">,但也没有帮助。

已知问题?有任何想法吗?

英文:

I want to stand above a VR sphere at various different heights but my sphere gets ugly jagged edges when I get 500m above a 2000m radius sphere.

glitch page showing the issue

我的A-frame球在远处观看时边缘呈锯齿状——为什么?

I am a complete novice in A-frame and VR web design.

I would expect the edge of the sphere to look smooth. I have tried changing the segmentsHeight and segmentsWidth but that does not seem to help.

I have also tried <a-scene renderer="antialias: true"> and that also does not seem to help.

Known issue ? Any Ideas?

答案1

得分: 1

Looks like z-buffer issues (check out this example), where faraway points have trouble sorting out the distance while using a linear buffer.

From the docs:
>A logarithmic depth buffer may provide better sorting and rendering in scenes containing very large differences of scale and distance.

You can enable it like this:

<a-scene renderer="logarithmicDepthBuffer: true"> </a-scene>
英文:

Looks like z-buffer issues (check out this example), where faraway points have trouble sorting out the distance while using a linear buffer.

From the docs:
>A logarithmic depth buffer may provide better sorting and rendering in scenes containing very large differences of scale and distance.

You can enable it like this:

<a-scene renderer="logarithmicDepthBuffer: true"> </a-scene>

答案2

得分: 0

<a-scene renderer="logarithmicDepthBuffer: true"> </a-scene>

<a-camera far="1000000"></a-camera>

<a-sky color="lightblue" radius="7000000"></a-sky>

英文:

So Piotr's answer to use logarithmicDepthBuffer is defintely the answer

<a-scene renderer="logarithmicDepthBuffer: true"> </a-scene>

But I want also leave a trail here for A-frame newbies trying to have very large objects - like earth size spheres!

You will want to change the value for the far parameter of your camera.
Objects beyond the far plane of the camera are not drawn and the far value defaults to 10,000. An earth sized sphere is 6,300,000m so you want to set your far value to the same sort of ball park as that. 1,000,000 worked for me because I am flying fairly close to the surface of my sphere.

     &lt;a-camera far=&quot;1000000&quot;&gt;
      &lt;/a-camera&gt;

Also - if you have a sky set - that will default to a sphere of 500m radius and if you draw a large sphere a long way away - a portion of it will poke out through the sky and you will only see a portion of your sphere. So make your sky have a large radius

&lt;a-sky color=&quot;lightblue&quot; radius=&quot;7000000&quot;&gt;&lt;/a-sky&gt; 

huangapple
  • 本文由 发表于 2023年4月19日 23:28:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76056314.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定