Skip to content

Commit c7b902d

Browse files
author
takuma-hmng8
committed
demo 修正
1 parent ddb3406 commit c7b902d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

app/_home/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const Home = () => {
2222

2323
setBlending({
2424
mapIntensity: 0.45,
25+
brightness: new THREE.Vector3(0.2, 0.2, 0.2),
2526
});
2627

2728
setNoise({
@@ -52,16 +53,16 @@ export const Home = () => {
5253
useFrame((props) => {
5354
const noise = updateNoise(props);
5455
const fluid = updateFluid(props);
55-
const picked = updateBrightnessPicker(props, {
56-
texture: fluid,
57-
});
5856
const blending = updateBlending(props, {
59-
texture: picked,
57+
texture: fluid,
6058
map: noise,
6159
});
62-
const colorStrata = updateColorStrata(props, {
60+
const picked = updateBrightnessPicker(props, {
6361
texture: blending,
6462
});
63+
const colorStrata = updateColorStrata(props, {
64+
texture: picked,
65+
});
6566
ref.current!.uniforms.u_fx.value = colorStrata;
6667
});
6768

packages/use-shader-fx/src/hooks/useColorStrata/shader/main.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
}
2222
col[int(j)] = fract(p.x * laminateDetail.x + p.y * laminateDetail.y);
2323
}
24-
col *= colorFactor;
24+
col *= colorFactor * alpha;
2525
col = clamp(col, 0.0, 1.0);
2626
gl_FragColor = vec4(col, alpha);
2727
}

0 commit comments

Comments
 (0)