百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-fluid-distortion

> 前端框架
开源

React-Three-Fiber 的后处理流体扭曲效果。 在 atelier-ui.com 上可找到更好的版本

196 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

React-Three-Fiber 的后处理流体扭曲效果。 在 atelier-ui.com 上可找到更好的版本

[!IMPORTANT]
A better version of this effect is available as part of Atelier UI.

Fluid Distortion for React Three Fiber

Implementing post-processing fluid distortion effects in response to cursor interactions for React-Three-Fiber. Based on the shaders developed by Pavel Dobryakov


Demo

  • Atelier UI

  • CodeSandbox

Installation :

bash
npm install @whatisjery/react-fluid-distortion @react-three/drei @react-three/postprocessing postprocessing

Example of use :

javascript
import { Fluid } from '@whatisjery/react-fluid-distortion';
import { EffectComposer } from '@react-three/postprocessing';
import { Canvas } from '@react-three/fiber';

    
        {... other effets}
        
    
;

Options :

Name Type Default Value Description
fluidColor hexadecimal #005eff Sets the fluid color. Effective only when rainbow is set to false.
backgroundColor string #070410 Sets the background color. Effective only when showBackground is true.
showBackground boolean false Toggles the background color's visibility. If false it becomes transprent.
blend number 5 Blends fluid into the scene when showBackground is true. Valid range: 0.00 to 10.0.
intensity number 10 Sets the fluid intensity. Valid range: 0 to 10.
force number 2 Multiplies the mouse velocity to increase fluid splatter. Valid range: 0.0 to 20.
distortion number 2 Sets the distortion amount. Valid range: 0.00 to 2.00.
radius number 0.3 Sets the fluid radius. Valid range: 0.01 to 1.00.
curl number 10 Sets the amount of the curl effect. Valid range: 0.0 to 50.
swirl number 20 Sets the amount of the swirling effect. Valid range: 0 to 20.
velocityDissipation number 0.99 Reduces the fluid velocity over time. Valid range: 0.00 to 1.00.
densitionDissipation number 0.95 Reduces the fluid density over time. Valid range: 0.00 to 1.00.
pressure number 0.80 Controls the reduction of pressure. Valid range: 0.00 to 1.00.
rainbow boolean true Activates color mode based on mouse direction. No range applicable as this is a boolean value.

Usage with nextjs

If you're working with an older version of Next.js, you may get this type of error:

javascript
TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED')

To fix it, you can enable package transpilation in your next.config file. Here’s how:

javascript
const nextConfig = {
    transpilePackages: ['@whatisjery/react-fluid-distortion'],
};

module.exports = nextConfig;

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptfluidglslreactreact-three-fiber

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架