
react
React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.
It showcases a faithful reproduction of real-time water simulation and caustics in modern rendering APIs, with all shaders written in both GLSL and WGSL without runtime transpilation, addressing WebGPU constraints like explicit-LOD sampling and double-buffered caustics.
A port of Evan Wallace's WebGL Water (2011) to the PlayCanvas Engine. It reproduces the original demo's rendering and physics:
npm install
npm run dev # start the Vite dev server
npm run build # production build into dist/
Then open the printed local URL.
Original (lightgl.js) | This port |
|---|---|
GL.Texture float RTs + drawTo | pc.Texture (RGBA32F/16F) + pc.RenderTarget, ping-pong swap |
| Full-screen sim passes | pc.ShaderUtils.createShader + pc.drawQuadWithShader in update |
| Caustics into a 1024² texture | dedicated camera + layer → double-buffered RTs (projected mesh) |
GL.Shader / inline GLSL | pc.ShaderMaterial with custom GLSL and WGSL (no transpilation) |
GL.Mesh.plane/sphere/cube | hand-built pc.Mesh matching the original vertex layouts |
matrix stack + GL.Raytracer | orbit camera entity + camera.screenToWorld ray picking |
The shaders are ported almost verbatim (see src/shaders/). The only changes
are renaming engine-reserved identifiers and using PlayCanvas's built-in
attribute/uniform names (aPosition, matrix_viewProjection). Both cameras run
with GAMMA_NONE / TONEMAP_NONE so colors match the original's raw output.
Runs on WebGPU (preferred) and falls back to WebGL 2. Every shader is written in both GLSL (`src/shaders/*.gls
Evan Wallace's WebGL Water demo ported to the PlayCanvas Engine, running on WebGPU (native WGSL) and WebGL 2.
Similar projects matched by category, topics, and programming language.

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.
A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.
A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.