bake shadows
This commit is contained in:
parent
770fbc9335
commit
4cd6c6186c
|
@ -16,8 +16,10 @@ function shadows_and_pos(scene: any) {
|
|||
scene.children.forEach((el: any) => {
|
||||
el.receiveShadow = true
|
||||
el.castShadow = true
|
||||
if(el.isPointLight) {
|
||||
if (el.isPointLight) {
|
||||
el.shadow.bias = -0.01
|
||||
const k = 8
|
||||
el.shadow.mapSize = new Vector2(512 * k, 512 * k)
|
||||
}
|
||||
shadows_and_pos(el)
|
||||
})
|
||||
|
@ -209,7 +211,7 @@ watch(() => sidebar_scene.list, () => {
|
|||
<Env v-bind="envVars" />
|
||||
<template v-for="item in models">
|
||||
<TresGroup :name="item.name">
|
||||
<TresObject3D v-bind="item.modelFile.clone()"/>
|
||||
<TresObject3D v-bind="item.modelFile.clone()" />
|
||||
</TresGroup>
|
||||
</template>
|
||||
<template v-for="(item, i) in clickable_items">
|
||||
|
|
|
@ -5,12 +5,11 @@ import { RouterLink, useRoute } from 'vue-router';
|
|||
|
||||
import { Vector3 } from 'three';
|
||||
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 Sidebar from './sidebar.vue'
|
||||
import { usePromoSidebar } from '../../stores/promo_sidebar';
|
||||
import { EffectComposer, Pixelation } from '@tresjs/post-processing';
|
||||
|
||||
const minPan = 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 />
|
||||
<TresDirectionalLight :intensity="100" :position-x="-50" :position-y="20" cast-shadow color="blue"
|
||||
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>
|
||||
|
||||
<BakeShadows v-if="models_loading" />
|
||||
<Suspense>
|
||||
<Stats />
|
||||
</Suspense>
|
||||
|
|
Loading…
Reference in New Issue