The screen flickers severely when the resize event is triggered
Steve245270533 opened this issue · comments
Steve245270533 commented
Describe the bug
When the resize event is triggered, the canvas is not re-rendered in time, causing the screen to flicker. This situation is also seen in the official example.
Reproduction
https://stackblitz.com/edit/stackblitz-starters-hhwpaq?file=src%2Fcomponents%2FTheExperience.vue
Steps to reproduce
This happens even when building the most basic scene:
<template>
<TresCanvas ref="canvasRef" v-bind="gl">
<TresAxesHelper />
</TresCanvas>
</template>
<script setup lang="ts">
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three';
const gl = {
clearColor: '#82DBC5',
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
};
</script>
System Info
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 2.49 GB / 15.90 GB
Binaries:
Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.6.6 - ~\AppData\Roaming\npm\npm.CMD
pnpm: 7.7.0 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium (120.0.2210.133)
Internet Explorer: 11.0.19041.3636
npmPackages:
@tresjs/core: ^3.6.0 => 3.6.0
Used Package Manager
pnpm
Code of Conduct
- I agree to follow this project's Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.