Skip to content

Commit 7086f35

Browse files
committed
Add basic docs
1 parent c607935 commit 7086f35

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# threejs-crt-shader
2+
3+
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.
16+
17+
TODOs:
18+
19+
- use Yoga flexbox layout engine with Konva
20+
- interactivity with underlying Konva primitives

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "threejs-crt-shader",
33
"version": "0.0.1",
4-
"description": "",
4+
"description": "Experiment: rendering custom canvas contents in a simulated 3D CRT monitor",
55
"main": "index.js",
66
"scripts": {
77
"storybook": "start-storybook -p 6006 -s public --no-dll",

0 commit comments

Comments
 (0)