Glsl es 2.0 inverse matrix

There is no reverse command in glsl es 2.0
But I saw that I can 1.0 / mat2. But I'm afraid it will be wise to share the component. Or not?
But if that is the case, is there any trick for this (get 1 / det fast)?

+4
source share
1 answer

No, there is no inverse function matrix in GLSL ES 1.00 (used in OpenGL ES 2.0). You will need to do this manually, see for example. here . But you should think about whether you really need to do this in the shader for each top or each fragment on each frame, or whether it can be pre-computed and transferred as a homogeneous one.

+5
source

Source: https://habr.com/ru/post/1533388/


All Articles