-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 499 better memory management (#606)
* chore: memory management playground * feat: recursively free cpu and gpu memory allocation on remove * chore: clumsy attempt to dispose on unmount * chore: lint fix * feat: remove scene root on disposal * chore: fix lint * docs: added disposal guide on `performance` docs
- Loading branch information
1 parent
5f20467
commit e98ca6d
Showing
14 changed files
with
215 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ import 'uno.css' | |
const app = createApp(App) | ||
|
||
app.use(router) | ||
|
||
app.mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<script setup> | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three' | ||
import { TresLeches, useControls } from '@tresjs/leches' | ||
import '@tresjs/leches/styles' | ||
const gl = { | ||
clearColor: '#fff', | ||
shadows: true, | ||
alpha: false, | ||
shadowMapType: BasicShadowMap, | ||
outputColorSpace: SRGBColorSpace, | ||
toneMapping: NoToneMapping, | ||
} | ||
const { isVisible } = useControls({ | ||
isVisible: true, | ||
}) | ||
/* const mesh = new Mesh( | ||
new BoxGeometry(), | ||
new MeshToonMaterial({ color: 0x00ff00 }), | ||
) | ||
*/ | ||
onUnmounted(() => { | ||
// dispose(mesh) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<RouterLink to="/basic"> | ||
Go to another page | ||
</RouterLink> | ||
<TresLeches /> | ||
<TresCanvas v-bind="gl"> | ||
<TresPerspectiveCamera | ||
:position="[3, 3, 3]" | ||
:look-at="[0, 0, 0]" | ||
/> | ||
<TresGroup v-if="isVisible"> | ||
<TresMesh :position="[0, 0, 0]"> | ||
<TresBoxGeometry /> | ||
<TresMeshToonMaterial :color="0x00FF00" /> | ||
</TresMesh> | ||
</TresGroup> | ||
<!-- <Suspense> --> | ||
<!-- <BlenderC -->ube v-if="isVisible" /> | ||
<!-- </Suspense> --> | ||
<!-- <TresMesh :position="[0,0,0]" v-if="isVisible"> | ||
<TresBoxGeometry /> | ||
<TresMeshToonMaterial :color="0x00ff00" /> | ||
</TresMesh> --> | ||
<!-- <TresGridHelper /> --> | ||
<!-- <TresGroup v-if="isVisible"> | ||
<TresMesh :position="[0,0,0]" > | ||
<TresBoxGeometry /> | ||
<TresMeshToonMaterial :color="0x00ff00" /> | ||
</TresMesh> | ||
</TresGroup> --> | ||
|
||
<TresAmbientLight :intensity="1" /> | ||
</TresCanvas> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.