问题描述
AFrame 性能文档(
网格(左侧)有阴影,而框(右侧)是平面阴影.如何将网格设置为使用平面着色?
根据来自@WestLangley 的线索,此代码有效:
<头><meta charset="utf-8"><script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>头部><身体><a-scene background="color: #000000"><!-- Box.gltf 来自 https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/Box/glTF --><a-gltf-model id="gltf" src="Box.gltf" position="-1 1 -2"></a-gltf-model><a-box position="1 1 -2" material="shader: flat; color: red"></a-box></a-scene><脚本>var office = document.getElementById('gltf');office.addEventListener('object3dset', () => {const mesh = office.getObject3D('mesh');mesh.children[0].material = new THREE.MeshBasicMaterial({map: mesh.children[0].material.map});});