summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-07-25 12:23:57 -0300
committerGitHub <noreply@github.com>2018-07-25 12:23:57 -0300
commit41a0ecb59b244ee01ece644107f02c64d2a5b64a (patch)
tree3ad9f1584a332042defdb0cf5f0b57152e5fa154 /servers
parent95d9302248edb3ddf6b08d23084ee928c41546c4 (diff)
parentca0a6c3fca1ee753050de474e4f6eb4ca71171a5 (diff)
Merge pull request #20449 from Chaosus/matrix_conversion
Added conversions between matrixes in shaders
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/shader_language.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index fd1eb77143..146f0235a6 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1376,6 +1376,15 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
{ "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID } },
{ "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } },
+ //conversion between matrixes
+
+ { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID } },
+ { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID } },
+ { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID } },
+ { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID } },
+ { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID } },
+ { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID } },
+
//builtins - trigonometry
{ "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } },