dev #10

Merged
ksenia_mikhailova merged 46 commits from dev into main 2024-07-24 12:58:58 +03:00
2 changed files with 8 additions and 6 deletions
Showing only changes of commit 4cd6c6186c - Show all commits

View File

@ -16,8 +16,10 @@ function shadows_and_pos(scene: any) {
scene.children.forEach((el: any) => { scene.children.forEach((el: any) => {
el.receiveShadow = true el.receiveShadow = true
el.castShadow = true el.castShadow = true
if(el.isPointLight) { if (el.isPointLight) {
el.shadow.bias = -0.01 el.shadow.bias = -0.01
const k = 8
el.shadow.mapSize = new Vector2(512 * k, 512 * k)
} }
shadows_and_pos(el) shadows_and_pos(el)
}) })
@ -209,7 +211,7 @@ watch(() => sidebar_scene.list, () => {
<Env v-bind="envVars" /> <Env v-bind="envVars" />
<template v-for="item in models"> <template v-for="item in models">
<TresGroup :name="item.name"> <TresGroup :name="item.name">
<TresObject3D v-bind="item.modelFile.clone()"/> <TresObject3D v-bind="item.modelFile.clone()" />
</TresGroup> </TresGroup>
</template> </template>
<template v-for="(item, i) in clickable_items"> <template v-for="(item, i) in clickable_items">

View File

@ -5,12 +5,11 @@ import { RouterLink, useRoute } from 'vue-router';
import { Vector3 } from 'three'; import { Vector3 } from 'three';
import { TresCanvas, vLightHelper } from '@tresjs/core'; import { TresCanvas, vLightHelper } from '@tresjs/core';
import { OrbitControls, Stats } from '@tresjs/cientos' import { BakeShadows, OrbitControls, Stats } from '@tresjs/cientos'
import LoadModels from './load_models.vue' import LoadModels from './load_models.vue'
import Sidebar from './sidebar.vue' import Sidebar from './sidebar.vue'
import { usePromoSidebar } from '../../stores/promo_sidebar'; import { usePromoSidebar } from '../../stores/promo_sidebar';
import { EffectComposer, Pixelation } from '@tresjs/post-processing';
const minPan = ref(new Vector3(-2, -2, -2)) const minPan = ref(new Vector3(-2, -2, -2))
const maxPan = ref(new Vector3(2, 2, 2)) const maxPan = ref(new Vector3(2, 2, 2))
@ -74,9 +73,10 @@ watch(() => route.params.target, () => {
v-light-helper /> v-light-helper />
<TresDirectionalLight :intensity="100" :position-x="-50" :position-y="20" cast-shadow color="blue" <TresDirectionalLight :intensity="100" :position-x="-50" :position-y="20" cast-shadow color="blue"
v-light-helper /> v-light-helper />
<TresPointLight :intensity="2000" :position-x="0" :position-y="20" cast-shadow color="rgb(0,255,0)"/> <TresPointLight :intensity="2000" :position-x="0" :position-y="20" cast-shadow
color="rgb(0,255,0)" />
</TresGroup> </TresGroup>
<BakeShadows v-if="models_loading" />
<Suspense> <Suspense>
<Stats /> <Stats />
</Suspense> </Suspense>