From c7b902dea8c5a4a9fe60be15a2c1f5169b50adf1 Mon Sep 17 00:00:00 2001 From: takuma-hmng8 Date: Thu, 21 Dec 2023 19:29:43 +0900 Subject: [PATCH] =?UTF-8?q?demo=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_home/index.tsx | 11 ++++++----- .../src/hooks/useColorStrata/shader/main.frag | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/_home/index.tsx b/app/_home/index.tsx index df5411b8..55b3b618 100644 --- a/app/_home/index.tsx +++ b/app/_home/index.tsx @@ -22,6 +22,7 @@ export const Home = () => { setBlending({ mapIntensity: 0.45, + brightness: new THREE.Vector3(0.2, 0.2, 0.2), }); setNoise({ @@ -52,16 +53,16 @@ export const Home = () => { useFrame((props) => { const noise = updateNoise(props); const fluid = updateFluid(props); - const picked = updateBrightnessPicker(props, { - texture: fluid, - }); const blending = updateBlending(props, { - texture: picked, + texture: fluid, map: noise, }); - const colorStrata = updateColorStrata(props, { + const picked = updateBrightnessPicker(props, { texture: blending, }); + const colorStrata = updateColorStrata(props, { + texture: picked, + }); ref.current!.uniforms.u_fx.value = colorStrata; }); diff --git a/packages/use-shader-fx/src/hooks/useColorStrata/shader/main.frag b/packages/use-shader-fx/src/hooks/useColorStrata/shader/main.frag index d11f5030..f1da013d 100644 --- a/packages/use-shader-fx/src/hooks/useColorStrata/shader/main.frag +++ b/packages/use-shader-fx/src/hooks/useColorStrata/shader/main.frag @@ -21,7 +21,7 @@ void main() { } col[int(j)] = fract(p.x * laminateDetail.x + p.y * laminateDetail.y); } - col *= colorFactor; + col *= colorFactor * alpha; col = clamp(col, 0.0, 1.0); gl_FragColor = vec4(col, alpha); } \ No newline at end of file