alvarosabu пре 1 година
родитељ
комит
1429905e25
30 измењених фајлова са 107 додато и 734 уклоњено
  1. 2 3
      docs/.vitepress/theme/components/BlenderCube.vue
  2. 6 6
      docs/.vitepress/theme/components/GraphPane.vue
  3. 1 4
      docs/.vitepress/theme/components/OnDemandRendering.vue
  4. 3 4
      docs/.vitepress/theme/components/RenderingLogger.vue
  5. 2 2
      docs/.vitepress/theme/composables/state.ts
  6. 2 7
      docs/advanced/performance.md
  7. 2 3
      playground/src/components/AkuAku.vue
  8. 2 3
      playground/src/components/BlenderCube.vue
  9. 4 5
      playground/src/components/DynamicModel.vue
  10. 6 6
      playground/src/components/GraphPane.vue
  11. 3 4
      playground/src/components/RenderingLogger.vue
  12. 2 2
      playground/src/composables/state.ts
  13. 2 22
      playground/src/pages/basic/Multiple.vue
  14. 14 8
      playground/src/pages/basic/PiercedProps.vue
  15. 10 10
      playground/src/pages/basic/Primitives.vue
  16. 1 2
      playground/src/pages/cameras/index.vue
  17. 5 5
      playground/src/pages/index.vue
  18. 2 10
      playground/src/pages/models/PrimitivesModel.vue
  19. 1 4
      playground/src/pages/perf/OnDemand.vue
  20. 1 1
      playground/src/router/routes/basic.ts
  21. 1 1
      playground/src/router/routes/cameras.ts
  22. 1 1
      playground/src/router/routes/events.ts
  23. 1 1
      playground/src/router/routes/index.ts
  24. 1 1
      playground/src/router/routes/misc.ts
  25. 1 1
      playground/src/router/routes/models.ts
  26. 1 1
      playground/src/router/routes/performance.ts
  27. 19 601
      pnpm-lock.yaml
  28. 1 6
      src/composables/useRenderer/index.ts
  29. 9 9
      src/core/nodeOpts.test.ts
  30. 1 1
      src/types/index.ts

+ 2 - 3
docs/.vitepress/theme/components/BlenderCube.vue

@@ -2,8 +2,7 @@
 import { useTresContext } from '@tresjs/core'
 import { useTresContext } from '@tresjs/core'
 import { useGLTF } from '@tresjs/cientos'
 import { useGLTF } from '@tresjs/cientos'
 
 
-const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', 
-  { draco: true })
+const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', { draco: true })
 const model = nodes.Cube
 const model = nodes.Cube
 
 
 model.position.set(0, 1, 0)
 model.position.set(0, 1, 0)
@@ -15,4 +14,4 @@ state.invalidate()
 
 
 <template>
 <template>
   <primitive :object="model" />
   <primitive :object="model" />
-</template>
+</template>

+ 6 - 6
docs/.vitepress/theme/components/GraphPane.vue

@@ -56,11 +56,11 @@ useRafFn(({ timestamp }) => {
       bg-white
       bg-white
       dark:bg-dark
       dark:bg-dark
       shadow-xl
       shadow-xl
-      rounded 
-      border-4 
-      border-solid 
-      bg-primary 
-      border-primary 
+      rounded
+      border-4
+      border-solid
+      bg-primary
+      border-primary
       pointer-events-none
       pointer-events-none
       overflow-hidden"
       overflow-hidden"
   >
   >
@@ -98,4 +98,4 @@ useRafFn(({ timestamp }) => {
       </svg>
       </svg>
     </div>
     </div>
   </div>
   </div>
-</template>
+</template>

+ 1 - 4
docs/.vitepress/theme/components/OnDemandRendering.vue

@@ -1,7 +1,5 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { TresCanvas } from '@tresjs/core'
 import { TresCanvas } from '@tresjs/core'
-import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
-import { OrbitControls } from '@tresjs/cientos'
 import { useState } from '../composables/state'
 import { useState } from '../composables/state'
 import BlenderCube from './BlenderCube.vue'
 import BlenderCube from './BlenderCube.vue'
 import GraphPane from './GraphPane.vue'
 import GraphPane from './GraphPane.vue'
@@ -11,7 +9,6 @@ const { renderingTimes } = useState()
 
 
 function onRender() {
 function onRender() {
   renderingTimes.value = 1
   renderingTimes.value = 1
-
 }
 }
 </script>
 </script>
 
 
@@ -37,4 +34,4 @@ function onRender() {
       :intensity="0.7"
       :intensity="0.7"
     />
     />
   </TresCanvas>
   </TresCanvas>
-</template>
+</template>

+ 3 - 4
docs/.vitepress/theme/components/RenderingLogger.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { useRenderLoop, useTresContext } from '@tresjs/core'
+import { useTresContext } from '@tresjs/core'
 import { OrbitControls } from '@tresjs/cientos'
 import { OrbitControls } from '@tresjs/cientos'
 import { onMounted } from 'vue'
 import { onMounted } from 'vue'
-import { useState } from '../composables/state'
 
 
-const { renderingTimes } = useState()
+/* const { renderingTimes } = useState() */
 
 
 const state = useTresContext()
 const state = useTresContext()
 
 
@@ -21,4 +20,4 @@ onMounted(() => {
   <OrbitControls
   <OrbitControls
     @change="manualInvalidate"
     @change="manualInvalidate"
   />
   />
-</template>
+</template>

+ 2 - 2
docs/.vitepress/theme/composables/state.ts

@@ -6,6 +6,6 @@ const state = reactive({
 export function useState() {
 export function useState() {
   return {
   return {
     ...toRefs(state),
     ...toRefs(state),
-    
+
   }
   }
-}
+}

+ 2 - 7
docs/advanced/performance.md

@@ -6,7 +6,7 @@ We are running WebGL on the browser, which can be quite expensive and it will de
 
 
 ## On-demand rendering <Badge type="tip" text="^4.0.0" />
 ## On-demand rendering <Badge type="tip" text="^4.0.0" />
 
 
-By default, Tres.js will render your scene on every frame. This is great for most applications, but if you are building a game or a complex application, you might want to control when the scene is rendered. 
+By default, Tres.js will render your scene on every frame. This is great for most applications, but if you are building a game or a complex application, you might want to control when the scene is rendered.
 
 
 Otherwise it might drain your device battery 🔋 🔜 🪫 and make your computer sound like an airplane 🛫.
 Otherwise it might drain your device battery 🔋 🔜 🪫 and make your computer sound like an airplane 🛫.
 
 
@@ -14,7 +14,6 @@ Ideally, you only want to **render the scene when necessary**, for example when
 
 
 You can do that by setting the `renderMode` prop to `on-demand` or `manual`:
 You can do that by setting the `renderMode` prop to `on-demand` or `manual`:
 
 
-
 ### Mode `on-demand`
 ### Mode `on-demand`
 
 
 <ClientOnly>
 <ClientOnly>
@@ -23,7 +22,6 @@ You can do that by setting the `renderMode` prop to `on-demand` or `manual`:
   </div>
   </div>
 </ClientOnly>
 </ClientOnly>
 
 
-
 ```vue
 ```vue
 <TresCanvas render-mode="on-demand">
 <TresCanvas render-mode="on-demand">
   <!-- Your scene goes here -->
   <!-- Your scene goes here -->
@@ -61,7 +59,6 @@ setTimeout(() => {
 
 
 Since it is not really possible to observe all the possible changes in your application, you can also manually invalidate the frame by calling the `invalidate()` method from the [`useTresContext` composable](../api/composables.md#usetrescontext):
 Since it is not really possible to observe all the possible changes in your application, you can also manually invalidate the frame by calling the `invalidate()` method from the [`useTresContext` composable](../api/composables.md#usetrescontext):
 
 
-
 ::: code-group
 ::: code-group
 
 
 ```vue [App.vue]
 ```vue [App.vue]
@@ -102,11 +99,10 @@ watch(boxRef.value, () => {
 
 
 :::
 :::
 
 
-### Mode `always` 
+### Mode `always`
 
 
 In this rendering mode, Tres will continously render the scene on every frame. This is the default mode and the easiest to use, but it's also the most resource expensive one.
 In this rendering mode, Tres will continously render the scene on every frame. This is the default mode and the easiest to use, but it's also the most resource expensive one.
 
 
-
 ### Mode `manual`
 ### Mode `manual`
 
 
 If you want to have full control of when the scene is rendered, you can set the `render-mode` prop to `manual`:
 If you want to have full control of when the scene is rendered, you can set the `render-mode` prop to `manual`:
@@ -128,4 +124,3 @@ const { advance } = useTres()
 advance()
 advance()
 </script>
 </script>
 ```
 ```
-

+ 2 - 3
playground/src/components/AkuAku.vue

@@ -2,8 +2,7 @@
 import { useTresContext } from '@tresjs/core'
 import { useTresContext } from '@tresjs/core'
 import { useGLTF } from '@tresjs/cientos'
 import { useGLTF } from '@tresjs/cientos'
 
 
-const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/AkuAku.glb', 
-  { draco: true })
+const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/AkuAku.glb', { draco: true })
 const model = nodes.Cube
 const model = nodes.Cube
 
 
 model.position.set(0, 1, 0)
 model.position.set(0, 1, 0)
@@ -15,4 +14,4 @@ state.invalidate()
 
 
 <template>
 <template>
   <primitive :object="model" />
   <primitive :object="model" />
-</template>
+</template>

+ 2 - 3
playground/src/components/BlenderCube.vue

@@ -2,8 +2,7 @@
 import { useTresContext } from '@tresjs/core'
 import { useTresContext } from '@tresjs/core'
 import { useGLTF } from '@tresjs/cientos'
 import { useGLTF } from '@tresjs/cientos'
 
 
-const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', 
-  { draco: true })
+const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', { draco: true })
 const model = nodes.Cube
 const model = nodes.Cube
 
 
 model.position.set(0, 1, 0)
 model.position.set(0, 1, 0)
@@ -15,4 +14,4 @@ state.invalidate()
 
 
 <template>
 <template>
   <primitive :object="model" />
   <primitive :object="model" />
-</template>
+</template>

+ 4 - 5
playground/src/components/DynamicModel.vue

@@ -2,11 +2,10 @@
 import { useControls } from '@tresjs/leches'
 import { useControls } from '@tresjs/leches'
 import { useGLTF } from '@tresjs/cientos'
 import { useGLTF } from '@tresjs/cientos'
 
 
-const { nodes } 
-  = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', 
-    { draco: true })
+const { nodes }
+  = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb', { draco: true })
 
 
-const { scene: AkuAku, nodes: akukuNodes } = await useGLTF(
+const { scene: AkuAku } = await useGLTF(
   'https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/aku-aku/AkuAku.gltf',
   'https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/aku-aku/AkuAku.gltf',
   { draco: true },
   { draco: true },
 )
 )
@@ -20,4 +19,4 @@ const model = computed(() => isCube.value ? nodes.Cube : AkuAku)
 
 
 <template>
 <template>
   <primitive :object="model" />
   <primitive :object="model" />
-</template>
+</template>

+ 6 - 6
playground/src/components/GraphPane.vue

@@ -56,11 +56,11 @@ useRafFn(({ timestamp }) => {
       bg-white
       bg-white
       dark:bg-dark
       dark:bg-dark
       shadow-xl
       shadow-xl
-      rounded 
-      border-4 
-      border-solid 
-      bg-primary 
-      border-primary 
+      rounded
+      border-4
+      border-solid
+      bg-primary
+      border-primary
       pointer-events-none
       pointer-events-none
       overflow-hidden"
       overflow-hidden"
   >
   >
@@ -98,4 +98,4 @@ useRafFn(({ timestamp }) => {
       </svg>
       </svg>
     </div>
     </div>
   </div>
   </div>
-</template>
+</template>

+ 3 - 4
playground/src/components/RenderingLogger.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { useRenderLoop, useTresContext } from '@tresjs/core'
+import { useTresContext } from '@tresjs/core'
 import { OrbitControls } from '@tresjs/cientos'
 import { OrbitControls } from '@tresjs/cientos'
 import { onMounted } from 'vue'
 import { onMounted } from 'vue'
-import { useState } from '../composables/state'
 
 
-const { renderingTimes } = useState()
+/* const { renderingTimes } = useState() */
 
 
 const state = useTresContext()
 const state = useTresContext()
 
 
@@ -21,4 +20,4 @@ onMounted(() => {
   <OrbitControls
   <OrbitControls
     @change="manualInvalidate"
     @change="manualInvalidate"
   />
   />
-</template>
+</template>

+ 2 - 2
playground/src/composables/state.ts

@@ -6,6 +6,6 @@ const state = reactive({
 export function useState() {
 export function useState() {
   return {
   return {
     ...toRefs(state),
     ...toRefs(state),
-    
+
   }
   }
-}
+}

+ 2 - 22
playground/src/pages/basic/Multiple.vue

@@ -1,30 +1,10 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { TresCanvas, useRenderLoop } from '@tresjs/core'
-import { reactive, shallowRef, ref } from 'vue'
-import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
-import { OrbitControls } from '@tresjs/cientos'
-
-const state = reactive({
-  clearColor: '#82DBC5',
-  shadows: true,
-  alpha: false,
-  shadowMapType: BasicShadowMap,
-  outputColorSpace: SRGBColorSpace,
-  toneMapping: NoToneMapping,
-})
-
-const { onLoop } = useRenderLoop()
+import { TresCanvas } from '@tresjs/core'
+import { ref, shallowRef } from 'vue'
 
 
 const boxRef = shallowRef(null)
 const boxRef = shallowRef(null)
 const showBox = ref(true)
 const showBox = ref(true)
 
 
-/* onLoop(({ elapsed }) => {
-  if (boxRef.value) {
-    boxRef.value.rotation.y = elapsed
-    boxRef.value.rotation.z = elapsed
-  }
-}) */
-
 setInterval(() => {
 setInterval(() => {
   showBox.value = !showBox.value
   showBox.value = !showBox.value
 }, 3000)
 }, 3000)

+ 14 - 8
playground/src/pages/basic/PiercedProps.vue

@@ -15,12 +15,18 @@ const label = shallowRef('')
 
 
 const refs = [x, y, z, rx, ry, rz, sx, sy, sz]
 const refs = [x, y, z, rx, ry, rz, sx, sy, sz]
 const labels = [
 const labels = [
-  'position-x', 'position-y', 'position-z', 
-  'rotation-x', 'rotation-y', 'rotation-z', 
-  'scale-x', 'scale-y', 'scale-z',
+  'position-x',
+  'position-y',
+  'position-z',
+  'rotation-x',
+  'rotation-y',
+  'rotation-z',
+  'scale-x',
+  'scale-y',
+  'scale-z',
 ]
 ]
 
 
-const PI2 = Math.PI * 2
+/* const PI2 = Math.PI * 2 */
 
 
 useRenderLoop().onLoop(({ elapsed }) => {
 useRenderLoop().onLoop(({ elapsed }) => {
   const i = Math.floor(elapsed % refs.length)
   const i = Math.floor(elapsed % refs.length)
@@ -54,8 +60,8 @@ useRenderLoop().onLoop(({ elapsed }) => {
 
 
 <style>
 <style>
 .overlay {
 .overlay {
-    position: fixed;
-    padding: 10px;
-    font-family: sans-serif;
+  position: fixed;
+  padding: 10px;
+  font-family: sans-serif;
 }
 }
-</style>
+</style>

+ 10 - 10
playground/src/pages/basic/Primitives.vue

@@ -1,16 +1,16 @@
+<!-- eslint-disable no-console -->
 <script setup lang="ts">
 <script setup lang="ts">
 import { ref, watchEffect } from 'vue'
 import { ref, watchEffect } from 'vue'
-import { 
+import {
   BasicShadowMap,
   BasicShadowMap,
-  SRGBColorSpace,
-  NoToneMapping,
+  Group,
   Mesh,
   Mesh,
-  TorusGeometry,
   MeshToonMaterial,
   MeshToonMaterial,
+  NoToneMapping,
+  SRGBColorSpace,
+  SphereGeometry,
+  TorusGeometry,
   TorusKnotGeometry,
   TorusKnotGeometry,
-  PlaneGeometry,
-  Group,
-  SphereGeometry, 
 } from 'three'
 } from 'three'
 import { TresCanvas, useRenderLoop } from '@tresjs/core'
 import { TresCanvas, useRenderLoop } from '@tresjs/core'
 import { OrbitControls } from '@tresjs/cientos'
 import { OrbitControls } from '@tresjs/cientos'
@@ -74,7 +74,7 @@ secondGroup.add(sphere)
 
 
 const primitiveRef = ref()
 const primitiveRef = ref()
 
 
-useRenderLoop().onLoop(() => {  
+useRenderLoop().onLoop(() => {
   if (primitiveRef.value) {
   if (primitiveRef.value) {
     primitiveRef.value.rotation.x += 0.01
     primitiveRef.value.rotation.x += 0.01
     primitiveRef.value.rotation.y += 0.01
     primitiveRef.value.rotation.y += 0.01
@@ -85,14 +85,14 @@ watchEffect(() => {
   console.log('primitiveRef.value', primitiveRef.value)
   console.log('primitiveRef.value', primitiveRef.value)
 })
 })
 
 
-const reactivePrimitiveRef = ref(new Mesh(
+/* const reactivePrimitiveRef = ref(new Mesh(
   new TorusKnotGeometry(1, 0.5, 100, 16),
   new TorusKnotGeometry(1, 0.5, 100, 16),
   new MeshToonMaterial({
   new MeshToonMaterial({
     color: 'orange',
     color: 'orange',
   }),
   }),
 ))
 ))
 
 
-const modelArray = ref([torus, torusKnot, sphere])
+const modelArray = ref([torus, torusKnot, sphere]) */
 </script>
 </script>
 
 
 <template>
 <template>

+ 1 - 2
playground/src/pages/cameras/index.vue

@@ -32,8 +32,7 @@ const { cameraType, manual } = useControls({
     }, {
     }, {
       text: 'Orthographic',
       text: 'Orthographic',
       value: 'orthographic',
       value: 'orthographic',
-    },
-    ],
+    }],
     value: state.cameraType,
     value: state.cameraType,
   },
   },
   manual: false,
   manual: false,

+ 5 - 5
playground/src/pages/index.vue

@@ -1,11 +1,11 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import {
 import {
   basicRoutes,
   basicRoutes,
-  perfRoutes,
-  eventsRoutes,
   cameraRoutes,
   cameraRoutes,
-  modelsRoutes,
+  eventsRoutes,
   miscRoutes,
   miscRoutes,
+  modelsRoutes,
+  perfRoutes,
 } from '../router/routes'
 } from '../router/routes'
 
 
 const sections = [
 const sections = [
@@ -23,7 +23,7 @@ const sections = [
     class="
     class="
   container mx-auto max-w-3xl
   container mx-auto max-w-3xl
   font-sans text-xs color-gray
   font-sans text-xs color-gray
-  bg-white 
+  bg-white
   "
   "
   >
   >
     <div class="mx-4">
     <div class="mx-4">
@@ -38,7 +38,7 @@ const sections = [
             src="/logo.svg"
             src="/logo.svg"
             alt="TresJS logo"
             alt="TresJS logo"
             class="max-w-24 sm:max-w-48 align-baseline"
             class="max-w-24 sm:max-w-48 align-baseline"
-          >
+          />
         </div>
         </div>
         <div class="sm:w-2/3">
         <div class="sm:w-2/3">
           <h1
           <h1

+ 2 - 10
playground/src/pages/models/PrimitivesModel.vue

@@ -1,16 +1,8 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { ref, watchEffect } from 'vue'
-import { 
+import {
   BasicShadowMap,
   BasicShadowMap,
-  SRGBColorSpace,
   NoToneMapping,
   NoToneMapping,
-  Mesh,
-  TorusGeometry,
-  MeshToonMaterial,
-  TorusKnotGeometry,
-  PlaneGeometry,
-  Group,
-  SphereGeometry, 
+  SRGBColorSpace,
 } from 'three'
 } from 'three'
 import { TresCanvas } from '@tresjs/core'
 import { TresCanvas } from '@tresjs/core'
 import { OrbitControls } from '@tresjs/cientos'
 import { OrbitControls } from '@tresjs/cientos'

+ 1 - 4
playground/src/pages/perf/OnDemand.vue

@@ -1,7 +1,5 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { TresCanvas } from '@tresjs/core'
 import { TresCanvas } from '@tresjs/core'
-import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
-import { OrbitControls } from '@tresjs/cientos'
 import { useState } from '../../composables/state'
 import { useState } from '../../composables/state'
 import BlenderCube from '../../components/BlenderCube.vue'
 import BlenderCube from '../../components/BlenderCube.vue'
 import GraphPane from '../../components/GraphPane.vue'
 import GraphPane from '../../components/GraphPane.vue'
@@ -11,7 +9,6 @@ const { renderingTimes } = useState()
 
 
 function onRender() {
 function onRender() {
   renderingTimes.value = 1
   renderingTimes.value = 1
-
 }
 }
 </script>
 </script>
 
 
@@ -37,4 +34,4 @@ function onRender() {
       :intensity="0.7"
       :intensity="0.7"
     />
     />
   </TresCanvas>
   </TresCanvas>
-</template>
+</template>

+ 1 - 1
playground/src/router/routes/basic.ts

@@ -39,4 +39,4 @@ export const basicRoutes = [
     name: 'Pierced Props',
     name: 'Pierced Props',
     component: () => import('../../pages/basic/PiercedProps.vue'),
     component: () => import('../../pages/basic/PiercedProps.vue'),
   },
   },
-]
+]

+ 1 - 1
playground/src/router/routes/cameras.ts

@@ -14,4 +14,4 @@ export const cameraRoutes = [
     name: 'Multiple Cameras',
     name: 'Multiple Cameras',
     component: () => import('../../pages/cameras/MultipleCameras.vue'),
     component: () => import('../../pages/cameras/MultipleCameras.vue'),
   },
   },
-]
+]

+ 1 - 1
playground/src/router/routes/events.ts

@@ -4,4 +4,4 @@ export const eventsRoutes = [
     name: 'Events',
     name: 'Events',
     component: () => import('../../pages/events/index.vue'),
     component: () => import('../../pages/events/index.vue'),
   },
   },
-]
+]

+ 1 - 1
playground/src/router/routes/index.ts

@@ -12,4 +12,4 @@ export {
   cameraRoutes,
   cameraRoutes,
   modelsRoutes,
   modelsRoutes,
   miscRoutes,
   miscRoutes,
-}
+}

+ 1 - 1
playground/src/router/routes/misc.ts

@@ -4,4 +4,4 @@ export const miscRoutes = [
     name: 'Text 3D',
     name: 'Text 3D',
     component: () => import('../../pages/misc/Text3DDemo.vue'),
     component: () => import('../../pages/misc/Text3DDemo.vue'),
   },
   },
-]
+]

+ 1 - 1
playground/src/router/routes/models.ts

@@ -4,4 +4,4 @@ export const modelsRoutes = [
     name: 'Model Primitives',
     name: 'Model Primitives',
     component: () => import('../../pages/models/PrimitivesModel.vue'),
     component: () => import('../../pages/models/PrimitivesModel.vue'),
   },
   },
-]
+]

+ 1 - 1
playground/src/router/routes/performance.ts

@@ -4,4 +4,4 @@ export const perfRoutes = [
     name: 'On Demand',
     name: 'On Demand',
     component: () => import('../../pages/perf/OnDemand.vue'),
     component: () => import('../../pages/perf/OnDemand.vue'),
   },
   },
-]
+]

Разлика између датотеке није приказан због своје велике величине
+ 19 - 601
pnpm-lock.yaml


+ 1 - 6
src/composables/useRenderer/index.ts

@@ -94,12 +94,7 @@ export interface UseRendererOptions extends TransformToMaybeRefOrGetter<WebGLRen
   preset?: MaybeRefOrGetter<RendererPresetsType>
   preset?: MaybeRefOrGetter<RendererPresetsType>
   renderMode?: MaybeRefOrGetter<'always' | 'on-demand' | 'manual'>
   renderMode?: MaybeRefOrGetter<'always' | 'on-demand' | 'manual'>
 }
 }
-/**
- * Reactive three.js WebGLRenderer instance
- *
- * @param canvas
- * @param {UseRendererOptions} [options]
- */
+
 export function useRenderer(
 export function useRenderer(
   {
   {
     scene,
     scene,

+ 9 - 9
src/core/nodeOpts.test.ts

@@ -101,12 +101,12 @@ describe('nodeOps', () => {
       root: {
       root: {
         registerCamera: () => { },
         registerCamera: () => { },
         registerObjectAtPointerEventHandler: () => { },
         registerObjectAtPointerEventHandler: () => { },
-      }
+      },
     }
     }
     const child = new Mesh()
     const child = new Mesh()
 
 
     child.__tres = {
     child.__tres = {
-      root: null
+      root: null,
     }
     }
 
 
     // Fake vnodes
     // Fake vnodes
@@ -145,7 +145,7 @@ describe('nodeOps', () => {
     node.__tres = {
     node.__tres = {
       root: {
       root: {
         invalidate: () => { },
         invalidate: () => { },
-      }
+      },
     }
     }
     const prop = 'visible'
     const prop = 'visible'
     const nextValue = false
     const nextValue = false
@@ -163,7 +163,7 @@ describe('nodeOps', () => {
     node.__tres = {
     node.__tres = {
       root: {
       root: {
         invalidate: () => { },
         invalidate: () => { },
-      }
+      },
     }
     }
     const prop = 'position-x'
     const prop = 'position-x'
     const nextValue = 5
     const nextValue = 5
@@ -181,7 +181,7 @@ describe('nodeOps', () => {
     node.__tres = {
     node.__tres = {
       root: {
       root: {
         invalidate: () => { },
         invalidate: () => { },
-      }
+      },
     }
     }
     const prop = 'cast-shadow'
     const prop = 'cast-shadow'
     const nextValue = true
     const nextValue = true
@@ -195,19 +195,19 @@ describe('nodeOps', () => {
 
 
   it('patchProp should preserve ALL_CAPS_CASE in pierced props', () => {
   it('patchProp should preserve ALL_CAPS_CASE in pierced props', () => {
     // Issue: https://github.com/Tresjs/tres/issues/605
     // Issue: https://github.com/Tresjs/tres/issues/605
-    const {createElement, patchProp} = nodeOps()
+    const { createElement, patchProp } = nodeOps()
     const node = createElement('TresMeshStandardMaterial', null, null, {})
     const node = createElement('TresMeshStandardMaterial', null, null, {})
     const allCapsKey = 'STANDARD'
     const allCapsKey = 'STANDARD'
     const allCapsUnderscoresKey = 'USE_UVS'
     const allCapsUnderscoresKey = 'USE_UVS'
     const allCapsValue = 'hello'
     const allCapsValue = 'hello'
     const allCapsUnderscoresValue = 'goodbye'
     const allCapsUnderscoresValue = 'goodbye'
 
 
-    patchProp(node, 'defines-' + allCapsKey, null, allCapsValue)
-    patchProp(node, 'defines-' + allCapsUnderscoresKey, null, allCapsUnderscoresValue)
+    patchProp(node, `defines-${allCapsKey}`, null, allCapsValue)
+    patchProp(node, `defines-${allCapsUnderscoresKey}`, null, allCapsUnderscoresValue)
 
 
     expect(node.defines[allCapsKey]).equals(allCapsValue)
     expect(node.defines[allCapsKey]).equals(allCapsValue)
     expect(node.defines[allCapsUnderscoresKey]).equals(allCapsUnderscoresValue)
     expect(node.defines[allCapsUnderscoresKey]).equals(allCapsUnderscoresValue)
-  }) 
+  })
 
 
   it('parentNode: returns parent of a node', async () => {
   it('parentNode: returns parent of a node', async () => {
     // Setup
     // Setup

+ 1 - 1
src/types/index.ts

@@ -55,7 +55,7 @@ export interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
   material?: THREE.Material & TresBaseObject
   material?: THREE.Material & TresBaseObject
 }
 }
 
 
-export type TresObject = 
+export type TresObject =
   TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & { __tres: LocalState }
   TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & { __tres: LocalState }
 
 
 export interface TresScene extends THREE.Scene {
 export interface TresScene extends THREE.Scene {

Неке датотеке нису приказане због велике количине промена