glsl-inverse
v1.0.0
Published
Invert a matrix in GLSL
Downloads
115,785
Readme
glsl-inverse
Invert a matrix in GLSL.
Example
#pragma glslify: inverse = require(glsl-inverse)
void main() {
mat3 m = mat3(1, 2, -3,
4, 0, 6,
7.1, 8, 9);
mat3 mi = inverse(m);
//now mi is the inverse of m
}
Usage
Install with npm:
npm install glsl-inverse
Then use with glslify.
API
#pragma glslify: inverse = require(glsl-inverse)
mi = inverse(float|mat2|mat3|mat4 m)
Computes inverse of m
m
is a matrix to invert, eitherfloat, mat2, mat3
ormat4
Returns The inverse of m
License
(c) 2014 Mikola Lysenko. MIT License