You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experimenting with displaying React content into a WebGL CRT effect material.
4
+
5
+
[Live demo sandbox](https://codesandbox.io/s/github/unframework/threejs-crt-shader) (be sure to maximize view window for scanlines to show up).
6
+
7
+
Libraries used:
8
+
9
+
- Three.js + react-three-fiber (for main 3D scene)
10
+
- react-konva (to paint vector graphics on a canvas)
11
+
- react-spring (for animation)
12
+
13
+
A source canvas is painted using react-konva and then copied into a GPU texture for 3D rendering. The CRT effect is added into a custom MeshStandardMaterial and affects the emissive properties: this allows e.g. specular highlights to still layer on top.
14
+
15
+
The philosophy behind using something like react-konva is that authoring the "on screen" contents can use well-known recipes and helper libraries from the React ecosystem. And of course react-three-fiber affords the same simple setup and state management for the main 3D scene.
0 commit comments