-
-
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(app): 680 UseTexture composable as component (#757)
* feat(app): 680 UseTexture composable as component * refactor: change structure, keep standard of tres * fix: linter * docs: add docs
- Loading branch information
1 parent
bbb375f
commit f01a897
Showing
19 changed files
with
8,797 additions
and
10,990 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup> | ||
import { TresCanvas, UseTexture } from '@tresjs/core' | ||
import { OrbitControls } from '@tresjs/cientos' | ||
const path = 'https://raw.githubusercontent.com/Tresjs/assets/main/textures/black-rock/Rock035_2K_Displacement.jpg' | ||
</script> | ||
|
||
<template> | ||
<TresCanvas window-size clear-color="#111"> | ||
<TresPerspectiveCamera :position="[0, 0, 3]" :fov="45" :aspect="1" :near="0.1" :far="1000" /> | ||
<OrbitControls /> | ||
<Suspense> | ||
<UseTexture v-slot="{ textures }" :map="path" :displacement-map="path"> | ||
<TresMesh> | ||
<TresBoxGeometry :args="[1, 1, 1, 50, 50, 50]" /> | ||
<TresMeshStandardMaterial :map="textures.map" :displacement-map="textures.displacementMap" :displacement-scale="0.1" /> | ||
</TresMesh> | ||
</UseTexture> | ||
</Suspense> | ||
<TresDirectionalLight :position="[4, 4, 4]" /> | ||
<TresAmbientLight :intensity="0.5" /> | ||
</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
Oops, something went wrong.