diff --git a/src/gl/shaders/default.vert b/src/gl/shaders/default.vert index 77a07e9..fa14fad 100644 --- a/src/gl/shaders/default.vert +++ b/src/gl/shaders/default.vert @@ -1,20 +1,20 @@ void main( float3 in_pos, float3 in_normal, - float4 in_color, - float2 in_tex0, + fixed4 in_color, + half2 in_tex0, uniform float4x4 u_wvp, uniform float4x4 u_world, - uniform float4 u_ambLight, - uniform float4 u_surfProps, - uniform float4 u_fogData, - uniform float4 u_matColor, - uniform float4 u_lightParams[MAX_LIGHTS], - uniform float4 u_lightDirection[MAX_LIGHTS], - uniform float4 u_lightColor[MAX_LIGHTS], - float4 out v_color : COLOR0, - float2 out v_tex0 : TEXCOORD0, - float out v_fog : FOG, + uniform half4 u_ambLight, + uniform half4 u_surfProps, + uniform half4 u_fogData, + uniform half4 u_matColor, + uniform half4 u_lightParams[MAX_LIGHTS], + uniform half4 u_lightDirection[MAX_LIGHTS], + uniform half4 u_lightColor[MAX_LIGHTS], + half4 out v_color : COLOR0, + half2 out v_tex0 : TEXCOORD0, + fixed out v_fog : FOG, float4 out gl_Position : POSITION ) { gl_Position = mul(float4(in_pos, 1.0), u_wvp); @@ -25,13 +25,13 @@ void main( v_color = in_color; v_color.rgb += u_ambLight.rgb*surfAmbient; - float3 color = float3(0.0, 0.0, 0.0); + half3 color = half3(0.0, 0.0, 0.0); for(int i = 0; i < MAX_LIGHTS; i++){ if(u_lightParams[i].x == 0.0) break; if(u_lightParams[i].x == 1.0){ // direct - float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); + fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); color += l*u_lightColor[i].rgb; } } diff --git a/src/gl/shaders/default_vs_gl3.inc b/src/gl/shaders/default_vs_gl3.inc index 1818ec2..cff9a80 100644 --- a/src/gl/shaders/default_vs_gl3.inc +++ b/src/gl/shaders/default_vs_gl3.inc @@ -2,20 +2,20 @@ const char *default_vert_src = "void main(\n" " float3 in_pos,\n" " float3 in_normal,\n" -" float4 in_color,\n" -" float2 in_tex0,\n" +" fixed4 in_color,\n" +" half2 in_tex0,\n" " uniform float4x4 u_wvp,\n" " uniform float4x4 u_world,\n" -" uniform float4 u_ambLight,\n" -" uniform float4 u_surfProps,\n" -" uniform float4 u_fogData,\n" -" uniform float4 u_matColor,\n" -" uniform float4 u_lightParams[MAX_LIGHTS],\n" -" uniform float4 u_lightDirection[MAX_LIGHTS],\n" -" uniform float4 u_lightColor[MAX_LIGHTS],\n" -" float4 out v_color : COLOR0,\n" -" float2 out v_tex0 : TEXCOORD0,\n" -" float out v_fog : FOG,\n" +" uniform half4 u_ambLight,\n" +" uniform half4 u_surfProps,\n" +" uniform half4 u_fogData,\n" +" uniform half4 u_matColor,\n" +" uniform half4 u_lightParams[MAX_LIGHTS],\n" +" uniform half4 u_lightDirection[MAX_LIGHTS],\n" +" uniform half4 u_lightColor[MAX_LIGHTS],\n" +" half4 out v_color : COLOR0,\n" +" half2 out v_tex0 : TEXCOORD0,\n" +" fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" " gl_Position = mul(float4(in_pos, 1.0), u_wvp);\n" @@ -26,13 +26,13 @@ const char *default_vert_src = " v_color = in_color;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " \n" -" float3 color = float3(0.0, 0.0, 0.0);\n" +" half3 color = half3(0.0, 0.0, 0.0);\n" " for(int i = 0; i < MAX_LIGHTS; i++){\n" " if(u_lightParams[i].x == 0.0)\n" " break;\n" " if(u_lightParams[i].x == 1.0){\n" " // direct\n" -" float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" +" fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" " color += l*u_lightColor[i].rgb;\n" " }\n" " }\n" diff --git a/src/gl/shaders/header.frag b/src/gl/shaders/header.frag index 08b6d29..5bc249b 100644 --- a/src/gl/shaders/header.frag +++ b/src/gl/shaders/header.frag @@ -3,7 +3,7 @@ #define u_fogRange (u_fogData.z) #define u_fogDisable (u_fogData.w) -void DoAlphaTest(float a, float2 u_alphaRef) +void DoAlphaTest(float a, half2 u_alphaRef) { if(a < u_alphaRef.x || a >= u_alphaRef.y) discard; diff --git a/src/gl/shaders/header.vert b/src/gl/shaders/header.vert index e4b904b..9b86596 100644 --- a/src/gl/shaders/header.vert +++ b/src/gl/shaders/header.vert @@ -9,7 +9,7 @@ #define surfSpecular (u_surfProps.y) #define surfDiffuse (u_surfProps.z) -float DoFog(float w, float4 u_fogData) +fixed DoFog(float w, half4 u_fogData) { return clamp((w - u_fogEnd)*u_fogRange, u_fogDisable, 1.0); } diff --git a/src/gl/shaders/header_fs.inc b/src/gl/shaders/header_fs.inc index f2fb439..3f52a3d 100644 --- a/src/gl/shaders/header_fs.inc +++ b/src/gl/shaders/header_fs.inc @@ -4,7 +4,7 @@ const char *header_frag_src = "#define u_fogRange (u_fogData.z)\n" "#define u_fogDisable (u_fogData.w)\n" -"void DoAlphaTest(float a, float2 u_alphaRef)\n" +"void DoAlphaTest(float a, half2 u_alphaRef)\n" "{\n" " if(a < u_alphaRef.x || a >= u_alphaRef.y)\n" " discard;\n" diff --git a/src/gl/shaders/header_vs.inc b/src/gl/shaders/header_vs.inc index d3bb9e0..381dd5b 100644 --- a/src/gl/shaders/header_vs.inc +++ b/src/gl/shaders/header_vs.inc @@ -10,7 +10,7 @@ const char *header_vert_src = "#define surfSpecular (u_surfProps.y)\n" "#define surfDiffuse (u_surfProps.z)\n" -"float DoFog(float w, float4 u_fogData)\n" +"fixed DoFog(float w, half4 u_fogData)\n" "{\n" " return clamp((w - u_fogEnd)*u_fogRange, u_fogDisable, 1.0);\n" "}\n" diff --git a/src/gl/shaders/im2d.vert b/src/gl/shaders/im2d.vert index 120c7f9..6cb139f 100644 --- a/src/gl/shaders/im2d.vert +++ b/src/gl/shaders/im2d.vert @@ -1,12 +1,12 @@ void main( float4 in_pos, - float4 in_color, - float2 in_tex0, - uniform float4 u_fogData, + half4 in_color, + half2 in_tex0, + uniform half4 u_fogData, uniform float4 u_xform, - float4 out v_color : COLOR0, - float2 out v_tex0 : TEXCOORD0, - float out v_fog : FOG, + half4 out v_color : COLOR0, + half2 out v_tex0 : TEXCOORD0, + fixed out v_fog : FOG, float4 out gl_Position : POSITION ) { gl_Position = in_pos; diff --git a/src/gl/shaders/im2d_gl3.inc b/src/gl/shaders/im2d_gl3.inc index 9a4ebc9..6180068 100644 --- a/src/gl/shaders/im2d_gl3.inc +++ b/src/gl/shaders/im2d_gl3.inc @@ -1,13 +1,13 @@ const char *im2d_vert_src = "void main(\n" " float4 in_pos,\n" -" float4 in_color,\n" -" float2 in_tex0,\n" -" uniform float4 u_fogData,\n" +" half4 in_color,\n" +" half2 in_tex0,\n" +" uniform half4 u_fogData,\n" " uniform float4 u_xform,\n" -" float4 out v_color : COLOR0,\n" -" float2 out v_tex0 : TEXCOORD0,\n" -" float out v_fog : FOG,\n" +" half4 out v_color : COLOR0,\n" +" half2 out v_tex0 : TEXCOORD0,\n" +" fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" " gl_Position = in_pos;\n" diff --git a/src/gl/shaders/im3d.vert b/src/gl/shaders/im3d.vert index ecd833e..cfc1411 100644 --- a/src/gl/shaders/im3d.vert +++ b/src/gl/shaders/im3d.vert @@ -1,13 +1,13 @@ void main( float3 in_pos, - float4 in_color, - float2 in_tex0, - uniform float4 u_fogData, + half4 in_color, + half2 in_tex0, + uniform half4 u_fogData, uniform float4x4 u_wvp, uniform float4x4 u_world, - float4 out v_color : COLOR0, - float2 out v_tex0 : TEXCOORD0, - float out v_fog : FOG, + half4 out v_color : COLOR0, + half2 out v_tex0 : TEXCOORD0, + fixed out v_fog : FOG, float4 out gl_Position : POSITION ) { gl_Position = mul(float4(in_pos, 1.0), u_wvp); diff --git a/src/gl/shaders/im3d_gl3.inc b/src/gl/shaders/im3d_gl3.inc index ca07767..6be9c10 100644 --- a/src/gl/shaders/im3d_gl3.inc +++ b/src/gl/shaders/im3d_gl3.inc @@ -1,14 +1,14 @@ const char *im3d_vert_src = "void main(\n" " float3 in_pos,\n" -" float4 in_color,\n" -" float2 in_tex0,\n" -" uniform float4 u_fogData,\n" +" half4 in_color,\n" +" half2 in_tex0,\n" +" uniform half4 u_fogData,\n" " uniform float4x4 u_wvp,\n" " uniform float4x4 u_world,\n" -" float4 out v_color : COLOR0,\n" -" float2 out v_tex0 : TEXCOORD0,\n" -" float out v_fog : FOG,\n" +" half4 out v_color : COLOR0,\n" +" half2 out v_tex0 : TEXCOORD0,\n" +" fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" " gl_Position = mul(float4(in_pos, 1.0), u_wvp);\n" diff --git a/src/gl/shaders/matfx_env.frag b/src/gl/shaders/matfx_env.frag index 94f52f1..7825fef 100644 --- a/src/gl/shaders/matfx_env.frag +++ b/src/gl/shaders/matfx_env.frag @@ -2,27 +2,27 @@ #define disableFBA (u_fxparams.y) float4 main( - float4 v_color : COLOR0, - float2 v_tex0 : TEXCOORD0, - float2 v_tex1 : TEXCOORD1, - float v_fog : FOG, - uniform float4 u_fogColor, - uniform float2 u_alphaRef, - uniform float4 u_colorClamp, - uniform float2 u_fxparams, + half4 v_color : COLOR0, + half2 v_tex0 : TEXCOORD0, + half2 v_tex1 : TEXCOORD1, + fixed v_fog : FOG, + uniform half4 u_fogColor, + uniform half2 u_alphaRef, + uniform half4 u_colorClamp, + uniform half2 u_fxparams, uniform sampler2D tex0 : TEXUNIT0, uniform sampler2D tex1 : TEXUNIT1 ) { - float4 pass1 = v_color; - float4 envColor = max(pass1, u_colorClamp); - pass1 *= tex2D(tex0, float2(v_tex0.x, 1.0-v_tex0.y)); + half4 pass1 = v_color; + half4 envColor = max(pass1, u_colorClamp); + pass1 *= tex2D(tex0, half2(v_tex0.x, 1.0-v_tex0.y)); - float4 pass2 = envColor*shininess*tex2D(tex1, float2(v_tex1.x, 1.0-v_tex1.y)); + half4 pass2 = envColor*shininess*tex2D(tex1, half2(v_tex1.x, 1.0-v_tex1.y)); pass1.rgb = lerp(u_fogColor.rgb, pass1.rgb, v_fog); - pass2.rgb = lerp(float3(0.0, 0.0, 0.0), pass2.rgb, v_fog); + pass2.rgb = lerp(half3(0.0, 0.0, 0.0), pass2.rgb, v_fog); - float fba = max(pass1.a, disableFBA); + half fba = max(pass1.a, disableFBA); float4 color; color.rgb = pass1.rgb*pass1.a + pass2.rgb*fba; color.a = pass1.a; diff --git a/src/gl/shaders/matfx_env.vert b/src/gl/shaders/matfx_env.vert index 0310f4a..00e2c59 100644 --- a/src/gl/shaders/matfx_env.vert +++ b/src/gl/shaders/matfx_env.vert @@ -1,22 +1,22 @@ void main( float3 in_pos, float3 in_normal, - float4 in_color, - float2 in_tex0, + fixed4 in_color, + half2 in_tex0, uniform float4x4 u_wvp, uniform float4x4 u_world, uniform float4x4 u_texMatrix, - uniform float4 u_ambLight, - uniform float4 u_surfProps, - uniform float4 u_fogData, - uniform float4 u_matColor, - uniform float4 u_lightParams[MAX_LIGHTS], - uniform float4 u_lightDirection[MAX_LIGHTS], - uniform float4 u_lightColor[MAX_LIGHTS], - float4 out v_color : COLOR0, - float2 out v_tex0 : TEXCOORD0, - float2 out v_tex1 : TEXCOORD1, - float out v_fog : FOG, + uniform half4 u_ambLight, + uniform half4 u_surfProps, + uniform half4 u_fogData, + uniform half4 u_matColor, + uniform half4 u_lightParams[MAX_LIGHTS], + uniform half4 u_lightDirection[MAX_LIGHTS], + uniform half4 u_lightColor[MAX_LIGHTS], + half4 out v_color : COLOR0, + half2 out v_tex0 : TEXCOORD0, + half2 out v_tex1 : TEXCOORD1, + fixed out v_fog : FOG, float4 out gl_Position : POSITION ) { gl_Position = mul(float4(in_pos, 1.0), u_wvp); @@ -28,13 +28,13 @@ void main( v_color = in_color; v_color.rgb += u_ambLight.rgb*surfAmbient; - float3 color = float3(0.0, 0.0, 0.0); + half3 color = float3(0.0, 0.0, 0.0); for(int i = 0; i < MAX_LIGHTS; i++){ if(u_lightParams[i].x == 0.0) break; if(u_lightParams[i].x == 1.0){ // direct - float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); + fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); color += l*u_lightColor[i].rgb; } } diff --git a/src/gl/shaders/matfx_gl3.inc b/src/gl/shaders/matfx_gl3.inc index c39df88..b09026e 100644 --- a/src/gl/shaders/matfx_gl3.inc +++ b/src/gl/shaders/matfx_gl3.inc @@ -2,22 +2,22 @@ const char *matfx_env_vert_src = "void main(\n" " float3 in_pos,\n" " float3 in_normal,\n" -" float4 in_color,\n" -" float2 in_tex0,\n" +" fixed4 in_color,\n" +" half2 in_tex0,\n" " uniform float4x4 u_wvp,\n" " uniform float4x4 u_world,\n" " uniform float4x4 u_texMatrix,\n" -" uniform float4 u_ambLight,\n" -" uniform float4 u_surfProps,\n" -" uniform float4 u_fogData,\n" -" uniform float4 u_matColor,\n" -" uniform float4 u_lightParams[MAX_LIGHTS],\n" -" uniform float4 u_lightDirection[MAX_LIGHTS],\n" -" uniform float4 u_lightColor[MAX_LIGHTS],\n" -" float4 out v_color : COLOR0,\n" -" float2 out v_tex0 : TEXCOORD0,\n" -" float2 out v_tex1 : TEXCOORD1,\n" -" float out v_fog : FOG,\n" +" uniform half4 u_ambLight,\n" +" uniform half4 u_surfProps,\n" +" uniform half4 u_fogData,\n" +" uniform half4 u_matColor,\n" +" uniform half4 u_lightParams[MAX_LIGHTS],\n" +" uniform half4 u_lightDirection[MAX_LIGHTS],\n" +" uniform half4 u_lightColor[MAX_LIGHTS],\n" +" half4 out v_color : COLOR0,\n" +" half2 out v_tex0 : TEXCOORD0,\n" +" half2 out v_tex1 : TEXCOORD1,\n" +" fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" " gl_Position = mul(float4(in_pos, 1.0), u_wvp);\n" @@ -29,13 +29,13 @@ const char *matfx_env_vert_src = " v_color = in_color;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " \n" -" float3 color = float3(0.0, 0.0, 0.0);\n" +" half3 color = float3(0.0, 0.0, 0.0);\n" " for(int i = 0; i < MAX_LIGHTS; i++){\n" " if(u_lightParams[i].x == 0.0)\n" " break;\n" " if(u_lightParams[i].x == 1.0){\n" " // direct\n" -" float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" +" fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" " color += l*u_lightColor[i].rgb;\n" " }\n" " }\n" @@ -52,27 +52,27 @@ const char *matfx_env_frag_src = "#define disableFBA (u_fxparams.y)\n" "float4 main(\n" -" float4 v_color : COLOR0,\n" -" float2 v_tex0 : TEXCOORD0,\n" -" float2 v_tex1 : TEXCOORD1,\n" -" float v_fog : FOG,\n" -" uniform float4 u_fogColor,\n" -" uniform float2 u_alphaRef,\n" -" uniform float4 u_colorClamp,\n" -" uniform float2 u_fxparams,\n" +" half4 v_color : COLOR0,\n" +" half2 v_tex0 : TEXCOORD0,\n" +" half2 v_tex1 : TEXCOORD1,\n" +" fixed v_fog : FOG,\n" +" uniform half4 u_fogColor,\n" +" uniform half2 u_alphaRef,\n" +" uniform half4 u_colorClamp,\n" +" uniform half2 u_fxparams,\n" " uniform sampler2D tex0 : TEXUNIT0,\n" " uniform sampler2D tex1 : TEXUNIT1\n" ") {\n" -" float4 pass1 = v_color;\n" -" float4 envColor = max(pass1, u_colorClamp);\n" -" pass1 *= tex2D(tex0, float2(v_tex0.x, 1.0-v_tex0.y));\n" +" half4 pass1 = v_color;\n" +" half4 envColor = max(pass1, u_colorClamp);\n" +" pass1 *= tex2D(tex0, half2(v_tex0.x, 1.0-v_tex0.y));\n" -" float4 pass2 = envColor*shininess*tex2D(tex1, float2(v_tex1.x, 1.0-v_tex1.y));\n" +" half4 pass2 = envColor*shininess*tex2D(tex1, half2(v_tex1.x, 1.0-v_tex1.y));\n" " pass1.rgb = lerp(u_fogColor.rgb, pass1.rgb, v_fog);\n" -" pass2.rgb = lerp(float3(0.0, 0.0, 0.0), pass2.rgb, v_fog);\n" +" pass2.rgb = lerp(half3(0.0, 0.0, 0.0), pass2.rgb, v_fog);\n" " \n" -" float fba = max(pass1.a, disableFBA);\n" +" half fba = max(pass1.a, disableFBA);\n" " float4 color;\n" " color.rgb = pass1.rgb*pass1.a + pass2.rgb*fba;\n" " color.a = pass1.a;\n" diff --git a/src/gl/shaders/simple.frag b/src/gl/shaders/simple.frag index c811869..98279ff 100644 --- a/src/gl/shaders/simple.frag +++ b/src/gl/shaders/simple.frag @@ -1,12 +1,12 @@ float4 main( - float4 v_color : COLOR0, - float2 v_tex0 : TEXCOORD0, - float v_fog : FOG, - uniform float4 u_fogColor, - uniform float2 u_alphaRef, + half4 v_color : COLOR0, + half2 v_tex0 : TEXCOORD0, + fixed v_fog : FOG, + uniform half4 u_fogColor, + uniform half2 u_alphaRef, uniform sampler2D tex0 ) { - float4 color = v_color*tex2D(tex0, float2(v_tex0.x, 1.0-v_tex0.y)); + half4 color = v_color*tex2D(tex0, half2(v_tex0.x, 1.0-v_tex0.y)); color.rgb = lerp(u_fogColor.rgb, color.rgb, v_fog); DoAlphaTest(color.a, u_alphaRef); diff --git a/src/gl/shaders/simple_fs_gl3.inc b/src/gl/shaders/simple_fs_gl3.inc index 702864a..5346daf 100644 --- a/src/gl/shaders/simple_fs_gl3.inc +++ b/src/gl/shaders/simple_fs_gl3.inc @@ -1,13 +1,13 @@ const char *simple_frag_src = "float4 main(\n" -" float4 v_color : COLOR0,\n" -" float2 v_tex0 : TEXCOORD0,\n" -" float v_fog : FOG,\n" -" uniform float4 u_fogColor,\n" -" uniform float2 u_alphaRef,\n" +" half4 v_color : COLOR0,\n" +" half2 v_tex0 : TEXCOORD0,\n" +" fixed v_fog : FOG,\n" +" uniform half4 u_fogColor,\n" +" uniform half2 u_alphaRef,\n" " uniform sampler2D tex0\n" ") {\n" -" float4 color = v_color*tex2D(tex0, float2(v_tex0.x, 1.0-v_tex0.y));\n" +" half4 color = v_color*tex2D(tex0, half2(v_tex0.x, 1.0-v_tex0.y));\n" " color.rgb = lerp(u_fogColor.rgb, color.rgb, v_fog);\n" " DoAlphaTest(color.a, u_alphaRef);\n" " \n" diff --git a/src/gl/shaders/skin.vert b/src/gl/shaders/skin.vert index 781712f..982a9e1 100644 --- a/src/gl/shaders/skin.vert +++ b/src/gl/shaders/skin.vert @@ -1,23 +1,23 @@ void main( float3 in_pos, float3 in_normal, - float4 in_color, - float2 in_tex0, + fixed4 in_color, + half2 in_tex0, float4 in_weights, - float4 in_indices, + fixed4 in_indices, uniform float4x4 u_wvp, uniform float4x4 u_world, - uniform float4 u_ambLight, - uniform float4 u_surfProps, - uniform float4 u_fogData, - uniform float4 u_matColor, - uniform float4 u_lightParams[MAX_LIGHTS], - uniform float4 u_lightDirection[MAX_LIGHTS], - uniform float4 u_lightColor[MAX_LIGHTS], + uniform half4 u_ambLight, + uniform half4 u_surfProps, + uniform half4 u_fogData, + uniform half4 u_matColor, + uniform half4 u_lightParams[MAX_LIGHTS], + uniform half4 u_lightDirection[MAX_LIGHTS], + uniform half4 u_lightColor[MAX_LIGHTS], uniform float4x4 u_boneMatrices[64], - float4 out v_color : COLOR0, - float2 out v_tex0 : TEXCOORD0, - float out v_fog : FOG, + half4 out v_color : COLOR0, + half2 out v_tex0 : TEXCOORD0, + fixed out v_fog : FOG, float4 out gl_Position : POSITION ) { float3 SkinVertex = float3(0.0, 0.0, 0.0); @@ -35,13 +35,13 @@ void main( v_color = in_color; v_color.rgb += u_ambLight.rgb*surfAmbient; - float3 color = float3(0.0, 0.0, 0.0); + half3 color = half3(0.0, 0.0, 0.0); for(int i = 0; i < MAX_LIGHTS; i++){ if(u_lightParams[i].x == 0.0) break; if(u_lightParams[i].x == 1.0){ // direct - float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); + fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz)); color += l*u_lightColor[i].rgb; } } diff --git a/src/gl/shaders/skin_gl3.inc b/src/gl/shaders/skin_gl3.inc index e0396d2..d41d848 100644 --- a/src/gl/shaders/skin_gl3.inc +++ b/src/gl/shaders/skin_gl3.inc @@ -2,23 +2,23 @@ const char *skin_vert_src = "void main(\n" " float3 in_pos,\n" " float3 in_normal,\n" -" float4 in_color,\n" -" float2 in_tex0,\n" +" fixed4 in_color,\n" +" half2 in_tex0,\n" " float4 in_weights,\n" -" float4 in_indices,\n" +" fixed4 in_indices,\n" " uniform float4x4 u_wvp,\n" " uniform float4x4 u_world,\n" -" uniform float4 u_ambLight,\n" -" uniform float4 u_surfProps,\n" -" uniform float4 u_fogData,\n" -" uniform float4 u_matColor,\n" -" uniform float4 u_lightParams[MAX_LIGHTS],\n" -" uniform float4 u_lightDirection[MAX_LIGHTS],\n" -" uniform float4 u_lightColor[MAX_LIGHTS],\n" +" uniform half4 u_ambLight,\n" +" uniform half4 u_surfProps,\n" +" uniform half4 u_fogData,\n" +" uniform half4 u_matColor,\n" +" uniform half4 u_lightParams[MAX_LIGHTS],\n" +" uniform half4 u_lightDirection[MAX_LIGHTS],\n" +" uniform half4 u_lightColor[MAX_LIGHTS],\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" +" half4 out v_color : COLOR0,\n" +" half2 out v_tex0 : TEXCOORD0,\n" +" fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" " float3 SkinVertex = float3(0.0, 0.0, 0.0);\n" @@ -36,13 +36,13 @@ const char *skin_vert_src = " v_color = in_color;\n" " v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " \n" -" float3 color = float3(0.0, 0.0, 0.0);\n" +" half3 color = half3(0.0, 0.0, 0.0);\n" " for(int i = 0; i < MAX_LIGHTS; i++){\n" " if(u_lightParams[i].x == 0.0)\n" " break;\n" " if(u_lightParams[i].x == 1.0){\n" " // direct\n" -" float l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" +" fixed l = max(0.0, dot(Normal, -u_lightDirection[i].xyz));\n" " color += l*u_lightColor[i].rgb;\n" " }\n" " }\n"