Computes the determinant of a matrix in glsl
npm install glsl-determinant``glsl
#pragma glslify: det = require(glsl-determinant)
void main() {
mat3 m = mat3(1, 2, 3,
4, 5, 6,
7, 8, 9);
float d = det(m);
//d is the determinant of m (0 in this case)
}
`
Install with npm:
``
npm install glsl-determinant
Then use with glslify.
`glsl`
#pragma glslify: determinant = require(glsl-determinant)
* m is a matrix, either float, mat2, mat3 or mat4
Returns The determinant of m`