Skip to content

Commit f3c610e

Browse files
authoredApr 10, 2024
Merge pull request #94 from FunTechInc/v1.1.13
V1.1.13
2 parents b2bbd88 + d2c61ad commit f3c610e

File tree

87 files changed

+1887
-1710
lines changed

Some content is hidden

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

87 files changed

+1887
-1710
lines changed
 

‎README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ From each `fxHooks`, you can receive [`updateFx`, `setParams`, `fxObject`] in ar
6868
const [updateFx, setParams, fxObject] = useSomeFx(config);
6969
```
7070

71-
Execute `updateFx` in `useFrame`. The first argument receives the RootState from `useFrame`, and the second one takes `HookPrams`. Each fx has its `HookPrams`, and each type is exported.
71+
invoke `updateFx` in `useFrame`. The first argument receives the RootState from `useFrame`, and the second one takes `HookPrams`. Each fx has its `HookPrams`, and each type is exported.
7272

7373
```js
7474
useFrame((props) => {
@@ -288,6 +288,29 @@ usePerformanceMonitor({
288288
});
289289
```
290290

291+
When using some expensive FX (such as `useFluid`), lowering the `dpr` of the FBO of that FX can improve performance.
292+
293+
```js
294+
const [updateFx, setParams, fxObject] = useSomeFx({ size, dpr: 0.01 });
295+
```
296+
297+
Also, you can make more detailed adjustments by passing an object to `dpr` instead of `number`.
298+
299+
```ts
300+
type Dpr =
301+
| number
302+
| {
303+
dpr: number;
304+
/** you can set whether `dpr` affects `shader` and `fbo`. default is `true` for both */
305+
effect?: {
306+
/** default : `true` */
307+
shader?: boolean;
308+
/** default : `true` */
309+
fbo?: boolean;
310+
};
311+
};
312+
```
313+
291314
# Misc
292315

293316
## useDomSyncer

‎app/ShaderFx.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const ShaderFx = ({
5353
setDpr(Math.round((1.0 + 1.0 * factor) * 10) / 10);
5454
}}>
5555
{children}
56-
{/* <Suspense fallback={null}>{children}</Suspense> */}
5756
{/* <Perf position={"bottom-left"} minimal={false} /> */}
5857
</PerformanceMonitor>
5958
</Canvas>

0 commit comments

Comments
 (0)