Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glsl es 2.0 inverse matrix

Tags:

glsl

glsles

There is no inverse command in glsl es 2.0
But I saw that I can 1.0/mat2 . But I fear it'll just divide component wisely. Or not?
But if so, is there some trick for this (get 1/det fast)?

like image 666
tower120 Avatar asked Mar 25 '14 18:03

tower120


1 Answers

No, there's no matrix inverse function in GLSL ES 1.00 (used in OpenGL ES 2.0). You'll need to do it manually, take a look e.g. here. But you should think hard whether you really need to do it in the shader on a per-vertex or per-fragment basis every frame, or is it possible to be precomputed and passed in as uniform.

like image 63
Arttu Peltonen Avatar answered Sep 20 '22 01:09

Arttu Peltonen