bx-1140-postprocessing #12
|
@ -21,6 +21,7 @@ renderer.value.toneMappingExposure = 1.25;
|
|||
renderer.value.setPixelRatio(1.5)
|
||||
|
||||
const loadEnv = async () => {
|
||||
console.log('update env')
|
||||
const loader = new GainMapLoader(renderer.value)
|
||||
const result = await loader.loadAsync([
|
||||
props.hdr_webp ? `${IMAGE_URL}/${props.hdr_webp}` : hdr_webp,
|
||||
|
@ -34,7 +35,7 @@ const loadEnv = async () => {
|
|||
const newEnvMap = exrCubeRenderTarget ? exrCubeRenderTarget.texture : null;
|
||||
|
||||
scene.value.environment = newEnvMap
|
||||
scene.value.environmentIntensity = 2.5
|
||||
scene.value.environmentIntensity = 1
|
||||
|
||||
result.renderTarget.texture.dispose();
|
||||
|
||||
|
@ -45,7 +46,7 @@ const loadEnv = async () => {
|
|||
}
|
||||
|
||||
onMounted(async () => {
|
||||
loadEnv()
|
||||
// loadEnv()
|
||||
})
|
||||
watch(() => props, loadEnv, { deep: true })
|
||||
</script>
|
||||
|
|
|
@ -3,9 +3,9 @@ import { reactive, ref, watch } from 'vue';
|
|||
import type { Ref } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router';
|
||||
|
||||
import { Color, Vector3 } from 'three';
|
||||
import { TresCanvas, useTexture } from '@tresjs/core';
|
||||
import { OrbitControls } from '@tresjs/cientos'
|
||||
import { Vector3 } from 'three';
|
||||
import { TresCanvas } from '@tresjs/core';
|
||||
import { OrbitControls, Stats } from '@tresjs/cientos'
|
||||
import '@tresjs/leches/styles'
|
||||
|
||||
import LoadModels from './load_models.vue'
|
||||
|
@ -60,7 +60,8 @@ watch(() => route.params.target, () => {
|
|||
<div>
|
||||
<div :class="[{ 'loading': models_loading }, 'canvas-wrapper']">
|
||||
<TresCanvas window-size :alpha="false" power-preference="high-performance" :clear-color="PROMOBG"
|
||||
:logarithmicDepthBuffer="true">
|
||||
:shadows="false">
|
||||
<Stats />
|
||||
<TresPerspectiveCamera :position="cameraPosition" ref="camera" />
|
||||
<OrbitControls v-bind="controlsState" @change="onChange" make-default />
|
||||
<Suspense>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const SERVER_URL = import.meta.env.VITE_SERVER_URL ?? window.location.origin
|
||||
export const IMAGE_URL = import.meta.env.VITE_IMAGE_URL ?? window.location.origin
|
||||
|
||||
export const PROMOBG='red'
|
||||
export const PROMOBG='#ccc'
|
Loading…
Reference in New Issue