A-frame 0.9中的.gltf模型无法使用灯光(工作在0.8)

问题描述 投票:1回答:1

我正在导入一个画廊的.gltf模型,并添加环境和定向灯(尝试所有类型)。一切都按预期的0.8.0运行;但是,当使用0.9.0版时,模型的内部看起来很暗,没有灯光会影响它。我必须使用A-frame 0.9.0,因为它增加了对Oculus Go控制器的支持。我一直试图在整个上午解决这个问题,但似乎仍无法找到问题所在。

<html>
  <head>
    <meta charset="utf-8">
    <title>Hello, WebVR! • A-Frame</title>
    <meta name="description" content="Hello, WebVR! • A-Frame">
    <script src="https://aframe.io/releases/0.9.0/aframe.min.js"></script>

<!-- Changing the version to 0.8.0 eliminates the problem -->

    <script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
    <!--script src="https://dist.3d.io/3dio-js/1.2.x/3dio.min.js"></script-->
  </head>
  <body>
    <a-scene light="defaultLightsEnabled: false">
      <a-assets>
        <a-asset-item id="room" src="https://cdn.glitch.com/a8fe8e49-6e34-4c86-baec-05b8aff4571e%2Fscene.gltf?1555958013685"></a-asset-item>
        <a-asset-item id="gallery" src="https://cdn.glitch.com/a8fe8e49-6e34-4c86-baec-05b8aff4571e%2FGallery.fbx?1555957411386"></a-asset-item>
        <a-img id="sky" src="https://cdn.glitch.com/a8fe8e49-6e34-4c86-baec-05b8aff4571e%2F47096473752_0baa631c08_o.jpg?1555959294746"></a-img>
      </a-assets>

      <a-entity position="0 -0.1 0" rotation="90 0 0" scale="50 50 1" geometry="primitive:plane"></a-entity>

      <a-entity gltf-model="#room" scale="0.01 0.01 0.01" position="0 0.01" shadow="cast:true; receive:true;">
      </a-entity>
      <a-entity position="0.59272 4.10082 -0.40143" light="intensity:5;type:hemisphere"></a-entity>
      <a-entity position="0 1.15538 -3.77451" light="intensity:3"></a-entity>

      <a-sky src="#sky"></a-sky>


    </a-scene>
  </body>
</html>
aframe virtual-reality gltf
1个回答
0
投票

该模型使用KHR_materials_unlit glTF扩展,使其不受光照影响。未点亮 - 或无阴影 - 材料用于在移动设备上获得更好的性能,以及一些风格化的效果。

在其他查看器中打开相同的模型,您将看到相同的结果:

https://gltf-viewer.donmccurdy.com/#model=https://cdn.glitch.com/a8fe8e49-6e34-4c86-baec-05b8aff4571e/scene.gltf?1555958013685

^单击左下方的信息按钮以查看模型使用的扩展列表。

我想也许A-Frame 0.8.0还没有支持这个扩展?

© www.soinside.com 2019 - 2024. All rights reserved.