background blur

This commit is contained in:
Kseninia Mikhaylova 2024-07-03 16:07:50 +03:00
parent e4a6c95b08
commit 35a7f42132
10 changed files with 24 additions and 27 deletions

View File

@ -35,7 +35,7 @@ const loadAll = async () => {
const { scene: light } = await useGLTF('/models_light/zabor_so_svetom.glb')
pointLight.value = light.children[2]
pointLight.value.color = '#f0dea9'
pointLight.value.intensity = pointLight.value.intensity * 0.2
pointLight.value.intensity = pointLight.value.intensity * 0.1
// pointLight.value.intensity = 0
pointLight.value.shadow.camera.near = 50
pointLight.value.shadow.bias = -0.002
@ -112,8 +112,6 @@ watch([section_count, extra_section], () => {
<template v-if="pointLight">
<TresPointLight v-bind="pointLight" cast-shadow />
</template>
<TresAmbientLight color="rgb(191,231,255)" :intensity="5" />
</TresCanvas>
</ClientOnly>
</div>

View File

@ -1,7 +1,9 @@
<script setup lang="ts">
import {
ReinhardToneMapping, PCFSoftShadowMap,
PMREMGenerator, Euler,
PCFSoftShadowMap,
EquirectangularReflectionMapping,
CineonToneMapping,
Euler,
} from 'three';
import { GainMapLoader, } from '@monogrid/gainmap-js'
import { useGLTF, } from '@tresjs/cientos'
@ -14,7 +16,9 @@ const extra_section = use_extra_section()
const max_size = use_max_size()
const { scene, renderer } = useTresContext()
renderer.value.toneMapping = ReinhardToneMapping
renderer.value.toneMapping = CineonToneMapping
renderer.value.toneMappingExposure = 0.5
// renderer.value.gammaOutput = true
renderer.value.shadowMap.enabled = true
renderer.value.shadowMap.type = PCFSoftShadowMap
@ -61,24 +65,19 @@ watch([section_count, extra_section], () => {
}
})
const pmremGenerator = new PMREMGenerator(renderer.value);
pmremGenerator.compileEquirectangularShader();
onMounted(async () => {
const loader = new GainMapLoader(renderer.value)
const result = await loader.loadAsync([
'hdrmaps/alps_field_4k.webp',
'hdrmaps/alps_field_4k-gainmap.webp',
'hdrmaps/alps_field_4k.json',
'hdrmaps/hdr.webp',
'hdrmaps/hdr-gainmap.webp',
'hdrmaps/hdr.json',
])
const exrCubeRenderTarget = pmremGenerator.fromEquirectangular(result.renderTarget.texture);
const exrBackground = exrCubeRenderTarget.texture;
const newEnvMap = exrCubeRenderTarget ? exrCubeRenderTarget.texture : null;
scene.value.environment = newEnvMap
scene.value.background = exrBackground
scene.value.backgroundRotation = new Euler(0, 5, 0)
// scene.value.background.mapping = EquirectangularReflectionMapping
scene.value.environment = result.renderTarget.texture
scene.value.background = result.renderTarget.texture
scene.value.background.mapping = EquirectangularReflectionMapping
scene.value.backgroundRotation = new Euler(0, 10, 0)
scene.value.backgroundIntensity = 1.5
scene.value.backgroundBlurriness = 0.05
result.renderTarget.texture.dispose();
})

View File

@ -35,7 +35,7 @@ const aboutText = computed(() => marked.parse(about?.content || ''))
const deliveryText = computed(() => delivery?.content.split('[col]').map(el => marked.parse(el || '')))
const advantagesText = computed(() => {
let c = advantages?.content || ''
Object.entries(calculatorData.value || {}).map(item => {
Object.entries(calculatorData.value || {}).map(item => {
c = c.replaceAll(`[${item[0]}]`, roubleSign.format(item[1]))
})
return marked.parse(c)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -1,8 +1,8 @@
{
"gainMapMax": [
15.999075124875333,
15.999075124875333,
15.999075124875333
5.336506559810254,
5.336506559810254,
5.336506559810254
],
"gainMapMin": [
0,
@ -14,7 +14,7 @@
1,
1
],
"hdrCapacityMax": 15.999075124875333,
"hdrCapacityMax": 5.336506559810254,
"hdrCapacityMin": 0,
"offsetHdr": [
0.015625,

BIN
public/hdrmaps/hdr.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -16,8 +16,8 @@ export const set_material = (scene: any, color: any) => {
color: new Color(c || '#9c9c00'),
transparent: true,
opacity: 1,
roughness: 0.3,
metalness: 0.3
roughness: 0.5,
metalness: 0
})
set_metaril_func(scene, material)
}