A playground for WebGL stuff
npm install
npm start
- Create a new directory in src/pages/
- Create an
index.js
in that directory with the following format:
export const meta = {
title: 'My Experiment',
tags: 'threejs,gpgpu',
}
export const init = ({ canvas, container }) => {
// WebGL code goes here
return () => {
// Cleanup code goes here
}
}
See src/pages/hello-three for a very basic example.
You can also supply an options
export to customize the page. For example, you can create a shadertoy-like environment where you only need to supply the shader code:
import fs from './fs.glsl'
import vs from './vs.glsl'
import texture from './rusty-metal-512x512.jpg'
...
export const options = {
display: 'fullscreen',
type: 'shadertoy',
shadertoy: {
vs, // optional; default is passthrough shader
fs,
iChannel0: texture // optional
},
}
Many thanks to iq
and mrdoob
.
MIT © Forrest Desjardins