1.0.1 • Published 5 years ago

reason-glsl-optimizer v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

reason-glsl-optimizer

Reason / OCaml native bindings for glsl-optimizer for GLSL shader cross-transpilation.

It accepts GLSL vertex and fragment shaders, optimizes them, and is able to output either OpenGL, OpenGL ES2, Open GL ES3, or Metal shader code. It also supports querying the shaders for their inputs, uniforms, and textures.

Usage

open Reglsloptimizer;

let vs = {|
  #version 300 es
  // ...
|};

let fs = {|
  #version 300 es
  // ...
|};

/* create shader instances */
let vsShader = convertShader(Vertex, vs);
let fsShader = convertShader(Fragment, fs);

/* get string output */
let vsNew = getOutput(vsShader);
let fsNew = getOutput(fsShader);