index.wxml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <xr-scene id="xr-scene" bind:ready="handleReady" bind:tick="handleTick">
  2. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  3. <xr-asset-load
  4. type="env-data" asset-id="env1" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/env-test.bin"
  5. />
  6. <xr-asset-load type="gltf" asset-id="night_car_landscape" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/night_car_landscape.glb" />
  7. <xr-asset-load type="gltf" asset-id="bedroom" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/bedroom.glb" />
  8. </xr-assets>
  9. <xr-env env-data="{{env}}" />
  10. <xr-node>
  11. <xr-node node-id="camera-target" position="0 0 0"></xr-node>
  12. <xr-node layer="1">
  13. <xr-asset-post-process asset-id="bloom1" type="bloom" is-hdr data="radius: {{bloomRadius_0}}, intensity: {{bloomIntensity}}, threshold: {{bloomThreshold}}, softThreshold: 0.8"/>
  14. <xr-asset-post-process asset-id="bloom2" type="bloom" is-hdr data="radius: {{bloomRadius_1}}, intensity: {{bloomIntensity}}, threshold: {{bloomThreshold}}, softThreshold: 0.8"/>
  15. <xr-gltf node-id="gltf_1" position="0 0 0" rotation="0 0 0" scale="0.01 0.01 0.01" model="night_car_landscape"></xr-gltf>
  16. </xr-node>
  17. <xr-node layer="2">
  18. <xr-asset-post-process asset-id="blur" type="blur" data="radius: {{blurRadius}}"/>
  19. <xr-asset-post-process asset-id="vignette" type="vignette" data="color:1 0 0 1,intensity:{{vignetteIntensity}},smoothness:{{vignetteSmoothness}},roundness:{{vignetteRoundness}}"/>
  20. <xr-gltf node-id="gltf_2" position="0.5 -1 -2" rotation="0 0 0" scale="1 1 1" model="bedroom"></xr-gltf>
  21. </xr-node>
  22. <xr-node layer="3">
  23. <!-- xr-basic -->
  24. <xr-asset-post-process asset-id="fxaa" type="fxaa"/>
  25. <xr-asset-material asset-id="standard-mat" effect="standard" />
  26. <xr-mesh node-id="mesh-plane" position="0 -0.02 -4" rotation="0 0 0" scale="5 1 5" geometry="plane" material="standard-mat" uniforms="u_baseColorFactor:0.48 0.78 0.64 1" receive-shadow></xr-mesh>
  27. <xr-mesh id="cube" node-id="mesh-cube" position="-1 0.5 -3.5" scale="1 1 1" rotation="0 45 0" geometry="cube" material="standard-mat" uniforms="u_baseColorFactor:0.298 0.764 0.85 1" cast-shadow></xr-mesh>
  28. <xr-mesh node-id="mesh-sphere" position="0 1.25 -5" scale="1.25 1.25 1.25" geometry="sphere" material="standard-mat" uniforms="u_baseColorFactor:0.937 0.176 0.368 1" cast-shadow></xr-mesh>
  29. <xr-mesh node-id="mesh-cylinder" position="1 0.7 -3.5" scale="1 0.7 1" geometry="cylinder" material="standard-mat" uniforms="u_baseColorFactor:1 0.776 0.364 1" cast-shadow></xr-mesh>
  30. </xr-node>
  31. <xr-camera
  32. id="camera" node-id="camera" position="0 0 {{cameraPosition}}" clear-color="{{clearColor}}"
  33. near="0.1"
  34. far="2000"
  35. target="{{cameraTarget}}" background="{{background}}" camera-orbit-control=""
  36. cull-mask="{{cullMask}}"
  37. post-process="{{pp}}"
  38. ></xr-camera>
  39. </xr-node>
  40. <xr-node node-id="lights">
  41. <xr-light type="ambient" color="1 1 1" intensity="{{aIntensity}}" />
  42. <xr-light type="directional" rotation="40 180 0" color="1 1 1" intensity="{{dIntensity}}" />
  43. </xr-node>
  44. </xr-scene>