inverse matrix in gles2 shader (3.1 alpha)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TobiLa

Hi,

I’ve learned from this issue ( GLES2 fragment shader compilation failed errors on project start · Issue #23588 · godotengine/godot · GitHub ) that the function inverse() is not supported on gles2.

So how do I calculate the inverse matrix of INV_CAMERA_MATRIX in a shader script without it?

Thanks in advance,
Tobi

:bust_in_silhouette: Reply From: SIsilicon

Since you don’t have access to a built-in inverse function, your best bet is to create a function yourself. You can port some glsl code from here.