diff --git a/src/gl/shaders/default.vert b/src/gl/shaders/default.vert index 11b2d8d..79126fd 100644 --- a/src/gl/shaders/default.vert +++ b/src/gl/shaders/default.vert @@ -18,9 +18,9 @@ void main( float out v_fog : FOG, float4 out gl_Position : POSITION ) { - float4 Vertex = u_world * float4(in_pos, 1.0); - gl_Position = u_proj * u_view * Vertex; - float3 Normal = float3x3(u_world) * in_normal; + float4 Vertex = mul(u_world, float4(in_pos, 1.0)); + gl_Position = mul(u_proj, mul(u_view, Vertex)); + float3 Normal = mul(float3x3(u_world), in_normal); v_tex0 = in_tex0; diff --git a/src/gl/shaders/default_vs_gl3.inc b/src/gl/shaders/default_vs_gl3.inc index e2f4004..064b3d0 100644 --- a/src/gl/shaders/default_vs_gl3.inc +++ b/src/gl/shaders/default_vs_gl3.inc @@ -19,9 +19,9 @@ const char *default_vert_src = " float out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" -" float4 Vertex = u_world * float4(in_pos, 1.0);\n" -" gl_Position = u_proj * u_view * Vertex;\n" -" float3 Normal = float3x3(u_world) * in_normal;\n" +" float4 Vertex = mul(u_world, float4(in_pos, 1.0));\n" +" gl_Position = mul(u_proj, mul(u_view, Vertex));\n" +" float3 Normal = mul(float3x3(u_world), in_normal);\n" " v_tex0 = in_tex0;\n" diff --git a/src/gl/shaders/im3d.vert b/src/gl/shaders/im3d.vert index 56ac104..7368f3e 100644 --- a/src/gl/shaders/im3d.vert +++ b/src/gl/shaders/im3d.vert @@ -11,9 +11,9 @@ void main( float out v_fog : FOG, float4 out gl_Position : POSITION ) { - float4 Vertex = u_world * float4(in_pos, 1.0); - float4 CamVertex = u_view * Vertex; - gl_Position = u_proj * CamVertex; + float4 Vertex = mul(u_world, float4(in_pos, 1.0)); + float4 CamVertex = mul(u_view, Vertex); + gl_Position = mul(u_proj, CamVertex); v_color = in_color; v_tex0 = in_tex0; v_fog = DoFog(gl_Position.w, u_fogData); diff --git a/src/gl/shaders/im3d_gl3.inc b/src/gl/shaders/im3d_gl3.inc index 5192409..54ceea4 100644 --- a/src/gl/shaders/im3d_gl3.inc +++ b/src/gl/shaders/im3d_gl3.inc @@ -12,9 +12,9 @@ const char *im3d_vert_src = " float out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" -" float4 Vertex = u_world * float4(in_pos, 1.0);\n" -" float4 CamVertex = u_view * Vertex;\n" -" gl_Position = u_proj * CamVertex;\n" +" float4 Vertex = mul(u_world, float4(in_pos, 1.0));\n" +" float4 CamVertex = mul(u_view, Vertex);\n" +" gl_Position = mul(u_proj, CamVertex);\n" " v_color = in_color;\n" " v_tex0 = in_tex0;\n" " v_fog = DoFog(gl_Position.w, u_fogData);\n" diff --git a/src/gl/shaders/matfx_env.vert b/src/gl/shaders/matfx_env.vert index f6141e6..79a69d5 100644 --- a/src/gl/shaders/matfx_env.vert +++ b/src/gl/shaders/matfx_env.vert @@ -20,9 +20,9 @@ void main( float out v_fog : FOG, float4 out gl_Position : POSITION ) { - float4 Vertex = u_world * float4(in_pos, 1.0); - gl_Position = u_proj * u_view * Vertex; - float3 Normal = float3x3(u_world) * in_normal; + float4 Vertex = mul(u_world, float4(in_pos, 1.0)); + gl_Position = mul(u_proj, mul(u_view, Vertex)); + float3 Normal = mul(float3x3(u_world), in_normal); v_tex0 = in_tex0; v_tex1 = (u_texMatrix * float4(Normal, 1.0)).xy; diff --git a/src/gl/shaders/matfx_gl3.inc b/src/gl/shaders/matfx_gl3.inc index bcc065c..83c9e77 100644 --- a/src/gl/shaders/matfx_gl3.inc +++ b/src/gl/shaders/matfx_gl3.inc @@ -21,9 +21,9 @@ const char *matfx_env_vert_src = " float out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" -" float4 Vertex = u_world * float4(in_pos, 1.0);\n" -" gl_Position = u_proj * u_view * Vertex;\n" -" float3 Normal = float3x3(u_world) * in_normal;\n" +" float4 Vertex = mul(u_world, float4(in_pos, 1.0));\n" +" gl_Position = mul(u_proj, mul(u_view, Vertex));\n" +" float3 Normal = mul(float3x3(u_world), in_normal);\n" " v_tex0 = in_tex0;\n" " v_tex1 = (u_texMatrix * float4(Normal, 1.0)).xy;\n" diff --git a/src/gl/shaders/simple_fs_gl3.inc b/src/gl/shaders/simple_fs_gl3.inc index ee2a92b..6ebed07 100644 --- a/src/gl/shaders/simple_fs_gl3.inc +++ b/src/gl/shaders/simple_fs_gl3.inc @@ -11,4 +11,6 @@ const char *simple_frag_src = " DoAlphaTest(color.a, u_alphaRef);\n" " \n" " return color;\n" -"}\n"; +"}\n" + +; diff --git a/src/gl/shaders/skin.vert b/src/gl/shaders/skin.vert index 0561216..a9c4678 100644 --- a/src/gl/shaders/skin.vert +++ b/src/gl/shaders/skin.vert @@ -16,7 +16,7 @@ void main( uniform float4 u_lightParams[MAX_LIGHTS], uniform float4 u_lightDirection[MAX_LIGHTS], uniform float4 u_lightColor[MAX_LIGHTS], - uniform float4x3 u_boneMatrices[64], + uniform float4x4 u_boneMatrices[64], float4 out v_color : COLOR0, float2 out v_tex0 : TEXCOORD0, float out v_fog : FOG, @@ -29,9 +29,9 @@ void main( SkinNormal += (float3x3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i]; } - float4 Vertex = u_world * float4(SkinVertex, 1.0); - gl_Position = u_proj * u_view * Vertex; - float3 Normal = mat3(u_world) * SkinNormal; + float4 Vertex = mul(u_world, float4(SkinVertex, 1.0)); + gl_Position = u_proj * mul(u_view, Vertex); + float3 Normal = mul(float3x3(u_world), SkinNormal); v_tex0 = in_tex0; diff --git a/src/gl/shaders/skin_gl3.inc b/src/gl/shaders/skin_gl3.inc index 8b5e73d..70f847a 100644 --- a/src/gl/shaders/skin_gl3.inc +++ b/src/gl/shaders/skin_gl3.inc @@ -17,7 +17,7 @@ const char *skin_vert_src = " uniform float4 u_lightParams[MAX_LIGHTS],\n" " uniform float4 u_lightDirection[MAX_LIGHTS],\n" " uniform float4 u_lightColor[MAX_LIGHTS],\n" -" uniform float4x3 u_boneMatrices[64],\n" +" uniform float4x4 u_boneMatrices[64],\n" " float4 out v_color : COLOR0,\n" " float2 out v_tex0 : TEXCOORD0,\n" " float out v_fog : FOG,\n" @@ -30,9 +30,9 @@ const char *skin_vert_src = " SkinNormal += (float3x3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];\n" " }\n" -" float4 Vertex = u_world * float4(SkinVertex, 1.0);\n" -" gl_Position = u_proj * u_view * Vertex;\n" -" float3 Normal = mat3(u_world) * SkinNormal;\n" +" float4 Vertex = mul(u_world, float4(SkinVertex, 1.0));\n" +" gl_Position = u_proj * mul(u_view, Vertex);\n" +" float3 Normal = mul(float3x3(u_world), SkinNormal);\n" " v_tex0 = in_tex0;\n"