Tresjs / tres

Declarative ThreeJS using Vue Components

Home Page:https://tresjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The screen flickers severely when the resize event is triggered

Steve245270533 opened this issue · comments

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.

Screen flicker1

Screen flicker2

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