Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ import { useFluid } from "@funtech-inc/use-shader-fx";

export const Home = () => {
const { size } = useThree();
const [updateFluid, , { output }] = useFluid({ size, dpr: 1 });
const [updateFluid, , { output }] = useFluid({
size: {
width: size.width,
height: size.height,
},
dpr: 1,
});
useFrame((rootState) => updateFluid(rootState));
return (
<mesh>
Expand Down
2 changes: 1 addition & 1 deletion app/ShaderFx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const ShaderFx = ({
setDpr(Math.round((0.5 + 1.5 * factor) * 10) / 10);
}}>
{children}
{/* <Perf position={"bottom-left"} minimal={false} /> */}
<Perf position={"bottom-left"} minimal={false} />
</PerformanceMonitor>
</Canvas>
</Suspense>
Expand Down
5 changes: 4 additions & 1 deletion app/_home/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export const Playground = ({
dpr: viewport.dpr,
});
const [updateBlank, _, { output: blank }] = useBlank({
size,
size: {
width: size.width,
height: size.height,
},
dpr: viewport.dpr,
onBeforeInit: useCallback((params: OnBeforeInitParameters) => {
Object.assign(params.uniforms, {
Expand Down
11 changes: 7 additions & 4 deletions app/useWobble3D/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ export const Playground = () => {
baseMaterial: THREE.MeshPhysicalMaterial,
materialParameters: MATERIAL_CONFIG,
isCustomTransmission: true,
onBeforeInit: (params) => {
console.log(params);
},
depth: true,
// onBeforeInit: (params) => {
// console.log(params);
// },
});
wobble.mesh.customDepthMaterial = wobble.depthMaterial;
if (wobble.depthMaterial) {
wobble.mesh.customDepthMaterial = wobble.depthMaterial;
}
wobble.mesh.receiveShadow = true;
wobble.mesh.castShadow = true;

Expand Down
Loading