index.wxml 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. <xr-scene id="xr-scene" bind:ready="handleReady">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load
  4. type="video-texture" asset-id="test2"
  5. src="https://h5-project.oss-cn-shenzhen.aliyuncs.com/XR/test2.mp4" options="autoPlay:true,loop:true"
  6. />
  7. <xr-asset-material asset-id="removeBlack-mat" effect="removeBlack" />
  8. </xr-assets>
  9. <xr-node>
  10. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  11. <xr-node wx:if="{{loaded}}">
  12. <xr-mesh node-id="floor-plane" position="0 -1 0" rotation="0 0 0" scale="10 1 10" geometry="plane"
  13. uniforms="u_baseColorFactor:1 1 1 1"
  14. ></xr-mesh>
  15. <xr-mesh node-id="video-item" position="0 0 0" rotation="90 0 0" scale="2 2 2" geometry="plane"
  16. material="removeBlack-mat"
  17. uniforms="u_videoMap: video-test2"
  18. states="renderQueue:2500"
  19. ></xr-mesh>
  20. </xr-node>
  21. <xr-camera
  22. id="camera" node-id="camera" position="2 2 4" clear-color="0.925 0.925 0.925 1"
  23. target="camera-target"
  24. camera-orbit-control=""
  25. ></xr-camera>
  26. </xr-node>
  27. <xr-node node-id="lights">
  28. <xr-light type="ambient" color="1 1 1" intensity="1" />
  29. <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="3" cast-shadow/>
  30. </xr-node>
  31. </xr-scene>