ฉันกำลังพยายามเพิ่มรูปภาพในฉากของฉันโดย src ชี้ไปที่รายการใดรายการหนึ่งภายในแท็กทรัพย์สิน:
<a-assets>
<a-asset-item id="shoot" src="/assets/icons/shoot.png"></a-asset-item>
</a-assets>
...
<a-image src="#shoot"
position="0 0 -0.2"
scale="0.05 0.05 0.05"
material="alphaTest: 0.5"></a-image>
...
และฉันได้รับข้อผิดพลาดต่อไปนี้ในคอนโซล:
THREE.WebGLState: TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': Overload resolution failed.
at Object.texImage2D (aframe-master.js:27470)
at uploadTexture (aframe-master.js:28387)
at setTexture2D (aframe-master.js:27939)
at WebGLTextures.safeSetTexture2D (aframe-master.js:28819)
at SingleUniform.setValueT1 [as setValue] (aframe-master.js:23479)
at Function.WebGLUniforms.upload (aframe-master.js:23938)
at setProgram (aframe-master.js:32143)
at WebGLRenderer.renderBufferDirect (aframe-master.js:30878)
at renderObject (aframe-master.js:31625)
at renderObjects (aframe-master.js:31595)
at WebGLRenderer.render (aframe-master.js:31376)
at HTMLElement.render (aframe-master.js:79612)
at bound (aframe-master.js:83391)
at onAnimationFrame (aframe-master.js:31231)
at onAnimationFrame (aframe-master.js:21566)
ฉันได้ลองโหลดด้วยวิธีนี้แล้ว แต่มันก็ไม่ได้ผล:
<a-assets>
<a-asset-item id="shoot" src="/assets/icons/shoot.png"></a-asset-item>
</a-assets>
<a-image src="/assets/icons/shoot.png"
position="0 0 -0.2"
scale="0.05 0.05 0.05"
material="alphaTest: 0.5"></a-image>
แต่ถ้าฉันลบ a-asset-item มันก็ใช้งานได้:
<a-image src="/assets/icons/shoot.png"
position="0 0 -0.2"
scale="0.05 0.05 0.05"
material="alphaTest: 0.5"></a-image>
คุณช่วยแนะนำสิ่งที่ฉันทำผิดได้ไหม? มันเป็นข้อผิดพลาดหรือไม่?