summaryrefslogtreecommitdiff
path: root/src/extras/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/extras/shaders')
-rw-r--r--src/extras/shaders/Makefile121
-rw-r--r--src/extras/shaders/leedsDefault.frag (renamed from src/extras/shaders/leedsVehicle_blend.frag)24
-rw-r--r--src/extras/shaders/leedsDefault.vert51
-rw-r--r--src/extras/shaders/leedsDefault_PS_x.hlsl (renamed from src/extras/shaders/leedsVehicle_add_PS.hlsl)25
-rw-r--r--src/extras/shaders/leedsDefault_VS_x.hlsl (renamed from src/extras/shaders/leedsVehicle_VS.hlsl)29
-rw-r--r--src/extras/shaders/leedsVehicle.vert27
-rw-r--r--src/extras/shaders/leedsVehicle_add.frag32
-rw-r--r--src/extras/shaders/leedsVehicle_add_PS.csobin496 -> 0 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_add_PS.inc44
-rw-r--r--src/extras/shaders/leedsVehicle_add_gl.inc34
-rw-r--r--src/extras/shaders/leedsVehicle_blend_PS.csobin572 -> 0 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_blend_PS.hlsl33
-rw-r--r--src/extras/shaders/leedsVehicle_blend_PS.inc50
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_PS.csobin728 -> 0 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_PS.hlsl6
-rw-r--r--src/extras/shaders/leedsVehicle_vs_gl.inc29
-rw-r--r--src/extras/shaders/make.cmd3
-rw-r--r--src/extras/shaders/make_glsl.sh9
-rw-r--r--src/extras/shaders/make_hlsl.cmd7
-rw-r--r--src/extras/shaders/makeinc_glsl.sh6
-rw-r--r--src/extras/shaders/makeinc_hlsl.sh (renamed from src/extras/shaders/makeinc.sh)1
-rw-r--r--src/extras/shaders/obj/colourfilterLCS_PS.cso (renamed from src/extras/shaders/colourfilterLCS_PS.cso)bin292 -> 292 bytes
-rw-r--r--src/extras/shaders/obj/colourfilterLCS_PS.inc (renamed from src/extras/shaders/colourfilterLCS_PS.inc)0
-rw-r--r--src/extras/shaders/obj/colourfilterLCS_frag.inc (renamed from src/extras/shaders/colourfilterLCS_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/contrastPS.cso (renamed from src/extras/shaders/contrastPS.cso)bin344 -> 344 bytes
-rw-r--r--src/extras/shaders/obj/contrastPS.inc (renamed from src/extras/shaders/contrastPS.inc)0
-rw-r--r--src/extras/shaders/obj/contrast_frag.inc (renamed from src/extras/shaders/contrast_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/default_UV2_VS.cso (renamed from src/extras/shaders/default_UV2_VS.cso)bin628 -> 628 bytes
-rw-r--r--src/extras/shaders/obj/default_UV2_VS.inc (renamed from src/extras/shaders/default_UV2_VS.inc)0
-rw-r--r--src/extras/shaders/obj/default_UV2_vert.inc (renamed from src/extras/shaders/default_UV2_gl.inc)0
-rw-r--r--src/extras/shaders/obj/im2d_UV2_vert.inc (renamed from src/extras/shaders/im2d_UV2_gl.inc)0
-rw-r--r--src/extras/shaders/obj/im2d_vert.inc (renamed from src/extras/shaders/im2d_gl.inc)0
-rw-r--r--src/extras/shaders/obj/leedsBuilding_VS.cso (renamed from src/extras/shaders/leedsBuilding_VS.cso)bin652 -> 652 bytes
-rw-r--r--src/extras/shaders/obj/leedsBuilding_VS.inc (renamed from src/extras/shaders/leedsBuilding_VS.inc)0
-rw-r--r--src/extras/shaders/obj/leedsBuilding_mobile_VS.cso (renamed from src/extras/shaders/leedsBuilding_mobile_VS.cso)bin808 -> 808 bytes
-rw-r--r--src/extras/shaders/obj/leedsBuilding_mobile_VS.inc (renamed from src/extras/shaders/leedsBuilding_mobile_VS.inc)0
-rw-r--r--src/extras/shaders/obj/leedsBuilding_mobile_vert.inc (renamed from src/extras/shaders/leedsBuilding_mobile_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/leedsBuilding_vert.inc (renamed from src/extras/shaders/leedsBuilding_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/leedsDefault_ADD_PS.csobin0 -> 532 bytes
-rw-r--r--src/extras/shaders/obj/leedsDefault_ADD_PS.inc47
-rw-r--r--src/extras/shaders/obj/leedsDefault_BLEND_PS.csobin0 -> 608 bytes
-rw-r--r--src/extras/shaders/obj/leedsDefault_BLEND_PS.inc53
-rw-r--r--src/extras/shaders/obj/leedsDefault_ENV_VS.cso (renamed from src/extras/shaders/leedsVehicle_VS.cso)bin1204 -> 1204 bytes
-rw-r--r--src/extras/shaders/obj/leedsDefault_ENV_VS.inc (renamed from src/extras/shaders/leedsVehicle_VS.inc)2
-rw-r--r--src/extras/shaders/obj/leedsDefault_frag.inc (renamed from src/extras/shaders/leedsVehicle_blend_gl.inc)26
-rw-r--r--src/extras/shaders/obj/leedsDefault_vert.inc53
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_PS.csobin0 -> 728 bytes
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_PS.inc (renamed from src/extras/shaders/leedsVehicle_mobile_PS.inc)20
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_VS.cso (renamed from src/extras/shaders/leedsVehicle_mobile_VS.cso)bin1556 -> 1556 bytes
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_VS.inc (renamed from src/extras/shaders/leedsVehicle_mobile_VS.inc)0
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_frag.inc (renamed from src/extras/shaders/leedsVehicle_mobile_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/leedsVehicle_mobile_vert.inc (renamed from src/extras/shaders/leedsVehicle_mobile_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_PS.cso (renamed from src/extras/shaders/neoGloss_PS.cso)bin444 -> 444 bytes
-rw-r--r--src/extras/shaders/obj/neoGloss_PS.inc (renamed from src/extras/shaders/neoGloss_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_VS.cso (renamed from src/extras/shaders/neoGloss_VS.cso)bin764 -> 764 bytes
-rw-r--r--src/extras/shaders/obj/neoGloss_VS.inc (renamed from src/extras/shaders/neoGloss_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_frag.inc (renamed from src/extras/shaders/neoGloss_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_vert.inc (renamed from src/extras/shaders/neoGloss_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoRimSkin_VS.cso (renamed from src/extras/shaders/neoRimSkin_VS.cso)bin2404 -> 2404 bytes
-rw-r--r--src/extras/shaders/obj/neoRimSkin_VS.inc (renamed from src/extras/shaders/neoRimSkin_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoRimSkin_vert.inc (renamed from src/extras/shaders/neoRimSkin_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoRim_VS.cso (renamed from src/extras/shaders/neoRim_VS.cso)bin1384 -> 1384 bytes
-rw-r--r--src/extras/shaders/obj/neoRim_VS.inc (renamed from src/extras/shaders/neoRim_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoRim_vert.inc (renamed from src/extras/shaders/neoRim_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_PS.cso (renamed from src/extras/shaders/neoVehicle_PS.cso)bin476 -> 476 bytes
-rw-r--r--src/extras/shaders/obj/neoVehicle_PS.inc (renamed from src/extras/shaders/neoVehicle_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_VS.cso (renamed from src/extras/shaders/neoVehicle_VS.cso)bin1896 -> 1896 bytes
-rw-r--r--src/extras/shaders/obj/neoVehicle_VS.inc (renamed from src/extras/shaders/neoVehicle_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_frag.inc (renamed from src/extras/shaders/neoVehicle_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_vert.inc (renamed from src/extras/shaders/neoVehicle_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoWorldVC_PS.cso (renamed from src/extras/shaders/neoWorldVC_PS.cso)bin524 -> 524 bytes
-rw-r--r--src/extras/shaders/obj/neoWorldVC_PS.inc (renamed from src/extras/shaders/neoWorldVC_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoWorldVC_frag.inc (renamed from src/extras/shaders/neoWorldVC_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/scale_PS.cso (renamed from src/extras/shaders/scale_PS.cso)bin368 -> 348 bytes
-rw-r--r--src/extras/shaders/obj/scale_PS.inc (renamed from src/extras/shaders/scale_PS.inc)14
-rw-r--r--src/extras/shaders/obj/scale_frag.inc (renamed from src/extras/shaders/scale_fs_gl.inc)1
-rw-r--r--src/extras/shaders/obj/screenDroplet_PS.cso (renamed from src/extras/shaders/screenDroplet_PS.cso)bin324 -> 324 bytes
-rw-r--r--src/extras/shaders/obj/screenDroplet_PS.inc (renamed from src/extras/shaders/screenDroplet_PS.inc)0
-rw-r--r--src/extras/shaders/obj/screenDroplet_frag.inc (renamed from src/extras/shaders/screenDroplet_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/simple_frag.inc (renamed from src/extras/shaders/simple_fs_gl.inc)0
-rw-r--r--src/extras/shaders/scale.frag1
-rw-r--r--src/extras/shaders/scale_PS.hlsl4
82 files changed, 340 insertions, 412 deletions
diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile
deleted file mode 100644
index 393ab660..00000000
--- a/src/extras/shaders/Makefile
+++ /dev/null
@@ -1,121 +0,0 @@
-all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \
- colourfilterLCS_fs_gl.inc contrast_fs_gl.inc \
- neoRim_gl.inc neoRimSkin_gl.inc \
- neoWorldVC_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \
- neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc \
- im2d_UV2_gl.inc screenDroplet_fs_gl.inc \
- leedsBuilding_vs_gl.inc leedsBuilding_mobile_vs_gl.inc scale_fs_gl.inc \
- leedsVehicle_vs_gl.inc leedsVehicle_add_gl.inc leedsVehicle_blend_gl.inc \
- leedsVehicle_mobile_vs_gl.inc leedsVehicle_mobile_fs_gl.inc
-
-im2d_gl.inc: im2d.vert
- (echo 'const char *im2d_vert_src =';\
- sed 's/..*/"&\\n"/' im2d.vert;\
- echo ';') >im2d_gl.inc
-
-colourfilterLCS_fs_gl.inc: colourfilterLCS.frag
- (echo 'const char *colourfilterLCS_frag_src =';\
- sed 's/..*/"&\\n"/' colourfilterLCS.frag;\
- echo ';') >colourfilterLCS_fs_gl.inc
-simple_fs_gl.inc: simple.frag
- (echo 'const char *simple_frag_src =';\
- sed 's/..*/"&\\n"/' simple.frag;\
- echo ';') >simple_fs_gl.inc
-
-default_UV2_gl.inc: default_UV2.vert
- (echo 'const char *default_UV2_vert_src =';\
- sed 's/..*/"&\\n"/' default_UV2.vert;\
- echo ';') >default_UV2_gl.inc
-
-
-
-contrast_fs_gl.inc: contrast.frag
- (echo 'const char *contrast_frag_src =';\
- sed 's/..*/"&\\n"/' contrast.frag;\
- echo ';') >contrast_fs_gl.inc
-
-
-neoRim_gl.inc: neoRim.vert
- (echo 'const char *neoRim_vert_src =';\
- sed 's/..*/"&\\n"/' neoRim.vert;\
- echo ';') >neoRim_gl.inc
-
-neoRimSkin_gl.inc: neoRimSkin.vert
- (echo 'const char *neoRimSkin_vert_src =';\
- sed 's/..*/"&\\n"/' neoRimSkin.vert;\
- echo ';') >neoRimSkin_gl.inc
-
-neoWorldVC_fs_gl.inc: neoWorldVC.frag
- (echo 'const char *neoWorldVC_frag_src =';\
- sed 's/..*/"&\\n"/' neoWorldVC.frag;\
- echo ';') >neoWorldVC_fs_gl.inc
-
-neoGloss_fs_gl.inc: neoGloss.frag
- (echo 'const char *neoGloss_frag_src =';\
- sed 's/..*/"&\\n"/' neoGloss.frag;\
- echo ';') >neoGloss_fs_gl.inc
-
-neoGloss_vs_gl.inc: neoGloss.vert
- (echo 'const char *neoGloss_vert_src =';\
- sed 's/..*/"&\\n"/' neoGloss.vert;\
- echo ';') >neoGloss_vs_gl.inc
-
-neoVehicle_vs_gl.inc: neoVehicle.vert
- (echo 'const char *neoVehicle_vert_src =';\
- sed 's/..*/"&\\n"/' neoVehicle.vert;\
- echo ';') >neoVehicle_vs_gl.inc
-
-neoVehicle_fs_gl.inc: neoVehicle.frag
- (echo 'const char *neoVehicle_frag_src =';\
- sed 's/..*/"&\\n"/' neoVehicle.frag;\
- echo ';') >neoVehicle_fs_gl.inc
-
-im2d_UV2_gl.inc: im2d_UV2.vert
- (echo 'const char *im2d_UV2_vert_src =';\
- sed 's/..*/"&\\n"/' im2d_UV2.vert;\
- echo ';') >im2d_UV2_gl.inc
-
-screenDroplet_fs_gl.inc: screenDroplet.frag
- (echo 'const char *screenDroplet_frag_src =';\
- sed 's/..*/"&\\n"/' screenDroplet.frag;\
- echo ';') >screenDroplet_fs_gl.inc
-
-leedsBuilding_vs_gl.inc: leedsBuilding.vert
- (echo 'const char *leedsBuilding_vert_src =';\
- sed 's/..*/"&\\n"/' leedsBuilding.vert;\
- echo ';') >leedsBuilding_vs_gl.inc
-
-leedsBuilding_mobile_vs_gl.inc: leedsBuilding_mobile.vert
- (echo 'const char *leedsBuilding_mobile_vert_src =';\
- sed 's/..*/"&\\n"/' leedsBuilding_mobile.vert;\
- echo ';') >leedsBuilding_mobile_vs_gl.inc
-
-scale_fs_gl.inc: scale.frag
- (echo 'const char *scale_frag_src =';\
- sed 's/..*/"&\\n"/' scale.frag;\
- echo ';') >scale_fs_gl.inc
-
-leedsVehicle_vs_gl.inc: leedsVehicle.vert
- (echo 'const char *leedsVehicle_vert_src =';\
- sed 's/..*/"&\\n"/' leedsVehicle.vert;\
- echo ';') >leedsVehicle_vs_gl.inc
-
-leedsVehicle_add_gl.inc: leedsVehicle_add.frag
- (echo 'const char *leedsVehicle_add_frag_src =';\
- sed 's/..*/"&\\n"/' leedsVehicle_add.frag;\
- echo ';') >leedsVehicle_add_gl.inc
-
-leedsVehicle_blend_gl.inc: leedsVehicle_blend.frag
- (echo 'const char *leedsVehicle_blend_frag_src =';\
- sed 's/..*/"&\\n"/' leedsVehicle_blend.frag;\
- echo ';') >leedsVehicle_blend_gl.inc
-
-leedsVehicle_mobile_vs_gl.inc: leedsVehicle_mobile.vert
- (echo 'const char *leedsVehicle_mobile_vert_src =';\
- sed 's/..*/"&\\n"/' leedsVehicle_mobile.vert;\
- echo ';') >leedsVehicle_mobile_vs_gl.inc
-
-leedsVehicle_mobile_fs_gl.inc: leedsVehicle_mobile.frag
- (echo 'const char *leedsVehicle_mobile_frag_src =';\
- sed 's/..*/"&\\n"/' leedsVehicle_mobile.frag;\
- echo ';') >leedsVehicle_mobile_fs_gl.inc
diff --git a/src/extras/shaders/leedsVehicle_blend.frag b/src/extras/shaders/leedsDefault.frag
index a3fab072..3955e6a5 100644
--- a/src/extras/shaders/leedsVehicle_blend.frag
+++ b/src/extras/shaders/leedsDefault.frag
@@ -2,29 +2,45 @@ uniform sampler2D tex0;
uniform sampler2D tex1;
uniform float u_fxparams;
+uniform vec4 u_colorscale;
#define shininess (u_fxparams)
FSIN vec4 v_color;
FSIN vec2 v_tex0;
+#if defined(PASS_BLEND) || defined(PASS_ADD)
FSIN vec2 v_tex1;
+#endif
FSIN float v_fog;
void
main(void)
{
- vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
+ vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;
+ pass1.rgb = clamp(pass1.rgb, 0.0, 1.0);
+ pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);
+
+ vec4 color;
+#if defined(PASS_BLEND) || defined(PASS_ADD)
vec4 pass2 = texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));
pass2.a *= shininess;
-
- pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);
pass2.rgb = mix(vec3(0.0, 0.0, 0.0), pass2.rgb, v_fog);
// We simulate drawing this in two passes.
+#if defined(PASS_ADD)
+ // First pass with standard blending, second with addition
+ // We premultiply alpha so render state should be one.
+ color.rgb = pass1.rgb*pass1.a + pass2.rgb*pass2.a;
+ color.a = pass1.a;
+#elif defined(PASS_BLEND)
// We premultiply alpha so render state should be one.
- vec4 color;
color.rgb = pass1.rgb*pass1.a*(1.0-pass2.a) + pass2.rgb*pass2.a;
color.a = pass1.a*(1.0-pass2.a) + pass2.a;
+#endif
+
+#else
+ color = pass1;
+#endif
DoAlphaTest(color.a);
diff --git a/src/extras/shaders/leedsDefault.vert b/src/extras/shaders/leedsDefault.vert
new file mode 100644
index 00000000..9cb18a66
--- /dev/null
+++ b/src/extras/shaders/leedsDefault.vert
@@ -0,0 +1,51 @@
+#ifdef ENVMAP
+uniform mat4 u_texMatrix;
+#endif
+#ifdef SKIN
+uniform mat4 u_boneMatrices[64];
+#endif
+
+VSIN(ATTRIB_POS) vec3 in_pos;
+
+VSOUT vec4 v_color;
+VSOUT vec2 v_tex0;
+#ifdef ENVMAP
+VSOUT vec2 v_tex1;
+#endif
+VSOUT float v_fog;
+
+void
+main(void)
+{
+#ifdef SKIN
+ vec3 SkinVertex = vec3(0.0, 0.0, 0.0);
+ vec3 SkinNormal = vec3(0.0, 0.0, 0.0);
+ for(int i = 0; i < 4; i++){
+ SkinVertex += (u_boneMatrices[int(in_indices[i])] * vec4(in_pos, 1.0)).xyz * in_weights[i];
+ SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];
+ }
+
+ vec4 Vertex = u_world * vec4(SkinVertex, 1.0);
+ gl_Position = u_proj * u_view * Vertex;
+ vec3 Normal = mat3(u_world) * SkinNormal;
+#else
+ vec4 Vertex = u_world * vec4(in_pos, 1.0);
+ gl_Position = u_proj * u_view * Vertex;
+ vec3 Normal = mat3(u_world) * in_normal;
+#endif
+
+ v_tex0 = in_tex0;
+#ifdef ENVMAP
+ v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;
+#endif
+
+ v_color = in_color;
+ v_color.rgb += u_ambLight.rgb*surfAmbient;
+ v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
+ // PS2 clamps before material color
+ // PSP clamps after...maybe another constant for this?
+ v_color = clamp(v_color, 0.0, 1.0);
+ v_color *= u_matColor;
+
+ v_fog = DoFog(gl_Position.w);
+}
diff --git a/src/extras/shaders/leedsVehicle_add_PS.hlsl b/src/extras/shaders/leedsDefault_PS_x.hlsl
index 943926cf..0b546523 100644
--- a/src/extras/shaders/leedsVehicle_add_PS.hlsl
+++ b/src/extras/shaders/leedsDefault_PS_x.hlsl
@@ -1,7 +1,9 @@
struct VS_out {
float4 Position : POSITION;
float3 TexCoord0 : TEXCOORD0;
+#if defined(PASS_BLEND) || defined(PASS_ADD)
float2 TexCoord1 : TEXCOORD1;
+#endif
float4 Color : COLOR0;
};
@@ -10,25 +12,38 @@ sampler2D envTex : register(s1);
float4 fogColor : register(c0);
-float4 fxparams : register(c1);
+float4 colorscale : register(c1);
+float4 fxparams : register(c2);
#define shininess (fxparams.x)
float4 main(VS_out input) : COLOR
{
- float4 pass1 = input.Color*tex2D(diffTex, input.TexCoord0.xy);
+ float4 pass1 = input.Color*tex2D(diffTex, input.TexCoord0.xy)*colorscale;
+ pass1.rgb = clamp(pass1.rgb, 0.0, 1.0);
+ pass1.rgb = lerp(fogColor.rgb, pass1.rgb, input.TexCoord0.z);
+
+ float4 color;
+#if defined(PASS_BLEND) || defined(PASS_ADD)
float4 pass2 = tex2D(envTex, input.TexCoord1.xy);
pass2.a *= shininess;
-
- pass1.rgb = lerp(fogColor.rgb, pass1.rgb, input.TexCoord0.z);
pass2.rgb = lerp(float3(0.0, 0.0, 0.0), pass2.rgb, input.TexCoord0.z);
// We simulate drawing this in two passes.
+#if defined(PASS_ADD)
// First pass with standard blending, second with addition
// We premultiply alpha so render state should be one.
- float4 color;
color.rgb = pass1.rgb*pass1.a + pass2.rgb*pass2.a;
color.a = pass1.a;
+#elif defined(PASS_BLEND)
+ // We premultiply alpha so render state should be one.
+ color.rgb = pass1.rgb*pass1.a*(1.0-pass2.a) + pass2.rgb*pass2.a;
+ color.a = pass1.a*(1.0-pass2.a) + pass2.a;
+#endif
+
+#else
+ color = pass1;
+#endif
return color;
}
diff --git a/src/extras/shaders/leedsVehicle_VS.hlsl b/src/extras/shaders/leedsDefault_VS_x.hlsl
index eb53313a..58bee097 100644
--- a/src/extras/shaders/leedsVehicle_VS.hlsl
+++ b/src/extras/shaders/leedsDefault_VS_x.hlsl
@@ -1,6 +1,11 @@
#include "standardConstants.h"
+#ifdef ENVMAP
float4x4 texMat : register(c41);
+#endif
+#ifdef SKIN
+float4x3 boneMatrices[64] : register(c41);
+#endif
struct VS_in
{
@@ -8,12 +13,18 @@ struct VS_in
float3 Normal : NORMAL;
float2 TexCoord : TEXCOORD0;
float4 Prelight : COLOR0;
+#ifdef SKIN
+ float4 Weights : BLENDWEIGHT;
+ int4 Indices : BLENDINDICES;
+#endif
};
struct VS_out {
float4 Position : POSITION;
float3 TexCoord0 : TEXCOORD0; // also fog
+#ifdef ENVMAP
float2 TexCoord1 : TEXCOORD1;
+#endif
float4 Color : COLOR0;
};
@@ -22,12 +33,27 @@ VS_out main(in VS_in input)
{
VS_out output;
+#ifdef SKIN
+ int j;
+ float3 SkinVertex = float3(0.0, 0.0, 0.0);
+ float3 SkinNormal = float3(0.0, 0.0, 0.0);
+ for(j = 0; j < 4; j++){
+ SkinVertex += mul(input.Position, boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
+ SkinNormal += mul(input.Normal, (float3x3)boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
+ }
+ output.Position = mul(combinedMat, SkinVertex);
+// float3 V = mul(worldMat, SkinVertex).xyz;
+ float3 N = mul(normalMat, SkinNormal);
+#else
output.Position = mul(combinedMat, input.Position);
- float3 V = mul(worldMat, input.Position).xyz;
+// float3 V = mul(worldMat, input.Position).xyz;
float3 N = mul(normalMat, input.Normal);
+#endif
output.TexCoord0.xy = input.TexCoord;
+#ifdef ENVMAP
output.TexCoord1 = mul(texMat, float4(N, 1.0)).xy;
+#endif
output.Color = input.Prelight;
output.Color.rgb += ambientLight.rgb * surfAmbient;
@@ -36,6 +62,7 @@ VS_out main(in VS_in input)
for(i = 0; i < numDirLights; i++)
output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse;
// PS2 clamps before material color
+ // PSP clamps after...maybe another constant for this?
output.Color = clamp(output.Color, 0.0, 1.0);
output.Color *= matCol;
diff --git a/src/extras/shaders/leedsVehicle.vert b/src/extras/shaders/leedsVehicle.vert
deleted file mode 100644
index b93c7ea0..00000000
--- a/src/extras/shaders/leedsVehicle.vert
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform mat4 u_texMatrix;
-
-VSIN(ATTRIB_POS) vec3 in_pos;
-
-VSOUT vec4 v_color;
-VSOUT vec2 v_tex0;
-VSOUT vec2 v_tex1;
-VSOUT float v_fog;
-
-void
-main(void)
-{
- vec4 Vertex = u_world * vec4(in_pos, 1.0);
- gl_Position = u_proj * u_view * Vertex;
- vec3 Normal = mat3(u_world) * in_normal;
-
- v_tex0 = in_tex0;
- v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;
-
- v_color = in_color;
- v_color.rgb += u_ambLight.rgb*surfAmbient;
- v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
- v_color = clamp(v_color, 0.0, 1.0);
- v_color *= u_matColor;
-
- v_fog = DoFog(gl_Position.w);
-}
diff --git a/src/extras/shaders/leedsVehicle_add.frag b/src/extras/shaders/leedsVehicle_add.frag
deleted file mode 100644
index e9bcef74..00000000
--- a/src/extras/shaders/leedsVehicle_add.frag
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D tex0;
-uniform sampler2D tex1;
-
-uniform float u_fxparams;
-
-#define shininess (u_fxparams)
-
-FSIN vec4 v_color;
-FSIN vec2 v_tex0;
-FSIN vec2 v_tex1;
-FSIN float v_fog;
-
-void
-main(void)
-{
- vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
- vec4 pass2 = texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));
- pass2.a *= shininess;
-
- pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);
- pass2.rgb = mix(vec3(0.0, 0.0, 0.0), pass2.rgb, v_fog);
-
- // We simulate drawing this in two passes.
- // We premultiply alpha so render state should be one.
- vec4 color;
- color.rgb = pass1.rgb*pass1.a + pass2.rgb*pass2.a;
- color.a = pass1.a;
-
- DoAlphaTest(color.a);
-
- FRAGCOLOR(color);
-}
diff --git a/src/extras/shaders/leedsVehicle_add_PS.cso b/src/extras/shaders/leedsVehicle_add_PS.cso
deleted file mode 100644
index 11db8b0e..00000000
--- a/src/extras/shaders/leedsVehicle_add_PS.cso
+++ /dev/null
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_add_PS.inc b/src/extras/shaders/leedsVehicle_add_PS.inc
deleted file mode 100644
index dc8378f4..00000000
--- a/src/extras/shaders/leedsVehicle_add_PS.inc
+++ /dev/null
@@ -1,44 +0,0 @@
-static unsigned char leedsVehicle_add_PS_cso[] = {
- 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x40, 0x00, 0x43, 0x54, 0x41, 0x42,
- 0x1c, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
- 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0xc1, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x84, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00,
- 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xa8, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
- 0x01, 0x00, 0x06, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00, 0x04, 0x00, 0x0c, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x66, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab,
- 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x66, 0x78, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
- 0x00, 0x70, 0x73, 0x5f, 0x32, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0xb0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xb0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x08, 0x0f, 0xa0,
- 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xb0,
- 0x01, 0x08, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80,
- 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03,
- 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0xa0,
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xaa, 0xb0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
- 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
- 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0xa1, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x08, 0x80,
- 0x01, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x90, 0x04, 0x00, 0x00, 0x04,
- 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x01, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80,
- 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0xff, 0xff, 0x00, 0x00
-};
diff --git a/src/extras/shaders/leedsVehicle_add_gl.inc b/src/extras/shaders/leedsVehicle_add_gl.inc
deleted file mode 100644
index a9835b13..00000000
--- a/src/extras/shaders/leedsVehicle_add_gl.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-const char *leedsVehicle_add_frag_src =
-"uniform sampler2D tex0;\n"
-"uniform sampler2D tex1;\n"
-
-"uniform float u_fxparams;\n"
-
-"#define shininess (u_fxparams)\n"
-
-"FSIN vec4 v_color;\n"
-"FSIN vec2 v_tex0;\n"
-"FSIN vec2 v_tex1;\n"
-"FSIN float v_fog;\n"
-
-"void\n"
-"main(void)\n"
-"{\n"
-" vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
-" vec4 pass2 = texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));\n"
-" pass2.a *= shininess;\n"
-
-" pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);\n"
-" pass2.rgb = mix(vec3(0.0, 0.0, 0.0), pass2.rgb, v_fog);\n"
-
-" // We simulate drawing this in two passes.\n"
-" // We premultiply alpha so render state should be one.\n"
-" vec4 color;\n"
-" color.rgb = pass1.rgb*pass1.a + pass2.rgb*pass2.a;\n"
-" color.a = pass1.a;\n"
-
-" DoAlphaTest(color.a);\n"
-
-" FRAGCOLOR(color);\n"
-"}\n"
-;
diff --git a/src/extras/shaders/leedsVehicle_blend_PS.cso b/src/extras/shaders/leedsVehicle_blend_PS.cso
deleted file mode 100644
index 8d104803..00000000
--- a/src/extras/shaders/leedsVehicle_blend_PS.cso
+++ /dev/null
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_blend_PS.hlsl b/src/extras/shaders/leedsVehicle_blend_PS.hlsl
deleted file mode 100644
index e32970b2..00000000
--- a/src/extras/shaders/leedsVehicle_blend_PS.hlsl
+++ /dev/null
@@ -1,33 +0,0 @@
-struct VS_out {
- float4 Position : POSITION;
- float3 TexCoord0 : TEXCOORD0;
- float2 TexCoord1 : TEXCOORD1;
- float4 Color : COLOR0;
-};
-
-sampler2D diffTex : register(s0);
-sampler2D envTex : register(s1);
-
-float4 fogColor : register(c0);
-
-float4 fxparams : register(c1);
-
-#define shininess (fxparams.x)
-
-float4 main(VS_out input) : COLOR
-{
- float4 pass1 = input.Color*tex2D(diffTex, input.TexCoord0.xy);
- float4 pass2 = tex2D(envTex, input.TexCoord1.xy);
- pass2.a *= shininess;
-
- pass1.rgb = lerp(fogColor.rgb, pass1.rgb, input.TexCoord0.z);
- pass2.rgb = lerp(float3(0.0, 0.0, 0.0), pass2.rgb, input.TexCoord0.z);
-
- // We simulate drawing this in two passes.
- // We premultiply alpha so render state should be one.
- float4 color;
- color.rgb = pass1.rgb*pass1.a*(1.0-pass2.a) + pass2.rgb*pass2.a;
- color.a = pass1.a*(1.0-pass2.a) + pass2.a;
-
- return color;
-}
diff --git a/src/extras/shaders/leedsVehicle_blend_PS.inc b/src/extras/shaders/leedsVehicle_blend_PS.inc
deleted file mode 100644
index 94fb000c..00000000
--- a/src/extras/shaders/leedsVehicle_blend_PS.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-static unsigned char leedsVehicle_blend_PS_cso[] = {
- 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x40, 0x00, 0x43, 0x54, 0x41, 0x42,
- 0x1c, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
- 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0xc1, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x84, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00,
- 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xa8, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
- 0x01, 0x00, 0x06, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00, 0x04, 0x00, 0x0c, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x66, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab,
- 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x66, 0x78, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
- 0x00, 0x70, 0x73, 0x5f, 0x32, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0xb0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xb0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x08, 0x0f, 0xa0,
- 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xb0,
- 0x00, 0x08, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80,
- 0x01, 0x00, 0xe4, 0xb0, 0x01, 0x08, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x00, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0xa1, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80,
- 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x90, 0x04, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x00, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
- 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xb0,
- 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80,
- 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x80,
- 0x01, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x08, 0x80,
- 0x01, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0xa0,
- 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80,
- 0x01, 0x00, 0xff, 0x80, 0x02, 0x00, 0xff, 0x80, 0x12, 0x00, 0x00, 0x04,
- 0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0xff, 0x80, 0x01, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80,
- 0x03, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
-};
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.cso b/src/extras/shaders/leedsVehicle_mobile_PS.cso
deleted file mode 100644
index 04ffcf8e..00000000
--- a/src/extras/shaders/leedsVehicle_mobile_PS.cso
+++ /dev/null
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl
index da09b872..a343b32f 100644
--- a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl
+++ b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl
@@ -14,9 +14,9 @@ sampler2D envTex : register(s1);
float4 fogColor : register(c0);
-float4 fxparams : register(c1);
-float3 skyTop : register(c2);
-float3 skyBot : register(c3);
+float4 fxparams : register(c2);
+float3 skyTop : register(c3);
+float3 skyBot : register(c4);
#define shininess (fxparams.x)
diff --git a/src/extras/shaders/leedsVehicle_vs_gl.inc b/src/extras/shaders/leedsVehicle_vs_gl.inc
deleted file mode 100644
index eb36b6e9..00000000
--- a/src/extras/shaders/leedsVehicle_vs_gl.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-const char *leedsVehicle_vert_src =
-"uniform mat4 u_texMatrix;\n"
-
-"VSIN(ATTRIB_POS) vec3 in_pos;\n"
-
-"VSOUT vec4 v_color;\n"
-"VSOUT vec2 v_tex0;\n"
-"VSOUT vec2 v_tex1;\n"
-"VSOUT float v_fog;\n"
-
-"void\n"
-"main(void)\n"
-"{\n"
-" vec4 Vertex = u_world * vec4(in_pos, 1.0);\n"
-" gl_Position = u_proj * u_view * Vertex;\n"
-" vec3 Normal = mat3(u_world) * in_normal;\n"
-
-" v_tex0 = in_tex0;\n"
-" v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;\n"
-
-" v_color = in_color;\n"
-" v_color.rgb += u_ambLight.rgb*surfAmbient;\n"
-" v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
-" v_color = clamp(v_color, 0.0, 1.0);\n"
-" v_color *= u_matColor;\n"
-
-" v_fog = DoFog(gl_Position.w);\n"
-"}\n"
-;
diff --git a/src/extras/shaders/make.cmd b/src/extras/shaders/make.cmd
deleted file mode 100644
index 8404ac6c..00000000
--- a/src/extras/shaders/make.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo %%~nf.cso %%f
-for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo %%~nf.cso %%f
diff --git a/src/extras/shaders/make_glsl.sh b/src/extras/shaders/make_glsl.sh
new file mode 100644
index 00000000..0af98961
--- /dev/null
+++ b/src/extras/shaders/make_glsl.sh
@@ -0,0 +1,9 @@
+#!sh
+for i in *.vert; do
+ echo $i
+ ./makeinc_glsl.sh $i
+done
+for i in *.frag; do
+ echo $i
+ ./makeinc_glsl.sh $i
+done
diff --git a/src/extras/shaders/make_hlsl.cmd b/src/extras/shaders/make_hlsl.cmd
new file mode 100644
index 00000000..ae3aacb9
--- /dev/null
+++ b/src/extras/shaders/make_hlsl.cmd
@@ -0,0 +1,7 @@
+@echo off
+for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
+for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
+
+"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /DENVMAP /Fo obj\leedsDefault_ENV_VS.cso leedsDefault_VS_x.hlsl
+"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /DPASS_ADD /Fo obj\leedsDefault_ADD_PS.cso leedsDefault_PS_x.hlsl
+"%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /DPASS_BLEND /Fo obj\leedsDefault_BLEND_PS.cso leedsDefault_PS_x.hlsl
diff --git a/src/extras/shaders/makeinc_glsl.sh b/src/extras/shaders/makeinc_glsl.sh
new file mode 100644
index 00000000..2bc6a387
--- /dev/null
+++ b/src/extras/shaders/makeinc_glsl.sh
@@ -0,0 +1,6 @@
+#!sh
+ext=${1##*.}
+name=${1%.*}
+(echo "const char *${name}_${ext}_src =";\
+sed 's/..*/"&\\n"/' $1;\
+echo ';') > obj/${name}_${ext}.inc
diff --git a/src/extras/shaders/makeinc.sh b/src/extras/shaders/makeinc_hlsl.sh
index a649af33..a5b12867 100644
--- a/src/extras/shaders/makeinc.sh
+++ b/src/extras/shaders/makeinc_hlsl.sh
@@ -1,4 +1,5 @@
#!sh
+cd obj
for i in *cso; do
(echo -n 'static '
xxd -i $i | grep -v '_len = ') > ${i%cso}inc
diff --git a/src/extras/shaders/colourfilterLCS_PS.cso b/src/extras/shaders/obj/colourfilterLCS_PS.cso
index e5ffa3f1..e5ffa3f1 100644
--- a/src/extras/shaders/colourfilterLCS_PS.cso
+++ b/src/extras/shaders/obj/colourfilterLCS_PS.cso
Binary files differ
diff --git a/src/extras/shaders/colourfilterLCS_PS.inc b/src/extras/shaders/obj/colourfilterLCS_PS.inc
index f9eeab52..f9eeab52 100644
--- a/src/extras/shaders/colourfilterLCS_PS.inc
+++ b/src/extras/shaders/obj/colourfilterLCS_PS.inc
diff --git a/src/extras/shaders/colourfilterLCS_fs_gl.inc b/src/extras/shaders/obj/colourfilterLCS_frag.inc
index 2c8e3532..2c8e3532 100644
--- a/src/extras/shaders/colourfilterLCS_fs_gl.inc
+++ b/src/extras/shaders/obj/colourfilterLCS_frag.inc
diff --git a/src/extras/shaders/contrastPS.cso b/src/extras/shaders/obj/contrastPS.cso
index a87c48d7..a87c48d7 100644
--- a/src/extras/shaders/contrastPS.cso
+++ b/src/extras/shaders/obj/contrastPS.cso
Binary files differ
diff --git a/src/extras/shaders/contrastPS.inc b/src/extras/shaders/obj/contrastPS.inc
index 5386792f..5386792f 100644
--- a/src/extras/shaders/contrastPS.inc
+++ b/src/extras/shaders/obj/contrastPS.inc
diff --git a/src/extras/shaders/contrast_fs_gl.inc b/src/extras/shaders/obj/contrast_frag.inc
index 97f78194..97f78194 100644
--- a/src/extras/shaders/contrast_fs_gl.inc
+++ b/src/extras/shaders/obj/contrast_frag.inc
diff --git a/src/extras/shaders/default_UV2_VS.cso b/src/extras/shaders/obj/default_UV2_VS.cso
index 5a48c663..5a48c663 100644
--- a/src/extras/shaders/default_UV2_VS.cso
+++ b/src/extras/shaders/obj/default_UV2_VS.cso
Binary files differ
diff --git a/src/extras/shaders/default_UV2_VS.inc b/src/extras/shaders/obj/default_UV2_VS.inc
index de832107..de832107 100644
--- a/src/extras/shaders/default_UV2_VS.inc
+++ b/src/extras/shaders/obj/default_UV2_VS.inc
diff --git a/src/extras/shaders/default_UV2_gl.inc b/src/extras/shaders/obj/default_UV2_vert.inc
index 450f3d9a..450f3d9a 100644
--- a/src/extras/shaders/default_UV2_gl.inc
+++ b/src/extras/shaders/obj/default_UV2_vert.inc
diff --git a/src/extras/shaders/im2d_UV2_gl.inc b/src/extras/shaders/obj/im2d_UV2_vert.inc
index 3feb2bc1..3feb2bc1 100644
--- a/src/extras/shaders/im2d_UV2_gl.inc
+++ b/src/extras/shaders/obj/im2d_UV2_vert.inc
diff --git a/src/extras/shaders/im2d_gl.inc b/src/extras/shaders/obj/im2d_vert.inc
index d11f5d33..d11f5d33 100644
--- a/src/extras/shaders/im2d_gl.inc
+++ b/src/extras/shaders/obj/im2d_vert.inc
diff --git a/src/extras/shaders/leedsBuilding_VS.cso b/src/extras/shaders/obj/leedsBuilding_VS.cso
index 6720364d..6720364d 100644
--- a/src/extras/shaders/leedsBuilding_VS.cso
+++ b/src/extras/shaders/obj/leedsBuilding_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsBuilding_VS.inc b/src/extras/shaders/obj/leedsBuilding_VS.inc
index 490a8c01..490a8c01 100644
--- a/src/extras/shaders/leedsBuilding_VS.inc
+++ b/src/extras/shaders/obj/leedsBuilding_VS.inc
diff --git a/src/extras/shaders/leedsBuilding_mobile_VS.cso b/src/extras/shaders/obj/leedsBuilding_mobile_VS.cso
index c3ac2b9b..c3ac2b9b 100644
--- a/src/extras/shaders/leedsBuilding_mobile_VS.cso
+++ b/src/extras/shaders/obj/leedsBuilding_mobile_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsBuilding_mobile_VS.inc b/src/extras/shaders/obj/leedsBuilding_mobile_VS.inc
index 1433ca3f..1433ca3f 100644
--- a/src/extras/shaders/leedsBuilding_mobile_VS.inc
+++ b/src/extras/shaders/obj/leedsBuilding_mobile_VS.inc
diff --git a/src/extras/shaders/leedsBuilding_mobile_vs_gl.inc b/src/extras/shaders/obj/leedsBuilding_mobile_vert.inc
index 56bb8a80..56bb8a80 100644
--- a/src/extras/shaders/leedsBuilding_mobile_vs_gl.inc
+++ b/src/extras/shaders/obj/leedsBuilding_mobile_vert.inc
diff --git a/src/extras/shaders/leedsBuilding_vs_gl.inc b/src/extras/shaders/obj/leedsBuilding_vert.inc
index 33c5eccc..33c5eccc 100644
--- a/src/extras/shaders/leedsBuilding_vs_gl.inc
+++ b/src/extras/shaders/obj/leedsBuilding_vert.inc
diff --git a/src/extras/shaders/obj/leedsDefault_ADD_PS.cso b/src/extras/shaders/obj/leedsDefault_ADD_PS.cso
new file mode 100644
index 00000000..db862fdb
--- /dev/null
+++ b/src/extras/shaders/obj/leedsDefault_ADD_PS.cso
Binary files differ
diff --git a/src/extras/shaders/obj/leedsDefault_ADD_PS.inc b/src/extras/shaders/obj/leedsDefault_ADD_PS.inc
new file mode 100644
index 00000000..7a04522f
--- /dev/null
+++ b/src/extras/shaders/obj/leedsDefault_ADD_PS.inc
@@ -0,0 +1,47 @@
+static unsigned char leedsDefault_ADD_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x47, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xde, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x06, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00, 0xbc, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xd5, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0a, 0x00,
+ 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
+ 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00, 0x04, 0x00, 0x0c, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x66, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x66, 0x78, 0x70,
+ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x70, 0x73, 0x5f, 0x32, 0x5f, 0x30,
+ 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28,
+ 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64,
+ 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20,
+ 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31,
+ 0x31, 0x00, 0xab, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x07, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x01, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x08, 0x0f, 0xa0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x01, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x01, 0x00, 0xe4, 0xb0, 0x01, 0x08, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80,
+ 0x02, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x05, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02,
+ 0x01, 0x00, 0x17, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x12, 0x00, 0x00, 0x04,
+ 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x01, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80,
+ 0x02, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xff, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/obj/leedsDefault_BLEND_PS.cso b/src/extras/shaders/obj/leedsDefault_BLEND_PS.cso
new file mode 100644
index 00000000..e875c795
--- /dev/null
+++ b/src/extras/shaders/obj/leedsDefault_BLEND_PS.cso
Binary files differ
diff --git a/src/extras/shaders/obj/leedsDefault_BLEND_PS.inc b/src/extras/shaders/obj/leedsDefault_BLEND_PS.inc
new file mode 100644
index 00000000..be3a6d96
--- /dev/null
+++ b/src/extras/shaders/obj/leedsDefault_BLEND_PS.inc
@@ -0,0 +1,53 @@
+static unsigned char leedsDefault_BLEND_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x47, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xde, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x06, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00, 0xbc, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xd5, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0a, 0x00,
+ 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
+ 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00, 0x04, 0x00, 0x0c, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x66, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x66, 0x78, 0x70,
+ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x70, 0x73, 0x5f, 0x32, 0x5f, 0x30,
+ 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28,
+ 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64,
+ 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20,
+ 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31,
+ 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0,
+ 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x07, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x01, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x08, 0x0f, 0xa0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x01, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xb0, 0x01, 0x08, 0xe4, 0xa0,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x12, 0x00, 0x00, 0x04,
+ 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x00, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
+ 0x00, 0x00, 0xff, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xaa, 0xb0,
+ 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x80,
+ 0x02, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x08, 0x80,
+ 0x02, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x08, 0x80,
+ 0x01, 0x00, 0xff, 0x80, 0x03, 0x00, 0xff, 0x81, 0x03, 0x00, 0x00, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80,
+ 0x01, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0x80, 0x12, 0x00, 0x00, 0x04,
+ 0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80,
+ 0x03, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/leedsVehicle_VS.cso b/src/extras/shaders/obj/leedsDefault_ENV_VS.cso
index 57db3798..57db3798 100644
--- a/src/extras/shaders/leedsVehicle_VS.cso
+++ b/src/extras/shaders/obj/leedsDefault_ENV_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_VS.inc b/src/extras/shaders/obj/leedsDefault_ENV_VS.inc
index 89527d72..ed27d470 100644
--- a/src/extras/shaders/leedsVehicle_VS.inc
+++ b/src/extras/shaders/obj/leedsDefault_ENV_VS.inc
@@ -1,4 +1,4 @@
-static unsigned char leedsVehicle_VS_cso[] = {
+static unsigned char leedsDefault_ENV_VS_cso[] = {
0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0x8d, 0x00, 0x43, 0x54, 0x41, 0x42,
0x1c, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
0x0a, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
diff --git a/src/extras/shaders/leedsVehicle_blend_gl.inc b/src/extras/shaders/obj/leedsDefault_frag.inc
index 707afb10..312a32a3 100644
--- a/src/extras/shaders/leedsVehicle_blend_gl.inc
+++ b/src/extras/shaders/obj/leedsDefault_frag.inc
@@ -1,31 +1,47 @@
-const char *leedsVehicle_blend_frag_src =
+const char *leedsDefault_frag_src =
"uniform sampler2D tex0;\n"
"uniform sampler2D tex1;\n"
"uniform float u_fxparams;\n"
+"uniform vec4 u_colorscale;\n"
"#define shininess (u_fxparams)\n"
"FSIN vec4 v_color;\n"
"FSIN vec2 v_tex0;\n"
+"#if defined(PASS_BLEND) || defined(PASS_ADD)\n"
"FSIN vec2 v_tex1;\n"
+"#endif\n"
"FSIN float v_fog;\n"
"void\n"
"main(void)\n"
"{\n"
-" vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
+" vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;\n"
+" pass1.rgb = clamp(pass1.rgb, 0.0, 1.0);\n"
+" pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);\n"
+
+" vec4 color;\n"
+"#if defined(PASS_BLEND) || defined(PASS_ADD)\n"
" vec4 pass2 = texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));\n"
" pass2.a *= shininess;\n"
-
-" pass1.rgb = mix(u_fogColor.rgb, pass1.rgb, v_fog);\n"
" pass2.rgb = mix(vec3(0.0, 0.0, 0.0), pass2.rgb, v_fog);\n"
" // We simulate drawing this in two passes.\n"
+"#if defined(PASS_ADD)\n"
+" // First pass with standard blending, second with addition\n"
+" // We premultiply alpha so render state should be one.\n"
+" color.rgb = pass1.rgb*pass1.a + pass2.rgb*pass2.a;\n"
+" color.a = pass1.a;\n"
+"#elif defined(PASS_BLEND)\n"
" // We premultiply alpha so render state should be one.\n"
-" vec4 color;\n"
" color.rgb = pass1.rgb*pass1.a*(1.0-pass2.a) + pass2.rgb*pass2.a;\n"
" color.a = pass1.a*(1.0-pass2.a) + pass2.a;\n"
+"#endif\n"
+
+"#else\n"
+" color = pass1;\n"
+"#endif\n"
" DoAlphaTest(color.a);\n"
diff --git a/src/extras/shaders/obj/leedsDefault_vert.inc b/src/extras/shaders/obj/leedsDefault_vert.inc
new file mode 100644
index 00000000..4ff94fd4
--- /dev/null
+++ b/src/extras/shaders/obj/leedsDefault_vert.inc
@@ -0,0 +1,53 @@
+const char *leedsDefault_vert_src =
+"#ifdef ENVMAP\n"
+"uniform mat4 u_texMatrix;\n"
+"#endif\n"
+"#ifdef SKIN\n"
+"uniform mat4 u_boneMatrices[64];\n"
+"#endif\n"
+
+"VSIN(ATTRIB_POS) vec3 in_pos;\n"
+
+"VSOUT vec4 v_color;\n"
+"VSOUT vec2 v_tex0;\n"
+"#ifdef ENVMAP\n"
+"VSOUT vec2 v_tex1;\n"
+"#endif\n"
+"VSOUT float v_fog;\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+"#ifdef SKIN\n"
+" vec3 SkinVertex = vec3(0.0, 0.0, 0.0);\n"
+" vec3 SkinNormal = vec3(0.0, 0.0, 0.0);\n"
+" for(int i = 0; i < 4; i++){\n"
+" SkinVertex += (u_boneMatrices[int(in_indices[i])] * vec4(in_pos, 1.0)).xyz * in_weights[i];\n"
+" SkinNormal += (mat3(u_boneMatrices[int(in_indices[i])]) * in_normal) * in_weights[i];\n"
+" }\n"
+
+" vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n"
+" gl_Position = u_proj * u_view * Vertex;\n"
+" vec3 Normal = mat3(u_world) * SkinNormal;\n"
+"#else\n"
+" vec4 Vertex = u_world * vec4(in_pos, 1.0);\n"
+" gl_Position = u_proj * u_view * Vertex;\n"
+" vec3 Normal = mat3(u_world) * in_normal;\n"
+"#endif\n"
+
+" v_tex0 = in_tex0;\n"
+"#ifdef ENVMAP\n"
+" v_tex1 = (u_texMatrix * vec4(Normal, 1.0)).xy;\n"
+"#endif\n"
+
+" v_color = in_color;\n"
+" v_color.rgb += u_ambLight.rgb*surfAmbient;\n"
+" v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
+" // PS2 clamps before material color\n"
+" // PSP clamps after...maybe another constant for this?\n"
+" v_color = clamp(v_color, 0.0, 1.0);\n"
+" v_color *= u_matColor;\n"
+
+" v_fog = DoFog(gl_Position.w);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/obj/leedsVehicle_mobile_PS.cso b/src/extras/shaders/obj/leedsVehicle_mobile_PS.cso
new file mode 100644
index 00000000..b6f70b5b
--- /dev/null
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_PS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.inc b/src/extras/shaders/obj/leedsVehicle_mobile_PS.inc
index ab8cc048..946b1c7a 100644
--- a/src/extras/shaders/leedsVehicle_mobile_PS.inc
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_PS.inc
@@ -7,11 +7,11 @@ static unsigned char leedsVehicle_mobile_PS_cso[] = {
0xac, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00,
0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xd0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
- 0x01, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe9, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00,
+ 0x01, 0x00, 0x0a, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe9, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x01, 0x00, 0x12, 0x00,
0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0a, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00,
0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab,
@@ -27,7 +27,7 @@ static unsigned char leedsVehicle_mobile_PS_cso[] = {
0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70,
0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35,
0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05,
- 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0xbf,
+ 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0xbf,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05,
0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x30, 0x40, 0x00, 0x00, 0x80, 0x3e,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02,
@@ -38,13 +38,13 @@ static unsigned char leedsVehicle_mobile_PS_cso[] = {
0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x1f, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x90, 0x01, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03,
0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0,
- 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0xa0,
0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x81,
- 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x03, 0x80,
- 0x01, 0x00, 0xe4, 0xb0, 0x04, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0xd2, 0xa0,
+ 0x03, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x03, 0x80,
+ 0x01, 0x00, 0xe4, 0xb0, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xd2, 0xa0,
0x42, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80,
0x01, 0x08, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80,
- 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0,
+ 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0xa0,
0x12, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0xaa, 0x80,
0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03,
0x03, 0x00, 0x08, 0x80, 0x02, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0xb0,
@@ -53,7 +53,7 @@ static unsigned char leedsVehicle_mobile_PS_cso[] = {
0x03, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x55, 0xa0,
0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0x80,
0x02, 0x00, 0x55, 0xb0, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80,
- 0x03, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
+ 0x03, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90,
0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xff, 0x80,
0x03, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x12, 0x00, 0x00, 0x04,
diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.cso b/src/extras/shaders/obj/leedsVehicle_mobile_VS.cso
index 85796f30..85796f30 100644
--- a/src/extras/shaders/leedsVehicle_mobile_VS.cso
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.inc b/src/extras/shaders/obj/leedsVehicle_mobile_VS.inc
index aa8859b1..aa8859b1 100644
--- a/src/extras/shaders/leedsVehicle_mobile_VS.inc
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_VS.inc
diff --git a/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc b/src/extras/shaders/obj/leedsVehicle_mobile_frag.inc
index 8098599c..8098599c 100644
--- a/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_frag.inc
diff --git a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc b/src/extras/shaders/obj/leedsVehicle_mobile_vert.inc
index 3609e369..3609e369 100644
--- a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc
+++ b/src/extras/shaders/obj/leedsVehicle_mobile_vert.inc
diff --git a/src/extras/shaders/neoGloss_PS.cso b/src/extras/shaders/obj/neoGloss_PS.cso
index aa88e450..aa88e450 100644
--- a/src/extras/shaders/neoGloss_PS.cso
+++ b/src/extras/shaders/obj/neoGloss_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoGloss_PS.inc b/src/extras/shaders/obj/neoGloss_PS.inc
index 97e5641d..97e5641d 100644
--- a/src/extras/shaders/neoGloss_PS.inc
+++ b/src/extras/shaders/obj/neoGloss_PS.inc
diff --git a/src/extras/shaders/neoGloss_VS.cso b/src/extras/shaders/obj/neoGloss_VS.cso
index 9635b8b7..9635b8b7 100644
--- a/src/extras/shaders/neoGloss_VS.cso
+++ b/src/extras/shaders/obj/neoGloss_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoGloss_VS.inc b/src/extras/shaders/obj/neoGloss_VS.inc
index 1ec03761..1ec03761 100644
--- a/src/extras/shaders/neoGloss_VS.inc
+++ b/src/extras/shaders/obj/neoGloss_VS.inc
diff --git a/src/extras/shaders/neoGloss_fs_gl.inc b/src/extras/shaders/obj/neoGloss_frag.inc
index 67e9724e..67e9724e 100644
--- a/src/extras/shaders/neoGloss_fs_gl.inc
+++ b/src/extras/shaders/obj/neoGloss_frag.inc
diff --git a/src/extras/shaders/neoGloss_vs_gl.inc b/src/extras/shaders/obj/neoGloss_vert.inc
index dffb423f..dffb423f 100644
--- a/src/extras/shaders/neoGloss_vs_gl.inc
+++ b/src/extras/shaders/obj/neoGloss_vert.inc
diff --git a/src/extras/shaders/neoRimSkin_VS.cso b/src/extras/shaders/obj/neoRimSkin_VS.cso
index 8410504e..8410504e 100644
--- a/src/extras/shaders/neoRimSkin_VS.cso
+++ b/src/extras/shaders/obj/neoRimSkin_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoRimSkin_VS.inc b/src/extras/shaders/obj/neoRimSkin_VS.inc
index ac182956..ac182956 100644
--- a/src/extras/shaders/neoRimSkin_VS.inc
+++ b/src/extras/shaders/obj/neoRimSkin_VS.inc
diff --git a/src/extras/shaders/neoRimSkin_gl.inc b/src/extras/shaders/obj/neoRimSkin_vert.inc
index 01b739b2..01b739b2 100644
--- a/src/extras/shaders/neoRimSkin_gl.inc
+++ b/src/extras/shaders/obj/neoRimSkin_vert.inc
diff --git a/src/extras/shaders/neoRim_VS.cso b/src/extras/shaders/obj/neoRim_VS.cso
index 4af538b1..4af538b1 100644
--- a/src/extras/shaders/neoRim_VS.cso
+++ b/src/extras/shaders/obj/neoRim_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoRim_VS.inc b/src/extras/shaders/obj/neoRim_VS.inc
index 03b044a6..03b044a6 100644
--- a/src/extras/shaders/neoRim_VS.inc
+++ b/src/extras/shaders/obj/neoRim_VS.inc
diff --git a/src/extras/shaders/neoRim_gl.inc b/src/extras/shaders/obj/neoRim_vert.inc
index 7cd199d0..7cd199d0 100644
--- a/src/extras/shaders/neoRim_gl.inc
+++ b/src/extras/shaders/obj/neoRim_vert.inc
diff --git a/src/extras/shaders/neoVehicle_PS.cso b/src/extras/shaders/obj/neoVehicle_PS.cso
index ded01bfb..ded01bfb 100644
--- a/src/extras/shaders/neoVehicle_PS.cso
+++ b/src/extras/shaders/obj/neoVehicle_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoVehicle_PS.inc b/src/extras/shaders/obj/neoVehicle_PS.inc
index 8b77cec2..8b77cec2 100644
--- a/src/extras/shaders/neoVehicle_PS.inc
+++ b/src/extras/shaders/obj/neoVehicle_PS.inc
diff --git a/src/extras/shaders/neoVehicle_VS.cso b/src/extras/shaders/obj/neoVehicle_VS.cso
index 6ea47987..6ea47987 100644
--- a/src/extras/shaders/neoVehicle_VS.cso
+++ b/src/extras/shaders/obj/neoVehicle_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoVehicle_VS.inc b/src/extras/shaders/obj/neoVehicle_VS.inc
index 37c5858d..37c5858d 100644
--- a/src/extras/shaders/neoVehicle_VS.inc
+++ b/src/extras/shaders/obj/neoVehicle_VS.inc
diff --git a/src/extras/shaders/neoVehicle_fs_gl.inc b/src/extras/shaders/obj/neoVehicle_frag.inc
index 20537440..20537440 100644
--- a/src/extras/shaders/neoVehicle_fs_gl.inc
+++ b/src/extras/shaders/obj/neoVehicle_frag.inc
diff --git a/src/extras/shaders/neoVehicle_vs_gl.inc b/src/extras/shaders/obj/neoVehicle_vert.inc
index b7b42622..b7b42622 100644
--- a/src/extras/shaders/neoVehicle_vs_gl.inc
+++ b/src/extras/shaders/obj/neoVehicle_vert.inc
diff --git a/src/extras/shaders/neoWorldVC_PS.cso b/src/extras/shaders/obj/neoWorldVC_PS.cso
index 5e8d1696..5e8d1696 100644
--- a/src/extras/shaders/neoWorldVC_PS.cso
+++ b/src/extras/shaders/obj/neoWorldVC_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoWorldVC_PS.inc b/src/extras/shaders/obj/neoWorldVC_PS.inc
index eb8bf2ee..eb8bf2ee 100644
--- a/src/extras/shaders/neoWorldVC_PS.inc
+++ b/src/extras/shaders/obj/neoWorldVC_PS.inc
diff --git a/src/extras/shaders/neoWorldVC_fs_gl.inc b/src/extras/shaders/obj/neoWorldVC_frag.inc
index b4385fc7..b4385fc7 100644
--- a/src/extras/shaders/neoWorldVC_fs_gl.inc
+++ b/src/extras/shaders/obj/neoWorldVC_frag.inc
diff --git a/src/extras/shaders/scale_PS.cso b/src/extras/shaders/obj/scale_PS.cso
index d7f7374c..7d8e0734 100644
--- a/src/extras/shaders/scale_PS.cso
+++ b/src/extras/shaders/obj/scale_PS.cso
Binary files differ
diff --git a/src/extras/shaders/scale_PS.inc b/src/extras/shaders/obj/scale_PS.inc
index 5f711ac8..e8f42e38 100644
--- a/src/extras/shaders/scale_PS.inc
+++ b/src/extras/shaders/obj/scale_PS.inc
@@ -22,12 +22,10 @@ static unsigned char scale_PS_cso[] = {
0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0,
0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xb0,
0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
- 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02,
- 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0,
- 0x01, 0x00, 0xe4, 0x81, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x08, 0x80,
- 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04,
- 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x00, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80,
- 0x01, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90,
+ 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x17, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x12, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0,
+ 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02,
+ 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
};
diff --git a/src/extras/shaders/scale_fs_gl.inc b/src/extras/shaders/obj/scale_frag.inc
index 8d9563e2..14082bb9 100644
--- a/src/extras/shaders/scale_fs_gl.inc
+++ b/src/extras/shaders/obj/scale_frag.inc
@@ -11,6 +11,7 @@ const char *scale_frag_src =
"{\n"
" vec4 color;\n"
" color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;\n"
+" color.rgb = clamp(color.rgb, 0.0, 1.0);\n"
" color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);\n"
" DoAlphaTest(color.a);\n"
diff --git a/src/extras/shaders/screenDroplet_PS.cso b/src/extras/shaders/obj/screenDroplet_PS.cso
index 5508096b..5508096b 100644
--- a/src/extras/shaders/screenDroplet_PS.cso
+++ b/src/extras/shaders/obj/screenDroplet_PS.cso
Binary files differ
diff --git a/src/extras/shaders/screenDroplet_PS.inc b/src/extras/shaders/obj/screenDroplet_PS.inc
index c2055188..c2055188 100644
--- a/src/extras/shaders/screenDroplet_PS.inc
+++ b/src/extras/shaders/obj/screenDroplet_PS.inc
diff --git a/src/extras/shaders/screenDroplet_fs_gl.inc b/src/extras/shaders/obj/screenDroplet_frag.inc
index dd393b02..dd393b02 100644
--- a/src/extras/shaders/screenDroplet_fs_gl.inc
+++ b/src/extras/shaders/obj/screenDroplet_frag.inc
diff --git a/src/extras/shaders/simple_fs_gl.inc b/src/extras/shaders/obj/simple_frag.inc
index 614d79a0..614d79a0 100644
--- a/src/extras/shaders/simple_fs_gl.inc
+++ b/src/extras/shaders/obj/simple_frag.inc
diff --git a/src/extras/shaders/scale.frag b/src/extras/shaders/scale.frag
index 29165154..7d9d1ff4 100644
--- a/src/extras/shaders/scale.frag
+++ b/src/extras/shaders/scale.frag
@@ -10,6 +10,7 @@ main(void)
{
vec4 color;
color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;
+ color.rgb = clamp(color.rgb, 0.0, 1.0);
color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);
DoAlphaTest(color.a);
diff --git a/src/extras/shaders/scale_PS.hlsl b/src/extras/shaders/scale_PS.hlsl
index 92466e94..54da9c82 100644
--- a/src/extras/shaders/scale_PS.hlsl
+++ b/src/extras/shaders/scale_PS.hlsl
@@ -12,8 +12,8 @@ float4 colorscale : register(c1);
float4 main(VS_out input) : COLOR
{
float4 color = input.Color;
- color *= tex2D(tex0, input.TexCoord0.xy);
- color *= colorscale;
+ color *= tex2D(tex0, input.TexCoord0.xy)*colorscale;
+ color.rgb = clamp(color.rgb, 0.0, 1.0);
color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z);
return color;
}