bake shadows
This commit is contained in:
parent
770fbc9335
commit
4cd6c6186c
|
@ -18,6 +18,8 @@ function shadows_and_pos(scene: any) {
|
||||||
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)
|
||||||
})
|
})
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue