Skip to content

Commit b72cc93

Browse files
authored
Merge pull request #27 from takuma-hmng8/#24-useDomSyncer
#24 use dom syncer
2 parents 2688290 + 4f4461c commit b72cc93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+549
-2438
lines changed

.storybook/constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as THREE from "three";
22

33
export const CONSTANT = {
4-
imageResolution: new THREE.Vector2(1440, 1029),
4+
textureResolution: new THREE.Vector2(1440, 1029),
55
};

.storybook/stories/UseBrush.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const UseBrushWithTexture = (args: BrushParams) => {
6464

6565
useFrame((props) => {
6666
const bgTexture = updateTransitionBg(props, {
67-
imageResolution: CONSTANT.imageResolution,
67+
textureResolution: CONSTANT.textureResolution,
6868
texture0: bg,
6969
});
7070
const fx = updateBrush(props, {

.storybook/stories/UseDuoTone.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const UseDuoTone = (args: DuoToneParams) => {
3636

3737
useFrame((props) => {
3838
const bgTexture = updateTransitionBg(props, {
39-
imageResolution: CONSTANT.imageResolution,
39+
textureResolution: CONSTANT.textureResolution,
4040
texture0: bg,
4141
});
4242
const fx = updateDuoTone(props, {

.storybook/stories/UseFluid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const UseFluidWithTexture = (args: FluidParams) => {
7373

7474
useFrame((props) => {
7575
const bgTexture = updateTransitionBg(props, {
76-
imageResolution: CONSTANT.imageResolution,
76+
textureResolution: CONSTANT.textureResolution,
7777
texture0: bg,
7878
});
7979

.storybook/stories/UseFogProjection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const UseFogProjection = (args: FogProjectionParams) => {
4848

4949
useFrame((props) => {
5050
const bgTexture = updateTransitionBg(props, {
51-
imageResolution: CONSTANT.imageResolution,
51+
textureResolution: CONSTANT.textureResolution,
5252
texture0: bg,
5353
});
5454
const noise = updateNoise(props);

.storybook/stories/UseRipple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const UseRippleWithTexture = (args: RippleParams) => {
6969

7070
useFrame((props) => {
7171
const bgTexture = updateTransitionBg(props, {
72-
imageResolution: CONSTANT.imageResolution,
72+
textureResolution: CONSTANT.textureResolution,
7373
texture0: bg,
7474
});
7575
const fx = updateRipple(props, setConfig());

.storybook/stories/UseTransitionBg.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const UseTransitionBg = (args: TransitionBgParams) => {
4848
const noise = updateNoise(props);
4949
const fx = updateTransitionBg(props, {
5050
noiseMap: noise,
51-
imageResolution: CONSTANT.imageResolution,
51+
textureResolution: CONSTANT.textureResolution,
5252
texture0: bg,
5353
texture1: momo,
5454
...setConfig(),

app/ShaderFx.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ import { Suspense, useState } from "react";
44
import { Canvas } from "@react-three/fiber";
55
import { Perf } from "r3f-perf";
66
import { PerformanceMonitor } from "@react-three/drei";
7-
import { Demo } from "./_demo";
87

9-
// import CreateShaderFx from "@/CreateShaderFx";
10-
11-
export const ShaderFx = () => {
8+
export const ShaderFx = ({ children }: { children: React.ReactNode }) => {
129
const [dpr, setDpr] = useState(1.0);
1310
return (
1411
<Canvas dpr={dpr}>
@@ -18,10 +15,7 @@ export const ShaderFx = () => {
1815
console.log(`dpr:${dpr}`);
1916
setDpr(Math.round((0.5 + 1.0 * factor) * 10) / 10);
2017
}}>
21-
<Suspense fallback={null}>
22-
{/* When creating fx, please rewrite to CreateShaderFx */}
23-
<Demo />
24-
</Suspense>
18+
<Suspense fallback={null}>{children}</Suspense>
2519
<Perf position={"bottom-left"} minimal={false} />
2620
</PerformanceMonitor>
2721
</Canvas>
File renamed without changes.

app/_demo/index.tsx renamed to app/_home/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515

1616
extend({ FxTransparentMaterial });
1717

18-
export const Demo = () => {
18+
export const Home = () => {
1919
const updateGUI = useGUI(setGUI);
2020
const mainShaderRef = useRef<FxTransparentMaterialProps>();
2121

@@ -90,7 +90,7 @@ the simplest demo
9090
// import { useFrame, useThree } from "@react-three/fiber";
9191
// import { useFluid } from "@hmng8/use-shader-fx";
9292

93-
// export const Demo = () => {
93+
// export const Home = () => {
9494
// const ref = useRef<THREE.ShaderMaterial>(null);
9595
// const size = useThree((state) => state.size);
9696
// const dpr = useThree((state) => state.viewport.dpr);

0 commit comments

Comments
 (0)