1.0.0-alpha.6 • Published 9 months ago

react-glsl-canvas v1.0.0-alpha.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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);
}
1.0.0-alpha.6

9 months ago

1.0.0-alpha.5

10 months ago

1.0.0-alpha.4

10 months ago

1.0.0-alpha.3

10 months ago

1.0.0-alpha.2

10 months ago

1.0.0-alpha.1

10 months ago