react-glsl-canvas
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.6 • Public • Published

WARNING! This library is in early development stage. Use it at your own risk.

React GLSL is a library that allows you to rander GLSL shaders inside React components.

Props of GLSL component are passed to the underlying glsl-canvas-js instance as options.

npm install react-glsl-canvas
# or
yarn add react-glsl-canvas
import React from 'react';
import { GLSL } from 'react-glsl-canvas';
import shader from './shader.glsl';

export const App = () => {
  return (
    <GLSL fragmentString={shader} />
  );
}
precision mediump float;

uniform float u_time;
uniform vec2 u_mouse;
uniform vec2 u_resolution;

void main() {
  vec2 st = gl_FragCoord.xy/u_resolution.xy;
  gl_FragColor = vec4(st.x,st.y,0.0,1.0);
}

Package Sidebar

Install

npm i react-glsl-canvas

Weekly Downloads

0

Version

1.0.0-alpha.6

License

MIT

Unpacked Size

570 kB

Total Files

11

Last publish

Collaborators

  • frusanov