freeTvtStack.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <loading useResourceManager />
  3. <TresCanvas v-bind="tcConfig"
  4. ><TresPerspectiveCamera :position="[-9.77, 42.01, -41.41]" :fov="75" :aspect="1" :near="0.01" :far="10000" />
  5. <OrbitControls makeDefault :target="new THREE.Vector3(-4.25, -9.78, -13.23)" />
  6. <TresAmbientLight :color="0xffffff" :intensity="0.5" />
  7. <viewportGizmo v-bind="viewportConfig" />
  8. <floor :fState="fState" :gridState="gridState" />
  9. <skylight v-bind="sState" />
  10. <extendMeshes v-if="Resource.hasAllFinished.value" />
  11. <tresProcessing :postProcessing="pState" />
  12. </TresCanvas>
  13. </template>
  14. <script setup lang="ts">
  15. import * as THREE from 'three'
  16. import { OrbitControls } from '@tresjs/cientos'
  17. import { viewportGizmo } from 'PLS/useViewportGizmo'
  18. import { Resource } from 'PLS/resourceManager'
  19. import { yangyangLoading as loading } from 'PLS/UIdemo'
  20. import floor from '../components/freeTvtStack/floor.vue'
  21. import skylight from '../components/freeTvtStack/skylight.vue'
  22. import tresProcessing from '../components/freeTvtStack/tresProcessing.vue'
  23. import extendMeshes from '../components/freeTvtStack/extendMeshes.vue'
  24. const fState = { color: '#FFFFFF', shadowColor: '#b8b59e', receiveShadow: true, edge: 0.35, scale: 9.27 }
  25. const gridState = {
  26. cellSize: 1.24,
  27. cellThickness: 0.62,
  28. cellColor: '#CDCACA',
  29. sectionColor: '#AEAEAE',
  30. sectionSize: 5,
  31. sectionThickness: 1.26,
  32. fadeDistance: 69,
  33. fadeStrength: 1,
  34. infiniteGrid: true,
  35. }
  36. const sState = { curTime: 8, direct: 0.1, intensity: 0.9, shadowIntensity: 0.31 }
  37. const pState = {
  38. isOpenList: { Bloom: false, chromaticAberration: false },
  39. configList: {
  40. Bloom: { radius: 0.85, intensity: 4, 'luminance-threshold': 0.1, 'luminance-smoothing': 0.3, 'mipmap-blur': false },
  41. chromaticAberration: { offsetX: 0.02, offsetY: 0.01, radialModulation: true, modulationOffset: 0.22 },
  42. },
  43. }
  44. const tcConfig = {
  45. clearColor: '#201919',
  46. windowSize: true,
  47. shadows: true,
  48. toneMapping: THREE.NoToneMapping,
  49. toneMappingExposure: 1,
  50. shadowMapType: THREE.PCFSoftShadowMap,
  51. }
  52. const viewportConfig = {
  53. size: 100,
  54. lineWidth: 2,
  55. type: 'sphere',
  56. placement: 'bottom-right',
  57. offset: {
  58. right: 10,
  59. },
  60. }
  61. Resource.hasAllFinished.value = true
  62. </script>