Skip to content

Commit

Permalink
Merge branch 'main' into feature/30-landing-page-with-product
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed May 24, 2023
2 parents 7678980 + fa92502 commit 919dab6
Show file tree
Hide file tree
Showing 46 changed files with 2,250 additions and 2,138 deletions.
4 changes: 2 additions & 2 deletions components/content/BasicAnimations.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas, TresInstance, useRenderLoop } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { OrbitControls } from '@tresjs/cientos'
import { ShallowRef } from 'vue'
Expand All @@ -10,7 +10,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/Cameras.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping, PerspectiveCamera, OrthographicCamera } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping, PerspectiveCamera, OrthographicCamera } from 'three'
import { Box, useTweakPane } from '@tresjs/cientos'
Expand All @@ -9,7 +9,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/Events.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas, TresEvent } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { OrbitControls } from '@tresjs/cientos'
Expand All @@ -9,7 +9,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/Text3dExperiment.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas, useRenderLoop, useTexture } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { useWindowSize } from '@vueuse/core'
import { ChromaticAberrationEffect, EffectComposer, EffectPass, RenderPass } from 'postprocessing/module'
Expand All @@ -13,7 +13,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/TheLights.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas, TresInstance, useTexture } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping, Color } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping, Color } from 'three'
import { OrbitControls, useTweakPane, GLTFModel, Plane } from '@tresjs/cientos'
Expand All @@ -9,7 +9,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/TresBasic.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { OrbitControls } from '@tresjs/cientos'
Expand All @@ -9,7 +9,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions components/content/galaxy-generator/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas, useRenderLoop } from '@tresjs/core'
import { BasicShadowMap, sRGBEncoding, NoToneMapping, Color, AdditiveBlending, BufferAttribute } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping, Color, AdditiveBlending, BufferAttribute } from 'three'
import gsap from 'gsap'
import { OrbitControls, useTweakPane } from '@tresjs/cientos'
Expand All @@ -13,7 +13,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/gltf.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { sRGBEncoding } from 'three'
import { SRGBColorSpace } from 'three'
import { OrbitControls, GLTFModel } from '@tresjs/cientos'
Expand All @@ -12,7 +12,7 @@ watchEffect(() => {
</script>

<template>
<TresCanvas clear-color="#82DBC5" shadows alpha window-size :output-encoding="sRGBEncoding">
<TresCanvas clear-color="#82DBC5" shadows alpha window-size :output-encoding="SRGBColorSpace">
<TresPerspectiveCamera :position="[5, 5, 5]" :fov="75" :near="0.1" :far="1000" />
<OrbitControls />

Expand Down
4 changes: 2 additions & 2 deletions components/content/lowpoly-planet/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { PCFSoftShadowMap, sRGBEncoding } from 'three'
import { PCFSoftShadowMap, SRGBColorSpace } from 'three'
import { TresCanvas } from '@tresjs/core'
import { OrbitControls } from '@tresjs/cientos'
Expand All @@ -11,7 +11,7 @@ const state = {
clearColor: '#11101B',
shadows: true,
alpha: false,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
useLegacyLights: true,
shadowMapType: PCFSoftShadowMap,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/materials/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { OrbitControls, Plane } from '@tresjs/cientos'
import { BasicShadowMap, NoToneMapping, sRGBEncoding } from 'three'
import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
import { shallowReactive } from 'vue'
const gl = shallowReactive({
clearColor: '#4f4f4f',
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
})
</script>
Expand Down
4 changes: 2 additions & 2 deletions components/content/pam-camera-mouse/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { TresCanvas, useRenderLoop } from '@tresjs/core'
import { PamCameraMouse } from '@tresjs/cientos'
Expand All @@ -12,7 +12,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
Expand Down
4 changes: 2 additions & 2 deletions components/content/portal-journey/ThePortal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { sRGBEncoding, DoubleSide, MeshBasicMaterial, ShaderMaterial, Color, Mesh } from 'three'
import { SRGBColorSpace, DoubleSide, MeshBasicMaterial, ShaderMaterial, Color, Mesh } from 'three'
import { useRenderLoop, useTexture } from '@tresjs/core'
import { useGLTF, useTweakPane } from '@tresjs/cientos'
Expand Down Expand Up @@ -47,7 +47,7 @@ const bakedTexture = await useTexture([
])
bakedTexture.flipY = false
bakedTexture.encoding = sRGBEncoding
bakedTexture.encoding = SRGBColorSpace
// Baked material
const bakedMaterial = new MeshBasicMaterial({
Expand Down
4 changes: 2 additions & 2 deletions components/content/portal-journey/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { BasicShadowMap, sRGBEncoding, NoToneMapping } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { TresCanvas } from '@tresjs/core'
import { OrbitControls } from '@tresjs/cientos'
import ThePortal from './ThePortal.vue'
Expand All @@ -10,7 +10,7 @@ const gl = {
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions components/content/post-processing-manual/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useRenderLoop, TresCanvas, useTresProvider } from '@tresjs/core'
import { reactive, watchEffect } from 'vue'
import { BasicShadowMap, sRGBEncoding, NoToneMapping, LoadingManager, DefaultLoadingManager } from 'three'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping, LoadingManager, DefaultLoadingManager } from 'three'
import { OrbitControls, GLTFModel, useTweakPane } from '@tresjs/cientos'
import {
BloomEffect,
Expand All @@ -20,7 +20,7 @@ const gl = reactive({
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputEncoding: sRGBEncoding,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
})
Expand Down
34 changes: 34 additions & 0 deletions components/content/potions-classroom/Books.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script setup lang="ts">
import { useGLTF } from '@tresjs/cientos';
import { DoubleSide, MeshBasicMaterial, Texture } from 'three';
const props = defineProps<{
texture: Texture
}>()
const { nodes } = await useGLTF(
'/models/potions-classroom/wizard-potions-classroom.glb',
{
draco: true,
},
)
const books = Object.values(nodes).filter(node => node.name.includes('Book'))
props.texture.flipY = false
const bakedMaterial = new MeshBasicMaterial({
map: props.texture,
side: DoubleSide,
})
books.forEach(book => {
book.material = bakedMaterial
})
</script>
<template>
<primitive v-for="book of books" :object="book" />
</template>
20 changes: 20 additions & 0 deletions components/content/potions-classroom/Bottles.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import { useGLTF } from '@tresjs/cientos';
const { nodes } = await useGLTF(
'/models/potions-classroom/wizard-potions-classroom.glb',
{
draco: true,
},
)
const bottles = Object.values(nodes).filter(node => node.name.includes('Bottle'))
</script>
<template>
<primitive v-for="bottle of bottles" :object="bottle" />
</template>
34 changes: 34 additions & 0 deletions components/content/potions-classroom/Bricks.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script setup lang="ts">
import { useGLTF } from '@tresjs/cientos';
import { DoubleSide, MeshBasicMaterial, Texture } from 'three';
const props = defineProps<{
texture: Texture
}>()
const { nodes } = await useGLTF(
'/models/potions-classroom/wizard-potions-classroom.glb',
{
draco: true,
},
)
const bricks = Object.values(nodes).filter(node => node.name.includes('Brick'))
props.texture.flipY = false
const bakedMaterial = new MeshBasicMaterial({
map: props.texture,
side: DoubleSide,
})
bricks.forEach(brick => {
brick.material = bakedMaterial
})
</script>
<template>
<primitive v-for="brick of bricks" :object="brick" />
</template>
Loading

0 comments on commit 919dab6

Please sign in to comment.