From fba64dc2720884eb16dcae446de9dd7a066c0ea6 Mon Sep 17 00:00:00 2001 From: Peter Date: Fri, 1 Sep 2023 17:21:45 +0200 Subject: [PATCH] feat(Lensflare): update seed with random value --- playground/src/pages/LensflareDemo.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playground/src/pages/LensflareDemo.vue b/playground/src/pages/LensflareDemo.vue index 482c7a5c..416954db 100644 --- a/playground/src/pages/LensflareDemo.vue +++ b/playground/src/pages/LensflareDemo.vue @@ -21,6 +21,7 @@ const randomColor = () => colors[Math.trunc(Math.random() * colors.length)]; const color = randomColor(); const lightRef = shallowRef(); +const seedRef = shallowRef(0); const flarePropsRef = shallowRef([{ color, size: 1 }]); flarePropsRef.value = new Array(11).fill(0).map((_, i) => ({ size: Math.min(256 / (1 + i * i)), color })); @@ -32,6 +33,7 @@ onLoop(() => { if (Math.random() > 0.99) { lightRef.value.color = new Color(randomColor()); flarePropsRef.value = getFlareProps() + seedRef.value = Math.floor(Math.random() * 10000) } }); @@ -70,7 +72,7 @@ const rockMaterial = new MeshPhongMaterial({ color: 0x123141, specular: 0xffffff - +