This project is part of the @thi.ng/umbrella monorepo.
Declarative WebGL 1.0 / 2.0 abstraction layer, partially ported & updated from Clojure/ClojureScript versions of thi.ng/geom.
- Extensive set of WebGL related types & interfaces
- Declarative shader definition
- option to fully define shaders in TypeScript and transpile to GLSL (via @thi.ng/shader-ast)
- attribute, varying, uniform & output type declarations via a simple config object
- GLSL code generation of data type declarations
- automatic support for GLSL ES 1.0 & 3.0
- optional layout attrib layout support for GLES 3 (WebGL2)
- automatic & typed uniform setters
- pre-declared desired GL draw state flags / settings
- customizable shader presets
- Declarative geometry, attribute & index buffer specs
- Declarative instancing (always available in WebGL2, or via ANGLE ext in WebGL1)
- also supported by bundled shader presets
- Texture wrapper & declarative config
- FBO support with multiple attachments & render buffers
- GPGPU job utilities
- Geometry & texture generators
- WebGL extension helpers
- WebGL canvas creation / setup
Status: Alpha / WIP
yarn add @thi.ng/webgl
- @thi.ng/api
- @thi.ng/associative
- @thi.ng/binary
- @thi.ng/checks
- @thi.ng/errors
- @thi.ng/matrices
- @thi.ng/shader-ast
- @thi.ng/shader-ast-glsl
- @thi.ng/shader-ast-stdlib
- @thi.ng/transducers
- @thi.ng/vector-pools
- @thi.ng/vectors
- @thi.ng/shader-ast-stdlib (also see readme for reference)
- @thi.ng/webgl-msdf
Several examples are included in the /examples folder of this repo...
- 2D SDF
- Raymarching
- Simplex noise
- Textured tunnel
- Cubemap
- Grid instancing
- GPGPU basics
- MSDF font rendering
- SSAO deferred rendering
- Karsten Schmidt
© 2014 - 2019 Karsten Schmidt // Apache Software License 2.0