summaryrefslogtreecommitdiffstats
path: root/src/extras
diff options
context:
space:
mode:
Diffstat (limited to 'src/extras')
-rw-r--r--src/extras/custompipes.cpp10
-rw-r--r--src/extras/custompipes.h18
-rw-r--r--src/extras/custompipes_d3d9.cpp441
-rw-r--r--src/extras/custompipes_gl.cpp438
-rw-r--r--src/extras/postfx.cpp36
-rw-r--r--src/extras/postfx.h8
-rw-r--r--src/extras/shaders/Makefile55
-rw-r--r--src/extras/shaders/colourfilterLCS.frag20
-rw-r--r--src/extras/shaders/colourfilterLCS_PS.csobin0 -> 292 bytes
-rw-r--r--src/extras/shaders/colourfilterLCS_PS.hlsl13
-rw-r--r--src/extras/shaders/colourfilterLCS_PS.inc27
-rw-r--r--src/extras/shaders/colourfilterLCS_fs_gl.inc22
-rw-r--r--src/extras/shaders/colourfilterVC.frag27
-rw-r--r--src/extras/shaders/colourfilterVC_PS.csobin648 -> 0 bytes
-rw-r--r--src/extras/shaders/colourfilterVC_PS.hlsl23
-rw-r--r--src/extras/shaders/colourfilterVC_PS.inc56
-rw-r--r--src/extras/shaders/colourfilterVC_fs_gl.inc29
-rw-r--r--src/extras/shaders/leedsBuilding.vert28
-rw-r--r--src/extras/shaders/leedsBuilding_VS.csobin0 -> 652 bytes
-rw-r--r--src/extras/shaders/leedsBuilding_VS.hlsl43
-rw-r--r--src/extras/shaders/leedsBuilding_VS.inc57
-rw-r--r--src/extras/shaders/leedsBuilding_mobile.vert52
-rw-r--r--src/extras/shaders/leedsBuilding_mobile_VS.csobin0 -> 808 bytes
-rw-r--r--src/extras/shaders/leedsBuilding_mobile_VS.hlsl64
-rw-r--r--src/extras/shaders/leedsBuilding_mobile_VS.inc70
-rw-r--r--src/extras/shaders/leedsBuilding_mobile_vs_gl.inc54
-rw-r--r--src/extras/shaders/leedsBuilding_vs_gl.inc30
-rw-r--r--src/extras/shaders/leedsVehicle.vert27
-rw-r--r--src/extras/shaders/leedsVehicle_VS.csobin0 -> 1204 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_VS.hlsl45
-rw-r--r--src/extras/shaders/leedsVehicle_VS.inc103
-rw-r--r--src/extras/shaders/leedsVehicle_add.frag32
-rw-r--r--src/extras/shaders/leedsVehicle_add_PS.csobin0 -> 496 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_add_PS.hlsl34
-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.frag32
-rw-r--r--src/extras/shaders/leedsVehicle_blend_PS.csobin0 -> 572 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_blend_gl.inc34
-rw-r--r--src/extras/shaders/leedsVehicle_mobile.frag76
-rw-r--r--src/extras/shaders/leedsVehicle_mobile.vert40
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_PS.csobin0 -> 728 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_PS.hlsl53
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_PS.inc63
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_VS.csobin0 -> 1556 bytes
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_VS.hlsl57
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_VS.inc132
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_fs_gl.inc78
-rw-r--r--src/extras/shaders/leedsVehicle_mobile_vs_gl.inc42
-rw-r--r--src/extras/shaders/leedsVehicle_vs_gl.inc29
-rw-r--r--src/extras/shaders/scale.frag18
-rw-r--r--src/extras/shaders/scale_PS.csobin0 -> 368 bytes
-rw-r--r--src/extras/shaders/scale_PS.hlsl19
-rw-r--r--src/extras/shaders/scale_PS.inc33
-rw-r--r--src/extras/shaders/scale_fs_gl.inc20
57 files changed, 2400 insertions, 349 deletions
diff --git a/src/extras/custompipes.cpp b/src/extras/custompipes.cpp
index 2cecf1c0..247aa4b1 100644
--- a/src/extras/custompipes.cpp
+++ b/src/extras/custompipes.cpp
@@ -46,13 +46,14 @@ CustomMatCopy(void *dst, void *src, int32, int32)
rw::TexDictionary *neoTxd;
+bool gGlassCarsCheat;
bool bRenderingEnvMap;
-int32 EnvMapSize = 128;
+int32 EnvMapSize = 512;
rw::Camera *EnvMapCam;
rw::Texture *EnvMapTex;
rw::Texture *EnvMaskTex;
-static rw::RWDEVICE::Im2DVertex EnvScreenQuad[4];
-static int16 QuadIndices[6] = { 0, 1, 2, 0, 2, 3 };
+rw::RWDEVICE::Im2DVertex EnvScreenQuad[4];
+int16 QuadIndices[6] = { 0, 1, 2, 0, 2, 3 };
static rw::Camera*
CreateEnvMapCam(rw::World *world)
@@ -341,7 +342,7 @@ ReadTweakValueTable(char *fp, InterpolatedValue &interp)
* Neo Vehicle pipe
*/
-int32 VehiclePipeSwitch = VEHICLEPIPE_MATFX;
+int32 VehiclePipeSwitch = VEHICLEPIPE_PS2;
float VehicleShininess = 1.0f;
float VehicleSpecularity = 1.0f;
InterpolatedFloat Fresnel(0.4f);
@@ -369,6 +370,7 @@ AttachVehiclePipe(rw::Clump *clump)
* Neo World pipe
*/
+int32 WorldPipeSwitch = 0;
bool LightmapEnable;
float LightmapMult = 1.0f;
InterpolatedFloat WorldLightmapBlend(1.0f);
diff --git a/src/extras/custompipes.h b/src/extras/custompipes.h
index 183b85da..e83201ff 100644
--- a/src/extras/custompipes.h
+++ b/src/extras/custompipes.h
@@ -75,16 +75,22 @@ void CustomPipeInit(void);
void CustomPipeShutdown(void);
void SetTxdFindCallback(void);
+extern bool gGlassCarsCheat;
extern bool bRenderingEnvMap;
extern int32 EnvMapSize;
extern rw::Camera *EnvMapCam;
extern rw::Texture *EnvMapTex;
extern rw::Texture *EnvMaskTex;
+extern rw::RWDEVICE::Im2DVertex EnvScreenQuad[4];
+extern int16 QuadIndices[6];
void EnvMapRender(void);
enum {
- VEHICLEPIPE_MATFX,
- VEHICLEPIPE_NEO
+ VEHICLEPIPE_PS2,
+ VEHICLEPIPE_MOBILE,
+
+// maybe later again...
+ VEHICLEPIPE_NEO = -1
};
extern int32 VehiclePipeSwitch;
extern float VehicleShininess;
@@ -99,6 +105,11 @@ void DestroyVehiclePipe(void);
void AttachVehiclePipe(rw::Atomic *atomic);
void AttachVehiclePipe(rw::Clump *clump);
+enum {
+ WORLDPIPE_PS2,
+ WORLDPIPE_MOBILE
+};
+extern int32 WorldPipeSwitch;
extern bool LightmapEnable;
extern float LightmapMult;
extern InterpolatedFloat WorldLightmapBlend;
@@ -133,8 +144,6 @@ void AttachRimPipe(rw::Clump *clump);
}
-#endif
-
namespace WorldRender{
extern int numBlendInsts[3];
void AtomicFirstPass(RpAtomic *atomic, int pass);
@@ -143,3 +152,4 @@ void RenderBlendPass(int pass);
}
#endif
+#endif
diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp
index d0984ffe..9a02f874 100644
--- a/src/extras/custompipes_d3d9.cpp
+++ b/src/extras/custompipes_d3d9.cpp
@@ -2,6 +2,10 @@
#include "common.h"
#ifdef RW_D3D9
+#ifdef EXTENDED_PIPELINES
+
+#include "rpmatfx.h"
+
#include "main.h"
#include "RwHelper.h"
#include "Lights.h"
@@ -14,8 +18,6 @@
#include "World.h"
#include "custompipes.h"
-#ifdef EXTENDED_PIPELINES
-
#ifndef LIBRW
#error "Need librw for EXTENDED_PIPELINES"
#endif
@@ -36,13 +38,193 @@ enum {
VSLOC_eye = rw::d3d::VSLOC_afterLights,
VSLOC_reflProps,
- VSLOC_specLights
+ VSLOC_specLights,
+
+ // Leeds building, Leeds vehicle mobile
+ VSLOC_emissive = rw::d3d::VSLOC_afterLights,
+ VSLOC_ambient,
+ VSLOC_viewMat, // only vehicle
+
+ PSLOC_colorscale = 1,
+
+ // Leeds vehicle PS2
+ VSLOC_texMat = rw::d3d::VSLOC_afterLights,
+
+ PSLOC_shininess = 1,
+ PSLOC_skyTop,
+ PSLOC_skyBot
};
/*
- * Neo Vehicle pipe
+ * Leeds & Neo Vehicle pipe
*/
+static void *leedsVehicle_VS;
+static void *leedsVehicle_mobile_VS;
+static void *leedsVehicle_blend_PS;
+static void *leedsVehicle_add_PS;
+static void *leedsVehicle_mobile_PS;
+
+static rw::RawMatrix normal2texcoord_flipU = {
+ { -0.5f, 0.0f, 0.0f }, 0.0f,
+ { 0.0f, -0.5f, 0.0f }, 0.0f,
+ { 0.0f, 0.0f, 1.0f }, 0.0f,
+ { 0.5f, 0.5f, 0.0f }, 1.0f
+};
+
+void
+uploadEnvMatrix(rw::Frame *frame)
+{
+ using namespace rw;
+ Matrix invMat;
+ if(frame == nil)
+ frame = engine->currentCamera->getFrame();
+
+ RawMatrix envMtx, invMtx;
+ Matrix tmp = *frame->getLTM();
+ // Now the weird part: we remove the camera pitch
+ tmp.at.z = 0.0f;
+ tmp.at = normalize(tmp.at);
+ tmp.right.x = -tmp.at.y;
+ tmp.right.y = tmp.at.x;
+ tmp.right.z = 0.0f;;
+ tmp.up.set(0.0f, 0.0f, 1.0f);
+ tmp.pos.set(0.0f, 0.0f, 0.0f);
+ tmp.flags = Matrix::TYPEORTHONORMAL;
+
+ Matrix::invert(&invMat, &tmp);
+ convMatrix(&invMtx, &invMat);
+ RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord_flipU);
+ d3d::d3ddevice->SetVertexShaderConstantF(VSLOC_texMat, (float*)&envMtx, 4);
+}
+
+void
+leedsVehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
+{
+ using namespace rw;
+ using namespace rw::d3d;
+ using namespace rw::d3d9;
+
+ int vsBits;
+ setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
+ setIndices(header->indexBuffer);
+ setVertexDeclaration(header->vertexDeclaration);
+
+ vsBits = lightingCB_Shader(atomic);
+ uploadMatrices(atomic->getFrame()->getLTM());
+
+ setVertexShader(leedsVehicle_VS);
+ if(gGlassCarsCheat)
+ setPixelShader(leedsVehicle_blend_PS);
+ else
+ setPixelShader(leedsVehicle_add_PS);
+
+ d3d::setTexture(1, EnvMapTex);
+ uploadEnvMatrix(nil);
+
+ SetRenderState(SRCBLEND, BLENDONE);
+
+ InstanceData *inst = header->inst;
+ for(rw::uint32 i = 0; i < header->numMeshes; i++){
+ Material *m = inst->material;
+
+ SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
+
+ float coef = 0.0f;
+ if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){
+ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f;
+ if(gGlassCarsCheat)
+ coef = 1.0f;
+ }
+ d3ddevice->SetPixelShaderConstantF(PSLOC_shininess, (float*)&coef, 1);
+
+ setMaterial(m->color, m->surfaceProps);
+
+ if(m->texture)
+ d3d::setTexture(0, m->texture);
+ else
+ d3d::setTexture(0, gpWhiteTexture);
+
+ drawInst(header, inst);
+ inst++;
+ }
+
+ d3d::setTexture(1, nil);
+
+ SetRenderState(SRCBLEND, BLENDSRCALPHA);
+}
+
+void
+leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
+{
+ using namespace rw;
+ using namespace rw::d3d;
+ using namespace rw::d3d9;
+
+ int vsBits;
+ setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
+ setIndices(header->indexBuffer);
+ setVertexDeclaration(header->vertexDeclaration);
+
+ vsBits = lightingCB_Shader(atomic);
+ uploadMatrices(atomic->getFrame()->getLTM());
+
+ setVertexShader(leedsVehicle_mobile_VS);
+ setPixelShader(leedsVehicle_mobile_PS);
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ d3ddevice->SetVertexShaderConstantF(VSLOC_ambient, (float*)&amb, 1);
+ d3ddevice->SetVertexShaderConstantF(VSLOC_emissive, (float*)&emiss, 1);
+
+ RGBAf skyTop, skyBot;
+ skyTop.red = CTimeCycle::GetSkyTopRed()/255.0f;
+ skyTop.green = CTimeCycle::GetSkyTopGreen()/255.0f;
+ skyTop.blue = CTimeCycle::GetSkyTopBlue()/255.0f;
+ skyBot.red = CTimeCycle::GetSkyBottomRed()/255.0f;
+ skyBot.green = CTimeCycle::GetSkyBottomGreen()/255.0f;
+ skyBot.blue = CTimeCycle::GetSkyBottomBlue()/255.0f;
+
+ d3ddevice->SetPixelShaderConstantF(PSLOC_skyTop, (float*)&skyTop, 1);
+ d3ddevice->SetPixelShaderConstantF(PSLOC_skyBot, (float*)&skyBot, 1);
+
+ d3ddevice->SetVertexShaderConstantF(VSLOC_viewMat, (float*)&rw::engine->currentCamera->devView, 4);
+
+ d3d::setTexture(1, EnvMapTex);
+
+ InstanceData *inst = header->inst;
+ for(rw::uint32 i = 0; i < header->numMeshes; i++){
+ Material *m = inst->material;
+
+ SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
+
+ float coef = 0.0f;
+ if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){
+ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f;
+ if(gGlassCarsCheat)
+ coef = 1.0f;
+ }
+ d3ddevice->SetPixelShaderConstantF(PSLOC_shininess, (float*)&coef, 1);
+
+ setMaterial(m->color, m->surfaceProps);
+
+ if(m->texture)
+ d3d::setTexture(0, m->texture);
+ else
+ d3d::setTexture(0, gpWhiteTexture);
+
+ drawInst(header, inst);
+ inst++;
+ }
+
+ d3d::setTexture(1, nil);
+}
+
static void *neoVehicle_VS;
static void *neoVehicle_PS;
@@ -83,8 +265,13 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
using namespace rw::d3d9;
// TODO: make this less of a kludge
- if(VehiclePipeSwitch == VEHICLEPIPE_MATFX){
- matFXGlobals.pipelines[rw::platform]->render(atomic);
+ if(VehiclePipeSwitch == VEHICLEPIPE_PS2){
+ leedsVehicleRenderCB(atomic, header);
+ // matFXGlobals.pipelines[rw::platform]->render(atomic);
+ return;
+ }
+ if(VehiclePipeSwitch == VEHICLEPIPE_MOBILE){
+ leedsVehicleRenderCB_mobile(atomic, header);
return;
}
@@ -140,15 +327,15 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
void
CreateVehiclePipe(void)
{
- if(CFileMgr::LoadFile("neo/carTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
- printf("Error: couldn't open 'neo/carTweakingTable.dat'\n");
- else{
- char *fp = (char*)work_buff;
- fp = ReadTweakValueTable(fp, Fresnel);
- fp = ReadTweakValueTable(fp, Power);
- fp = ReadTweakValueTable(fp, DiffColor);
- fp = ReadTweakValueTable(fp, SpecColor);
- }
+// if(CFileMgr::LoadFile("neo/carTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
+// printf("Error: couldn't open 'neo/carTweakingTable.dat'\n");
+// else{
+// char *fp = (char*)work_buff;
+// fp = ReadTweakValueTable(fp, Fresnel);
+// fp = ReadTweakValueTable(fp, Power);
+// fp = ReadTweakValueTable(fp, DiffColor);
+// fp = ReadTweakValueTable(fp, SpecColor);
+// }
#include "shaders/neoVehicle_VS.inc"
neoVehicle_VS = rw::d3d::createVertexShader(neoVehicle_VS_cso);
@@ -158,6 +345,26 @@ CreateVehiclePipe(void)
neoVehicle_PS = rw::d3d::createPixelShader(neoVehicle_PS_cso);
assert(neoVehicle_PS);
+#include "shaders/leedsVehicle_VS.inc"
+ leedsVehicle_VS = rw::d3d::createVertexShader(leedsVehicle_VS_cso);
+ assert(leedsVehicle_VS);
+
+#include "shaders/leedsVehicle_mobile_VS.inc"
+ leedsVehicle_mobile_VS = rw::d3d::createVertexShader(leedsVehicle_mobile_VS_cso);
+ assert(leedsVehicle_mobile_VS);
+
+#include "shaders/leedsVehicle_blend_PS.inc"
+ leedsVehicle_blend_PS = rw::d3d::createPixelShader(leedsVehicle_blend_PS_cso);
+ assert(leedsVehicle_blend_PS);
+
+#include "shaders/leedsVehicle_add_PS.inc"
+ leedsVehicle_add_PS = rw::d3d::createPixelShader(leedsVehicle_add_PS_cso);
+ assert(leedsVehicle_add_PS);
+
+#include "shaders/leedsVehicle_mobile_PS.inc"
+ leedsVehicle_mobile_PS = rw::d3d::createPixelShader(leedsVehicle_mobile_PS_cso);
+ assert(leedsVehicle_mobile_PS);
+
rw::d3d9::ObjPipeline *pipe = rw::d3d9::ObjPipeline::create();
pipe->instanceCB = rw::d3d9::defaultInstanceCB;
@@ -175,6 +382,15 @@ DestroyVehiclePipe(void)
rw::d3d::destroyPixelShader(neoVehicle_PS);
neoVehicle_PS = nil;
+ rw::d3d::destroyVertexShader(leedsVehicle_VS);
+ leedsVehicle_VS = nil;
+
+ rw::d3d::destroyPixelShader(leedsVehicle_blend_PS);
+ leedsVehicle_blend_PS = nil;
+
+ rw::d3d::destroyPixelShader(leedsVehicle_add_PS);
+ leedsVehicle_add_PS = nil;
+
((rw::d3d9::ObjPipeline*)vehiclePipe)->destroy();
vehiclePipe = nil;
}
@@ -182,11 +398,12 @@ DestroyVehiclePipe(void)
/*
- * Neo World pipe
+ * Leeds World pipe
*/
-static void *neoWorld_VS;
-static void *neoWorldVC_PS;
+static void *leedsBuilding_VS;
+static void *leedsBuilding_mobile_VS;
+static void *scale_PS;
static void
worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
@@ -195,79 +412,72 @@ worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
using namespace rw::d3d;
using namespace rw::d3d9;
- if(!LightmapEnable){
- defaultRenderCB_Shader(atomic, header);
- return;
- }
-
- int vsBits;
setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
setIndices(header->indexBuffer);
setVertexDeclaration(header->vertexDeclaration);
- vsBits = lightingCB_Shader(atomic);
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ setVertexShader(CustomPipes::leedsBuilding_mobile_VS);
+ else
+ setVertexShader(CustomPipes::leedsBuilding_VS);
+ setPixelShader(scale_PS);
+
uploadMatrices(atomic->getFrame()->getLTM());
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ d3ddevice->SetVertexShaderConstantF(VSLOC_ambient, (float*)&amb, 1);
+ d3ddevice->SetVertexShaderConstantF(VSLOC_emissive, (float*)&emiss, 1);
- float lightfactor[4];
+ float colorscale[4];
+ colorscale[3] = 1.0f;
InstanceData *inst = header->inst;
for(rw::uint32 i = 0; i < header->numMeshes; i++){
Material *m = inst->material;
- if(MatFX::getEffects(m) == MatFX::DUAL){
- setVertexShader(neoWorld_VS);
-
- MatFX *matfx = MatFX::get(m);
- Texture *dualtex = matfx->getDualTexture();
- if(dualtex == nil)
- goto notex;
- d3d::setTexture(1, dualtex);
- lightfactor[0] = lightfactor[1] = lightfactor[2] = WorldLightmapBlend.Get()*LightmapMult;
- }else{
- notex:
- setVertexShader(default_amb_VS);
-
- d3d::setTexture(1, nil);
- lightfactor[0] = lightfactor[1] = lightfactor[2] = 0.0f;
- }
- lightfactor[3] = m->color.alpha/255.0f;
- d3d::setTexture(0, m->texture);
- d3ddevice->SetPixelShaderConstantF(1, lightfactor, 1);
-
- SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
-
- RGBA color = { 255, 255, 255, m->color.alpha };
- setMaterial(color, m->surfaceProps);
+ float cs = 1.0f;
+ if(WorldPipeSwitch == WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ d3ddevice->SetPixelShaderConstantF(PSLOC_colorscale, colorscale, 1);
if(m->texture)
d3d::setTexture(0, m->texture);
else
- d3d::setTexture(0, gpWhiteTexture);
- setPixelShader(neoWorldVC_PS);
+ d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
+
+ setMaterial(m->color, m->surfaceProps, WorldPipeSwitch == WORLDPIPE_PS2 ? 0.5f : 1.0f);
+
+ SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
drawInst(header, inst);
inst++;
}
- d3d::setTexture(1, nil);
}
void
CreateWorldPipe(void)
{
- if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
- printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
- else
- ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
-
-#include "shaders/default_UV2_VS.inc"
- neoWorld_VS = rw::d3d::createVertexShader(default_UV2_VS_cso);
- assert(neoWorld_VS);
-
-#include "shaders/neoWorldVC_PS.inc"
- neoWorldVC_PS = rw::d3d::createPixelShader(neoWorldVC_PS_cso);
- assert(neoWorldVC_PS);
-
+// if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
+// printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
+// else
+// ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
+
+#include "shaders/leedsBuilding_VS.inc"
+ leedsBuilding_VS = rw::d3d::createVertexShader(leedsBuilding_VS_cso);
+ assert(leedsBuilding_VS);
+#include "shaders/leedsBuilding_mobile_VS.inc"
+ leedsBuilding_mobile_VS = rw::d3d::createVertexShader(leedsBuilding_mobile_VS_cso);
+ assert(leedsBuilding_mobile_VS);
+#include "shaders/scale_PS.inc"
+ scale_PS = rw::d3d::createPixelShader(scale_PS_cso);
+ assert(scale_PS);
rw::d3d9::ObjPipeline *pipe = rw::d3d9::ObjPipeline::create();
pipe->instanceCB = rw::d3d9::defaultInstanceCB;
@@ -279,10 +489,12 @@ CreateWorldPipe(void)
void
DestroyWorldPipe(void)
{
- rw::d3d::destroyVertexShader(neoWorld_VS);
- neoWorld_VS = nil;
- rw::d3d::destroyPixelShader(neoWorldVC_PS);
- neoWorldVC_PS = nil;
+ rw::d3d::destroyVertexShader(leedsBuilding_VS);
+ leedsBuilding_VS = nil;
+ rw::d3d::destroyVertexShader(leedsBuilding_mobile_VS);
+ leedsBuilding_mobile_VS = nil;
+ rw::d3d::destroyPixelShader(scale_PS);
+ scale_PS = nil;
((rw::d3d9::ObjPipeline*)worldPipe)->destroy();
@@ -553,12 +765,7 @@ DestroyRimLightPipes(void)
}
-#endif
-
#ifdef NEW_RENDERER
-#ifndef LIBRW
-#error "Need librw for NEW_PIPELINES"
-#endif
namespace WorldRender
{
@@ -616,10 +823,15 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
bool defer = false;
SetMatrix(building, atomic->getFrame()->getLTM());
+ float colorscale[4];
+
InstanceData *inst = building->instHeader->inst;
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
+
if(inst->vertexAlpha || m->color.alpha != 255 ||
IsTextureTransparent(m->texture)){
defer = true;
@@ -631,22 +843,37 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
setStreamSource(0, building->instHeader->vertexStream[0].vertexBuffer, 0, building->instHeader->vertexStream[0].stride);
setIndices(building->instHeader->indexBuffer);
setVertexDeclaration(building->instHeader->vertexDeclaration);
- setVertexShader(default_amb_VS);
- d3ddevice->SetVertexShaderConstantF(VSLOC_combined, (float*)&building->combinedMat, 4);
- if(building->lighting)
- setAmbient(pAmbient->color);
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ setVertexShader(CustomPipes::leedsBuilding_mobile_VS);
else
- setAmbient(black);
+ setVertexShader(CustomPipes::leedsBuilding_VS);
+ setPixelShader(CustomPipes::scale_PS);
+ d3ddevice->SetVertexShaderConstantF(VSLOC_combined, (float*)&building->combinedMat, 4);
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ d3ddevice->SetVertexShaderConstantF(CustomPipes::VSLOC_ambient, (float*)&amb, 1);
+ d3ddevice->SetVertexShaderConstantF(CustomPipes::VSLOC_emissive, (float*)&emiss, 1);
+
+ colorscale[3] = 1.0f;
+
setupDone = true;
}
- setMaterial(m->color, m->surfaceProps);
+ float cs = 1.0f;
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
- if(m->texture){
- d3d::setTexture(0, m->texture);
- setPixelShader(default_tex_PS);
- }else
- setPixelShader(default_PS);
+ d3d::setTexture(0, m->texture);
+
+ setMaterial(m->color, m->surfaceProps, 0.5f);
drawInst(building->instHeader, inst);
}
@@ -680,7 +907,24 @@ RenderBlendPass(int pass)
using namespace rw::d3d;
using namespace rw::d3d9;
- setVertexShader(default_amb_VS);
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ setVertexShader(CustomPipes::leedsBuilding_mobile_VS);
+ else
+ setVertexShader(CustomPipes::leedsBuilding_VS);
+ setPixelShader(CustomPipes::scale_PS);
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ d3ddevice->SetVertexShaderConstantF(CustomPipes::VSLOC_ambient, (float*)&amb, 1);
+ d3ddevice->SetVertexShaderConstantF(CustomPipes::VSLOC_emissive, (float*)&emiss, 1);
+
+ float colorscale[4];
+ colorscale[3] = 1.0f;
int i;
for(i = 0; i < numBlendInsts[pass]; i++){
@@ -690,26 +934,26 @@ RenderBlendPass(int pass)
setIndices(building->instHeader->indexBuffer);
setVertexDeclaration(building->instHeader->vertexDeclaration);
d3ddevice->SetVertexShaderConstantF(VSLOC_combined, (float*)&building->combinedMat, 4);
- if(building->lighting)
- setAmbient(pAmbient->color);
- else
- setAmbient(black);
InstanceData *inst = building->instHeader->inst;
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
continue; // already done this one
+ float cs = 1.0f;
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
+
+ d3d::setTexture(0, m->texture);
+
rw::RGBA color = m->color;
color.alpha = (color.alpha * building->fadeAlpha)/255;
- setMaterial(color, m->surfaceProps);
-
- if(m->texture){
- d3d::setTexture(0, m->texture);
- setPixelShader(default_tex_PS);
- }else
- setPixelShader(default_PS);
+ setMaterial(color, m->surfaceProps, 0.5f);
drawInst(building->instHeader, inst);
}
@@ -719,3 +963,4 @@ RenderBlendPass(int pass)
#endif
#endif
+#endif
diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp
index 67be4afd..eeb62b8d 100644
--- a/src/extras/custompipes_gl.cpp
+++ b/src/extras/custompipes_gl.cpp
@@ -1,6 +1,10 @@
#include "common.h"
#ifdef RW_OPENGL
+#ifdef EXTENDED_PIPELINES
+
+#include "rpmatfx.h"
+
#include "main.h"
#include "RwHelper.h"
#include "Lights.h"
@@ -13,8 +17,6 @@
#include "World.h"
#include "custompipes.h"
-#ifdef EXTENDED_PIPELINES
-
#ifndef LIBRW
#error "Need librw for EXTENDED_PIPELINES"
#endif
@@ -33,14 +35,208 @@ static int32 u_reflProps;
static int32 u_specDir;
static int32 u_specColor;
+static int32 u_amb;
+static int32 u_emiss;
+static int32 u_colorscale;
+
+static int32 u_texMatrix;
+static int32 u_fxparams;
+
+static int32 u_skyTop;
+static int32 u_skyBot;
+
#define U(i) currentShader->uniformLocations[i]
/*
- * Neo Vehicle pipe
+ * Leeds & Neo Vehicle pipe
*/
+rw::gl3::Shader *leedsVehicleShader_add;
+rw::gl3::Shader *leedsVehicleShader_blend;
+rw::gl3::Shader *leedsVehicleShader_mobile;
+
rw::gl3::Shader *neoVehicleShader;
+static rw::RawMatrix normal2texcoord_flipU = {
+ { -0.5f, 0.0f, 0.0f }, 0.0f,
+ { 0.0f, -0.5f, 0.0f }, 0.0f,
+ { 0.0f, 0.0f, 1.0f }, 0.0f,
+ { 0.5f, 0.5f, 0.0f }, 1.0f
+};
+
+static void
+uploadEnvMatrix(rw::Frame *frame)
+{
+ using namespace rw;
+ using namespace rw::gl3;
+
+ Matrix invMat;
+ if(frame == nil)
+ frame = engine->currentCamera->getFrame();
+
+ // cache the matrix across multiple meshes
+ static RawMatrix envMtx;
+// can't do it, frame matrix may change
+// if(frame != lastEnvFrame){
+// lastEnvFrame = frame;
+ {
+
+ Matrix tmp = *frame->getLTM();
+ // Now the weird part: we remove the camera pitch
+ tmp.at.z = 0.0f;
+ tmp.at = normalize(tmp.at);
+ tmp.right.x = -tmp.at.y;
+ tmp.right.y = tmp.at.x;
+ tmp.right.z = 0.0f;;
+ tmp.up.set(0.0f, 0.0f, 1.0f);
+ tmp.pos.set(0.0f, 0.0f, 0.0f);
+ tmp.flags = Matrix::TYPEORTHONORMAL;
+
+ RawMatrix invMtx;
+ Matrix::invert(&invMat, &tmp);
+ convMatrix(&invMtx, &invMat);
+ RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord_flipU);
+ }
+ glUniformMatrix4fv(U(u_texMatrix), 1, GL_FALSE, (float*)&envMtx);
+}
+
+static void
+leedsVehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
+{
+ using namespace rw;
+ using namespace rw::gl3;
+
+ Material *m;
+
+ setWorldMatrix(atomic->getFrame()->getLTM());
+ lightingCB(atomic);
+
+#ifdef RW_GL_USE_VAOS
+ glBindVertexArray(header->vao);
+#else
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
+ glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
+ setAttribPointers(header->attribDesc, header->numAttribs);
+#endif
+
+ InstanceData *inst = header->inst;
+ rw::int32 n = header->numMeshes;
+
+ if(gGlassCarsCheat)
+ leedsVehicleShader_blend->use();
+ else
+ leedsVehicleShader_add->use();
+
+ setTexture(1, EnvMapTex);
+ uploadEnvMatrix(nil);
+
+ SetRenderState(SRCBLEND, BLENDONE);
+
+ while(n--){
+ m = inst->material;
+
+ rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
+
+ float coef = 0.0f;
+ if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){
+ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f;
+ if(gGlassCarsCheat)
+ coef = 1.0f;
+ }
+ glUniform1f(U(u_fxparams), coef);
+
+ setMaterial(m->color, m->surfaceProps);
+
+ setTexture(0, m->texture);
+
+ drawInst(header, inst);
+ inst++;
+ }
+
+ setTexture(1, nil);
+
+ SetRenderState(SRCBLEND, BLENDSRCALPHA);
+
+#ifndef RW_GL_USE_VAOS
+ disableAttribPointers(header->attribDesc, header->numAttribs);
+#endif
+}
+
+static void
+leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
+{
+ using namespace rw;
+ using namespace rw::gl3;
+
+ Material *m;
+
+ setWorldMatrix(atomic->getFrame()->getLTM());
+ lightingCB(atomic);
+
+#ifdef RW_GL_USE_VAOS
+ glBindVertexArray(header->vao);
+#else
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
+ glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
+ setAttribPointers(header->attribDesc, header->numAttribs);
+#endif
+
+ InstanceData *inst = header->inst;
+ rw::int32 n = header->numMeshes;
+
+ leedsVehicleShader_mobile->use();
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ glUniform4fv(U(u_amb), 1, (float*)&amb);
+ glUniform4fv(U(u_emiss), 1, (float*)&emiss);
+
+ RGBAf skyTop, skyBot;
+ skyTop.red = CTimeCycle::GetSkyTopRed()/255.0f;
+ skyTop.green = CTimeCycle::GetSkyTopGreen()/255.0f;
+ skyTop.blue = CTimeCycle::GetSkyTopBlue()/255.0f;
+ skyBot.red = CTimeCycle::GetSkyBottomRed()/255.0f;
+ skyBot.green = CTimeCycle::GetSkyBottomGreen()/255.0f;
+ skyBot.blue = CTimeCycle::GetSkyBottomBlue()/255.0f;
+
+ glUniform3fv(U(u_skyTop), 1, (float*)&skyTop);
+ glUniform3fv(U(u_skyBot), 1, (float*)&skyBot);
+
+ setTexture(1, EnvMapTex);
+
+ while(n--){
+ m = inst->material;
+
+ rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
+
+ float coef = 0.0f;
+ if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){
+ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f;
+ if(gGlassCarsCheat)
+ coef = 1.0f;
+ }
+ glUniform1f(U(u_fxparams), coef);
+
+ setMaterial(m->color, m->surfaceProps);
+
+ setTexture(0, m->texture);
+
+ drawInst(header, inst);
+ inst++;
+ }
+
+ setTexture(1, nil);
+
+#ifndef RW_GL_USE_VAOS
+ disableAttribPointers(header->attribDesc, header->numAttribs);
+#endif
+}
+
static void
uploadSpecLights(void)
{
@@ -80,8 +276,13 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
using namespace rw::gl3;
// TODO: make this less of a kludge
- if(VehiclePipeSwitch == VEHICLEPIPE_MATFX){
- matFXGlobals.pipelines[rw::platform]->render(atomic);
+ if(VehiclePipeSwitch == VEHICLEPIPE_PS2){
+ leedsVehicleRenderCB(atomic, header);
+// matFXGlobals.pipelines[rw::platform]->render(atomic);
+ return;
+ }
+ if(VehiclePipeSwitch == VEHICLEPIPE_MOBILE){
+ leedsVehicleRenderCB_mobile(atomic, header);
return;
}
@@ -148,15 +349,15 @@ CreateVehiclePipe(void)
using namespace rw;
using namespace rw::gl3;
- if(CFileMgr::LoadFile("neo/carTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
- printf("Error: couldn't open 'neo/carTweakingTable.dat'\n");
- else{
- char *fp = (char*)work_buff;
- fp = ReadTweakValueTable(fp, Fresnel);
- fp = ReadTweakValueTable(fp, Power);
- fp = ReadTweakValueTable(fp, DiffColor);
- fp = ReadTweakValueTable(fp, SpecColor);
- }
+// if(CFileMgr::LoadFile("neo/carTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
+// printf("Error: couldn't open 'neo/carTweakingTable.dat'\n");
+// else{
+// char *fp = (char*)work_buff;
+// fp = ReadTweakValueTable(fp, Fresnel);
+// fp = ReadTweakValueTable(fp, Power);
+// fp = ReadTweakValueTable(fp, DiffColor);
+// fp = ReadTweakValueTable(fp, SpecColor);
+// }
{
@@ -168,6 +369,28 @@ CreateVehiclePipe(void)
assert(neoVehicleShader);
}
+ {
+#include "shaders/leedsVehicle_add_gl.inc"
+#include "shaders/leedsVehicle_blend_gl.inc"
+#include "shaders/leedsVehicle_vs_gl.inc"
+ const char *vs[] = { shaderDecl, header_vert_src, leedsVehicle_vert_src, nil };
+ const char *fs_add[] = { shaderDecl, header_frag_src, leedsVehicle_add_frag_src, nil };
+ const char *fs_blend[] = { shaderDecl, header_frag_src, leedsVehicle_blend_frag_src, nil };
+ leedsVehicleShader_add = Shader::create(vs, fs_add);
+ assert(leedsVehicleShader_add);
+ leedsVehicleShader_blend = Shader::create(vs, fs_blend);
+ assert(leedsVehicleShader_blend);
+ }
+
+ {
+#include "shaders/leedsVehicle_mobile_fs_gl.inc"
+#include "shaders/leedsVehicle_mobile_vs_gl.inc"
+ const char *vs[] = { shaderDecl, header_vert_src, leedsVehicle_mobile_vert_src, nil };
+ const char *fs[] = { shaderDecl, header_frag_src, leedsVehicle_mobile_frag_src, nil };
+ leedsVehicleShader_mobile = Shader::create(vs, fs);
+ assert(leedsVehicleShader_mobile);
+ }
+
rw::gl3::ObjPipeline *pipe = rw::gl3::ObjPipeline::create();
pipe->instanceCB = rw::gl3::defaultInstanceCB;
@@ -182,6 +405,15 @@ DestroyVehiclePipe(void)
neoVehicleShader->destroy();
neoVehicleShader = nil;
+ leedsVehicleShader_add->destroy();
+ leedsVehicleShader_add = nil;
+
+ leedsVehicleShader_blend->destroy();
+ leedsVehicleShader_blend = nil;
+
+ leedsVehicleShader_mobile->destroy();
+ leedsVehicleShader_mobile = nil;
+
((rw::gl3::ObjPipeline*)vehiclePipe)->destroy();
vehiclePipe = nil;
}
@@ -189,10 +421,11 @@ DestroyVehiclePipe(void)
/*
- * Neo World pipe
+ * Leeds World pipe
*/
-rw::gl3::Shader *neoWorldShader;
+rw::gl3::Shader *leedsWorldShader;
+rw::gl3::Shader *leedsWorldShader_mobile;
static void
worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
@@ -200,15 +433,9 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
using namespace rw;
using namespace rw::gl3;
- if(!LightmapEnable){
- gl3::defaultRenderCB(atomic, header);
- return;
- }
-
Material *m;
setWorldMatrix(atomic->getFrame()->getLTM());
- lightingCB(atomic);
#ifdef RW_GL_USE_VAOS
glBindVertexArray(header->vao);
@@ -221,39 +448,42 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
InstanceData *inst = header->inst;
rw::int32 n = header->numMeshes;
- neoWorldShader->use();
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ CustomPipes::leedsWorldShader_mobile->use();
+ else
+ CustomPipes::leedsWorldShader->use();
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ glUniform4fv(U(u_amb), 1, (float*)&amb);
+ glUniform4fv(U(u_emiss), 1, (float*)&emiss);
- float lightfactor[4];
+ float colorscale[4];
+ colorscale[3] = 1.0f;
while(n--){
m = inst->material;
- if(MatFX::getEffects(m) == MatFX::DUAL){
- MatFX *matfx = MatFX::get(m);
- Texture *dualtex = matfx->getDualTexture();
- if(dualtex == nil)
- goto notex;
- setTexture(1, dualtex);
- lightfactor[0] = lightfactor[1] = lightfactor[2] = WorldLightmapBlend.Get()*LightmapMult;
- }else{
- notex:
- setTexture(1, nil);
- lightfactor[0] = lightfactor[1] = lightfactor[2] = 0.0f;
- }
- lightfactor[3] = m->color.alpha/255.0f;
- glUniform4fv(U(u_lightMap), 1, lightfactor);
-
- RGBA color = { 255, 255, 255, m->color.alpha };
- setMaterial(color, m->surfaceProps);
+ float cs = 1.0f;
+ if(WorldPipeSwitch == WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ glUniform4fv(U(u_colorscale), 1, colorscale);
setTexture(0, m->texture);
+ setMaterial(m->color, m->surfaceProps, 0.5f);
+
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
drawInst(header, inst);
inst++;
}
- setTexture(1, nil);
#ifndef RW_GL_USE_VAOS
disableAttribPointers(header->attribDesc, header->numAttribs);
#endif
@@ -265,18 +495,22 @@ CreateWorldPipe(void)
using namespace rw;
using namespace rw::gl3;
- if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
- printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
- else
- ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
+// if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
+// printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
+// else
+// ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
{
-#include "shaders/neoWorldVC_fs_gl.inc"
-#include "shaders/default_UV2_gl.inc"
- const char *vs[] = { shaderDecl, header_vert_src, default_UV2_vert_src, nil };
- const char *fs[] = { shaderDecl, header_frag_src, neoWorldVC_frag_src, nil };
- neoWorldShader = Shader::create(vs, fs);
- assert(neoWorldShader);
+#include "shaders/scale_fs_gl.inc"
+#include "shaders/leedsBuilding_vs_gl.inc"
+#include "shaders/leedsBuilding_mobile_vs_gl.inc"
+ const char *vs[] = { shaderDecl, header_vert_src, leedsBuilding_vert_src, nil };
+ const char *vs_mobile[] = { shaderDecl, header_vert_src, leedsBuilding_mobile_vert_src, nil };
+ const char *fs[] = { shaderDecl, header_frag_src, scale_frag_src, nil };
+ leedsWorldShader = Shader::create(vs, fs);
+ assert(leedsWorldShader);
+ leedsWorldShader_mobile = Shader::create(vs_mobile, fs);
+ assert(leedsWorldShader_mobile);
}
@@ -290,8 +524,10 @@ CreateWorldPipe(void)
void
DestroyWorldPipe(void)
{
- neoWorldShader->destroy();
- neoWorldShader = nil;
+ leedsWorldShader->destroy();
+ leedsWorldShader = nil;
+ leedsWorldShader_mobile->destroy();
+ leedsWorldShader_mobile = nil;
((rw::gl3::ObjPipeline*)worldPipe)->destroy();
worldPipe = nil;
@@ -609,17 +845,22 @@ CustomPipeRegisterGL(void)
u_reflProps = rw::gl3::registerUniform("u_reflProps");
u_specDir = rw::gl3::registerUniform("u_specDir");
u_specColor = rw::gl3::registerUniform("u_specColor");
-}
+ u_amb = rw::gl3::registerUniform("u_amb");
+ u_emiss = rw::gl3::registerUniform("u_emiss");
+ u_colorscale = rw::gl3::registerUniform("u_colorscale");
+
+ u_texMatrix = rw::gl3::registerUniform("u_texMatrix");
+ u_fxparams = rw::gl3::registerUniform("u_fxparams");
+ u_skyTop = rw::gl3::registerUniform("u_skyTop");
+ u_skyBot = rw::gl3::registerUniform("u_skyBot");
}
-#endif
+
+}
#ifdef NEW_RENDERER
-#ifndef LIBRW
-#error "Need librw for NEW_PIPELINES"
-#endif
namespace WorldRender
{
@@ -661,23 +902,19 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
building->fadeAlpha = 255;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
- WorldLights lights;
- lights.numAmbients = 1;
- lights.numDirectionals = 0;
- lights.numLocals = 0;
- if(building->lighting)
- lights.ambient = pAmbient->color;
- else
- lights.ambient = black;
-
bool setupDone = false;
bool defer = false;
building->matrix = *atomic->getFrame()->getLTM();
+ float colorscale[4];
+
InstanceData *inst = building->instHeader->inst;
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
+
if(inst->vertexAlpha || m->color.alpha != 255 ||
IsTextureTransparent(m->texture)){
defer = true;
@@ -686,7 +923,10 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
// alright we're rendering this atomic
if(!setupDone){
- defaultShader->use();
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ CustomPipes::leedsWorldShader_mobile->use();
+ else
+ CustomPipes::leedsWorldShader->use();
setWorldMatrix(&building->matrix);
#ifdef RW_GL_USE_VAOS
glBindVertexArray(building->instHeader->vao);
@@ -695,11 +935,29 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
glBindBuffer(GL_ARRAY_BUFFER, building->instHeader->vbo);
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
- setLights(&lights);
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ glUniform4fv(U(CustomPipes::u_amb), 1, (float*)&amb);
+ glUniform4fv(U(CustomPipes::u_emiss), 1, (float*)&emiss);
+
+ colorscale[3] = 1.0f;
+
setupDone = true;
}
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(m->color, m->surfaceProps, 0.5f);
+
+ float cs = 1.0f;
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ glUniform4fv(U(CustomPipes::u_colorscale), 1, colorscale);
setTexture(0, m->texture);
@@ -736,11 +994,23 @@ RenderBlendPass(int pass)
using namespace rw;
using namespace rw::gl3;
- defaultShader->use();
- WorldLights lights;
- lights.numAmbients = 1;
- lights.numDirectionals = 0;
- lights.numLocals = 0;
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_MOBILE)
+ CustomPipes::leedsWorldShader_mobile->use();
+ else
+ CustomPipes::leedsWorldShader->use();
+
+ RGBAf amb, emiss;
+ amb.red = CTimeCycle::GetAmbientRed();
+ amb.green = CTimeCycle::GetAmbientGreen();
+ amb.blue = CTimeCycle::GetAmbientBlue();
+ amb.alpha = 1.0f;
+ emiss = pAmbient->color;
+
+ glUniform4fv(U(CustomPipes::u_amb), 1, (float*)&amb);
+ glUniform4fv(U(CustomPipes::u_emiss), 1, (float*)&emiss);
+
+ float colorscale[4];
+ colorscale[3] = 1.0f;
int i;
for(i = 0; i < numBlendInsts[pass]; i++){
@@ -754,21 +1024,24 @@ RenderBlendPass(int pass)
setAttribPointers(building->instHeader->attribDesc, building->instHeader->numAttribs);
#endif
setWorldMatrix(&building->matrix);
- if(building->lighting)
- lights.ambient = pAmbient->color;
- else
- lights.ambient = black;
- setLights(&lights);
InstanceData *inst = building->instHeader->inst;
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
continue; // already done this one
rw::RGBA color = m->color;
color.alpha = (color.alpha * building->fadeAlpha)/255;
- setMaterial(color, m->surfaceProps);
+ setMaterial(color, m->surfaceProps, 0.5f);
+
+ float cs = 1.0f;
+ if(CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 && m->texture)
+ cs = 255/128.0f;
+ colorscale[0] = colorscale[1] = colorscale[2] = cs;
+ glUniform4fv(U(CustomPipes::u_colorscale), 1, colorscale);
setTexture(0, m->texture);
@@ -783,3 +1056,4 @@ RenderBlendPass(int pass)
#endif
#endif
+#endif
diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp
index 2ea08141..b07b5426 100644
--- a/src/extras/postfx.cpp
+++ b/src/extras/postfx.cpp
@@ -25,14 +25,14 @@ static RwIm2DVertex Vertex2[4];
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
#ifdef RW_D3D9
-void *colourfilterVC_PS;
+void *colourfilterLCS_PS;
void *contrast_PS;
#endif
#ifdef RW_OPENGL
int32 u_blurcolor;
int32 u_contrastAdd;
int32 u_contrastMult;
-rw::gl3::Shader *colourFilterVC;
+rw::gl3::Shader *colourFilterLCS;
rw::gl3::Shader *contrast;
#endif
@@ -143,8 +143,8 @@ CPostFX::Open(RwCamera *cam)
#ifdef RW_D3D9
-#include "shaders/colourfilterVC_PS.inc"
- colourfilterVC_PS = rw::d3d::createPixelShader(colourfilterVC_PS_cso);
+#include "shaders/colourfilterLCS_PS.inc"
+ colourfilterLCS_PS = rw::d3d::createPixelShader(colourfilterLCS_PS_cso);
#include "shaders/contrastPS.inc"
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
#endif
@@ -153,11 +153,11 @@ CPostFX::Open(RwCamera *cam)
{
#include "shaders/im2d_gl.inc"
-#include "shaders/colourfilterVC_fs_gl.inc"
+#include "shaders/colourfilterLCS_fs_gl.inc"
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
- const char *fs[] = { shaderDecl, header_frag_src, colourfilterVC_frag_src, nil };
- colourFilterVC = Shader::create(vs, fs);
- assert(colourFilterVC);
+ const char *fs[] = { shaderDecl, header_frag_src, colourfilterLCS_frag_src, nil };
+ colourFilterLCS = Shader::create(vs, fs);
+ assert(colourFilterLCS);
}
{
@@ -184,9 +184,9 @@ CPostFX::Close(void)
pBackBuffer = nil;
}
#ifdef RW_D3D9
- if(colourfilterVC_PS){
- rw::d3d::destroyPixelShader(colourfilterVC_PS);
- colourfilterVC_PS = nil;
+ if(colourfilterLCS_PS){
+ rw::d3d::destroyPixelShader(colourfilterLCS_PS);
+ colourfilterLCS_PS = nil;
}
if(contrast_PS){
rw::d3d::destroyPixelShader(contrast_PS);
@@ -194,9 +194,9 @@ CPostFX::Close(void)
}
#endif
#ifdef RW_OPENGL
- if(colourFilterVC){
- colourFilterVC->destroy();
- colourFilterVC = nil;
+ if(colourFilterLCS){
+ colourFilterLCS->destroy();
+ colourFilterLCS = nil;
}
if(contrast){
contrast->destroy();
@@ -294,12 +294,12 @@ CPostFX::RenderOverlayShader(RwCamera *cam, int32 r, int32 g, int32 b, int32 a)
blurcolors[3] = 30/255.0f;
#ifdef RW_D3D9
rw::d3d::d3ddevice->SetPixelShaderConstantF(10, blurcolors, 1);
- rw::d3d::im2dOverridePS = colourfilterVC_PS;
+ rw::d3d::im2dOverridePS = colourfilterLCS_PS;
#endif
#ifdef RW_OPENGL
- rw::gl3::im2dOverrideShader = colourFilterVC;
- colourFilterVC->use();
- glUniform4fv(colourFilterVC->uniformLocations[u_blurcolor], 1, blurcolors);
+ rw::gl3::im2dOverrideShader = colourFilterLCS;
+ colourFilterLCS->use();
+ glUniform4fv(colourFilterLCS->uniformLocations[u_blurcolor], 1, blurcolors);
#endif
}
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
diff --git a/src/extras/postfx.h b/src/extras/postfx.h
index db702bf3..9538f8e1 100644
--- a/src/extras/postfx.h
+++ b/src/extras/postfx.h
@@ -7,9 +7,13 @@ class CPostFX
public:
enum {
POSTFX_OFF,
- POSTFX_SIMPLE,
+// POSTFX_SIMPLE,
POSTFX_NORMAL,
- POSTFX_MOBILE
+// POSTFX_MOBILE
+
+ // not so sensible for the moment
+ POSTFX_SIMPLE = -1,
+ POSTFX_MOBILE = -2
};
static RwRaster *pFrontBuffer;
static RwRaster *pBackBuffer;
diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile
index 5089e16a..393ab660 100644
--- a/src/extras/shaders/Makefile
+++ b/src/extras/shaders/Makefile
@@ -1,19 +1,22 @@
all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \
- colourfilterVC_fs_gl.inc contrast_fs_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
+ 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
-colourfilterVC_fs_gl.inc: colourfilterVC.frag
- (echo 'const char *colourfilterVC_frag_src =';\
- sed 's/..*/"&\\n"/' colourfilterVC.frag;\
- echo ';') >colourfilterVC_fs_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;\
@@ -76,3 +79,43 @@ 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/colourfilterLCS.frag b/src/extras/shaders/colourfilterLCS.frag
new file mode 100644
index 00000000..67348d0c
--- /dev/null
+++ b/src/extras/shaders/colourfilterLCS.frag
@@ -0,0 +1,20 @@
+uniform sampler2D tex0;
+uniform vec4 u_blurcolor;
+
+FSIN vec4 v_color;
+FSIN vec2 v_tex0;
+FSIN float v_fog;
+
+void
+main(void)
+{
+ vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
+ dst += dst*u_blurcolor;
+
+ vec4 color;
+ color.rgb = dst.rgb;
+ color.a = 1.0f;
+
+ FRAGCOLOR(color);
+}
+
diff --git a/src/extras/shaders/colourfilterLCS_PS.cso b/src/extras/shaders/colourfilterLCS_PS.cso
new file mode 100644
index 00000000..e5ffa3f1
--- /dev/null
+++ b/src/extras/shaders/colourfilterLCS_PS.cso
Binary files differ
diff --git a/src/extras/shaders/colourfilterLCS_PS.hlsl b/src/extras/shaders/colourfilterLCS_PS.hlsl
new file mode 100644
index 00000000..bd91567d
--- /dev/null
+++ b/src/extras/shaders/colourfilterLCS_PS.hlsl
@@ -0,0 +1,13 @@
+sampler2D tex : register(s0);
+float4 blurcol : register(c10);
+
+//float4 blurcols[10] : register(c15);
+
+
+float4 main(in float2 texcoord : TEXCOORD0) : COLOR0
+{
+ float4 dst = tex2D(tex, texcoord.xy);
+ dst += dst*blurcol;
+ dst.a = 1.0;
+ return dst;
+}
diff --git a/src/extras/shaders/colourfilterLCS_PS.inc b/src/extras/shaders/colourfilterLCS_PS.inc
new file mode 100644
index 00000000..f9eeab52
--- /dev/null
+++ b/src/extras/shaders/colourfilterLCS_PS.inc
@@ -0,0 +1,27 @@
+static unsigned char colourfilterLCS_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x2b, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x70, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x00,
+ 0x01, 0x00, 0x2a, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x6c, 0x75, 0x72,
+ 0x63, 0x6f, 0x6c, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00,
+ 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 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,
+ 0x51, 0x00, 0x00, 0x05, 0x00, 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, 0x03, 0xb0,
+ 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, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xe4, 0x80,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/colourfilterLCS_fs_gl.inc b/src/extras/shaders/colourfilterLCS_fs_gl.inc
new file mode 100644
index 00000000..2c8e3532
--- /dev/null
+++ b/src/extras/shaders/colourfilterLCS_fs_gl.inc
@@ -0,0 +1,22 @@
+const char *colourfilterLCS_frag_src =
+"uniform sampler2D tex0;\n"
+"uniform vec4 u_blurcolor;\n"
+
+"FSIN vec4 v_color;\n"
+"FSIN vec2 v_tex0;\n"
+"FSIN float v_fog;\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+" vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
+" dst += dst*u_blurcolor;\n"
+
+" vec4 color;\n"
+" color.rgb = dst.rgb;\n"
+" color.a = 1.0f;\n"
+
+" FRAGCOLOR(color);\n"
+"}\n"
+
+;
diff --git a/src/extras/shaders/colourfilterVC.frag b/src/extras/shaders/colourfilterVC.frag
deleted file mode 100644
index 9db3950e..00000000
--- a/src/extras/shaders/colourfilterVC.frag
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D tex0;
-uniform vec4 u_blurcolor;
-
-FSIN vec4 v_color;
-FSIN vec2 v_tex0;
-FSIN float v_fog;
-
-void
-main(void)
-{
- float a = u_blurcolor.a;
- vec4 doublec = clamp(u_blurcolor*2.0, 0.0, 1.0);
- vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
- vec4 prev = dst;
- for(int i = 0; i < 5; i++){
- vec4 tmp = dst*(1.0-a) + prev*doublec*a;
- tmp += prev*u_blurcolor;
- tmp += prev*u_blurcolor;
- prev = clamp(tmp, 0.0, 1.0);
- }
- vec4 color;
- color.rgb = prev.rgb;
- color.a = 1.0f;
-
- FRAGCOLOR(color);
-}
-
diff --git a/src/extras/shaders/colourfilterVC_PS.cso b/src/extras/shaders/colourfilterVC_PS.cso
deleted file mode 100644
index 4b0e9f3f..00000000
--- a/src/extras/shaders/colourfilterVC_PS.cso
+++ /dev/null
Binary files differ
diff --git a/src/extras/shaders/colourfilterVC_PS.hlsl b/src/extras/shaders/colourfilterVC_PS.hlsl
deleted file mode 100644
index 1e62950b..00000000
--- a/src/extras/shaders/colourfilterVC_PS.hlsl
+++ /dev/null
@@ -1,23 +0,0 @@
-sampler2D tex : register(s0);
-float4 blurcol : register(c10);
-
-//float4 blurcols[10] : register(c15);
-
-
-float4 main(in float2 texcoord : TEXCOORD0) : COLOR0
-{
- float a = blurcol.a;
-
- float4 doublec = saturate(blurcol*2);
- float4 dst = tex2D(tex, texcoord.xy);
- float4 prev = dst;
- for(int i = 0; i < 5; i++){
-// float4 doublec = saturate(blurcol*2);
- float4 tmp = dst*(1-a) + prev*doublec*a;
- tmp += prev*blurcol;
- tmp += prev*blurcol;
- prev = saturate(tmp);
- }
- prev.a = 1.0f;
- return prev;
-}
diff --git a/src/extras/shaders/colourfilterVC_PS.inc b/src/extras/shaders/colourfilterVC_PS.inc
deleted file mode 100644
index daa18360..00000000
--- a/src/extras/shaders/colourfilterVC_PS.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-static unsigned char colourfilterVC_PS_cso[] = {
- 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x2b, 0x00, 0x43, 0x54, 0x41, 0x42,
- 0x1c, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0x70, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x00,
- 0x01, 0x00, 0x2a, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x6c, 0x75, 0x72,
- 0x63, 0x6f, 0x6c, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00,
- 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 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,
- 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0xb0,
- 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, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x17, 0x80,
- 0x0a, 0x00, 0xe4, 0xa0, 0x0a, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03,
- 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80,
- 0x12, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x0a, 0x00, 0xff, 0xa0,
- 0x02, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x02, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x0a, 0x00, 0xe4, 0xa0,
- 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x17, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0x00, 0xa0, 0x03, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x0a, 0x00, 0xe4, 0xa0, 0x12, 0x00, 0x00, 0x04, 0x04, 0x00, 0x07, 0x80,
- 0x0a, 0x00, 0xff, 0xa0, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x17, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x0a, 0x00, 0xe4, 0xa0, 0x12, 0x00, 0x00, 0x04, 0x04, 0x00, 0x07, 0x80,
- 0x0a, 0x00, 0xff, 0xa0, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x17, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x0a, 0x00, 0xe4, 0xa0, 0x12, 0x00, 0x00, 0x04, 0x04, 0x00, 0x07, 0x80,
- 0x0a, 0x00, 0xff, 0xa0, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x17, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
- 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x0a, 0x00, 0xe4, 0xa0, 0x12, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80,
- 0x0a, 0x00, 0xff, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80,
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x17, 0x80, 0x02, 0x00, 0xe4, 0x80,
- 0x00, 0x00, 0x00, 0xa0, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02,
- 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
-};
diff --git a/src/extras/shaders/colourfilterVC_fs_gl.inc b/src/extras/shaders/colourfilterVC_fs_gl.inc
deleted file mode 100644
index 1f9bf6d8..00000000
--- a/src/extras/shaders/colourfilterVC_fs_gl.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-const char *colourfilterVC_frag_src =
-"uniform sampler2D tex0;\n"
-"uniform vec4 u_blurcolor;\n"
-
-"FSIN vec4 v_color;\n"
-"FSIN vec2 v_tex0;\n"
-"FSIN float v_fog;\n"
-
-"void\n"
-"main(void)\n"
-"{\n"
-" float a = u_blurcolor.a;\n"
-" vec4 doublec = clamp(u_blurcolor*2.0, 0.0, 1.0);\n"
-" vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
-" vec4 prev = dst;\n"
-" for(int i = 0; i < 5; i++){\n"
-" vec4 tmp = dst*(1.0-a) + prev*doublec*a;\n"
-" tmp += prev*u_blurcolor;\n"
-" tmp += prev*u_blurcolor;\n"
-" prev = clamp(tmp, 0.0, 1.0);\n"
-" }\n"
-" vec4 color;\n"
-" color.rgb = prev.rgb;\n"
-" color.a = 1.0f;\n"
-
-" FRAGCOLOR(color);\n"
-"}\n"
-
-;
diff --git a/src/extras/shaders/leedsBuilding.vert b/src/extras/shaders/leedsBuilding.vert
new file mode 100644
index 00000000..766cd081
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding.vert
@@ -0,0 +1,28 @@
+uniform vec4 u_amb;
+uniform vec4 u_emiss;
+
+#define surfEmissive (u_surfProps.w)
+
+VSIN(ATTRIB_POS) vec3 in_pos;
+
+VSOUT vec4 v_color;
+VSOUT vec2 v_tex0;
+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_color = in_color;
+ v_color.rgb *= u_amb.rgb;
+ v_color.rgb += u_emiss.rgb*surfEmissive;
+ v_color = clamp(v_color, 0.0, 1.0);
+ v_color.a *= u_matColor.a;
+
+ v_fog = DoFog(gl_Position.w);
+}
diff --git a/src/extras/shaders/leedsBuilding_VS.cso b/src/extras/shaders/leedsBuilding_VS.cso
new file mode 100644
index 00000000..6720364d
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsBuilding_VS.hlsl b/src/extras/shaders/leedsBuilding_VS.hlsl
new file mode 100644
index 00000000..1ed939cc
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_VS.hlsl
@@ -0,0 +1,43 @@
+#include "standardConstants.h"
+
+#define surfEmissive (surfProps.w)
+
+float4 emissive : register(c41);
+float4 ambient : register(c42);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float4 Color : COLOR0;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 Vertex = mul(worldMat, input.Position).xyz;
+ float3 Normal = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+
+ output.Color = input.Prelight;
+ output.Color.rgb *= ambient.rgb;
+ output.Color.rgb += emissive.rgb*surfEmissive;
+
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.Color.a *= matCol.a;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/extras/shaders/leedsBuilding_VS.inc b/src/extras/shaders/leedsBuilding_VS.inc
new file mode 100644
index 00000000..490a8c01
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_VS.inc
@@ -0,0 +1,57 @@
+static unsigned char leedsBuilding_VS_cso[] = {
+ 0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0x4a, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
+ 0x06, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xea, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x2a, 0x00,
+ 0x01, 0x00, 0xaa, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xac, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
+ 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x29, 0x00, 0x01, 0x00, 0xa6, 0x00, 0x9c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00,
+ 0x01, 0x00, 0x3a, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xd9, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x32, 0x00,
+ 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x36, 0x00, 0x9c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x00,
+ 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64,
+ 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x76, 0x65, 0x00, 0x66, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61,
+ 0x00, 0x6d, 0x61, 0x74, 0x43, 0x6f, 0x6c, 0x00, 0x73, 0x75, 0x72, 0x66,
+ 0x50, 0x72, 0x6f, 0x70, 0x73, 0x00, 0x76, 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, 0x04, 0x00, 0x0f, 0xa0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80,
+ 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80,
+ 0x02, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80,
+ 0x29, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x0d, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x2a, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80,
+ 0x02, 0x00, 0xff, 0x90, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x55, 0xa0,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0xff, 0x80,
+ 0x0c, 0x00, 0xff, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0xd0,
+ 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80,
+ 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x0e, 0x00, 0x55, 0xa1,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80,
+ 0x0e, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x55, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90,
+ 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/leedsBuilding_mobile.vert b/src/extras/shaders/leedsBuilding_mobile.vert
new file mode 100644
index 00000000..f06628ee
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_mobile.vert
@@ -0,0 +1,52 @@
+uniform vec4 u_amb;
+uniform vec4 u_emiss;
+
+#define surfEmissive (u_surfProps.w)
+
+#define vertContrast (1.5)
+#define vertBrightness (0.25)
+#define ambientContrast (1.2)
+#define ambientBrightness (0.1)
+#define emissiveContrast (1.25)
+#define emissiveBrightness (0.05)
+
+
+VSIN(ATTRIB_POS) vec3 in_pos;
+
+VSOUT vec4 v_color;
+VSOUT vec2 v_tex0;
+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;
+
+ vec4 vertCol = in_color;
+ vec4 amb = u_amb;
+ vec4 emiss = u_emiss;
+
+ vertCol.xyz = ((vertCol.xyz - 0.5) * max(vertContrast, 0.0)) + 0.5;
+ vertCol.xyz += vertBrightness;
+ vertCol.xyz = max(vertCol.xyz, vec3(0.0,0.0,0.0));
+
+ amb.xyz = ((amb.xyz - 0.5) * max(ambientContrast, 0.0)) + 0.5;
+ amb.xyz += ambientBrightness;
+ amb.xyz = max(amb.xyz, vec3(0.0,0.0,0.0));
+
+ emiss.xyz = ((emiss.xyz - 0.5) * max(emissiveContrast, 0.0)) + 0.5;
+ emiss.xyz += emissiveBrightness;
+ emiss.xyz = max(emiss.xyz, vec3(0.0,0.0,0.0));
+ v_color.xyz = emiss.xyz + (vertCol.xyz * amb.xyz);
+ v_color.w = vertCol.w;
+
+
+ v_color = clamp(v_color, 0.0, 1.0);
+ v_color.a *= u_matColor.a;
+
+ v_fog = DoFog(gl_Position.w);
+}
diff --git a/src/extras/shaders/leedsBuilding_mobile_VS.cso b/src/extras/shaders/leedsBuilding_mobile_VS.cso
new file mode 100644
index 00000000..c3ac2b9b
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_mobile_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsBuilding_mobile_VS.hlsl b/src/extras/shaders/leedsBuilding_mobile_VS.hlsl
new file mode 100644
index 00000000..23accf64
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_mobile_VS.hlsl
@@ -0,0 +1,64 @@
+#include "standardConstants.h"
+
+#define surfEmissive (surfProps.w)
+
+#define vertContrast (1.5)
+#define vertBrightness (0.25)
+#define ambientContrast (1.2)
+#define ambientBrightness (0.1)
+#define emissiveContrast (1.25)
+#define emissiveBrightness (0.05)
+
+float4 emissive : register(c41);
+float4 ambient : register(c42);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float4 Color : COLOR0;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 Vertex = mul(worldMat, input.Position).xyz;
+ float3 Normal = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+
+ float4 vertCol = input.Prelight;
+ float4 amb = ambient;
+ float4 emiss = emissive;
+
+ vertCol.xyz = ((vertCol.xyz - 0.5) * max(vertContrast, 0.0)) + 0.5;
+ vertCol.xyz += vertBrightness;
+ vertCol.xyz = max(vertCol.xyz, float3(0.0,0.0,0.0));
+
+ amb.xyz = ((amb.xyz - 0.5) * max(ambientContrast, 0.0)) + 0.5;
+ amb.xyz += ambientBrightness;
+ amb.xyz = max(amb.xyz, float3(0.0,0.0,0.0));
+
+ emiss.xyz = ((emiss.xyz - 0.5) * max(emissiveContrast, 0.0)) + 0.5;
+ emiss.xyz += emissiveBrightness;
+ emiss.xyz = max(emiss.xyz, float3(0.0,0.0,0.0));
+ output.Color.xyz = emiss.xyz + (vertCol.xyz * amb.xyz);
+ output.Color.w = vertCol.w;
+
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.Color.a *= matCol.a;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/extras/shaders/leedsBuilding_mobile_VS.inc b/src/extras/shaders/leedsBuilding_mobile_VS.inc
new file mode 100644
index 00000000..1433ca3f
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_mobile_VS.inc
@@ -0,0 +1,70 @@
+static unsigned char leedsBuilding_mobile_VS_cso[] = {
+ 0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0x42, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xcc, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x2a, 0x00,
+ 0x01, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x98, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
+ 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x29, 0x00, 0x01, 0x00, 0xa6, 0x00, 0x88, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00,
+ 0x01, 0x00, 0x3a, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc5, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x32, 0x00,
+ 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x6d, 0x62, 0x69,
+ 0x65, 0x6e, 0x74, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62,
+ 0x69, 0x6e, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00,
+ 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x65, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x76, 0x65, 0x00, 0x66, 0x6f, 0x67,
+ 0x44, 0x61, 0x74, 0x61, 0x00, 0x6d, 0x61, 0x74, 0x43, 0x6f, 0x6c, 0x00,
+ 0x76, 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, 0x51, 0x00, 0x00, 0x05,
+ 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0xc0, 0x3f,
+ 0x00, 0x00, 0x40, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05,
+ 0x05, 0x00, 0x0f, 0xa0, 0x9a, 0x99, 0x99, 0x3f, 0x9a, 0x99, 0x19, 0x3f,
+ 0x00, 0x00, 0xa0, 0x3f, 0xcd, 0xcc, 0x0c, 0x3f, 0x51, 0x00, 0x00, 0x05,
+ 0x06, 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, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x0a, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x02, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0x55, 0xa0, 0x04, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xff, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x04, 0x00, 0x00, 0xa0,
+ 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x00, 0x80,
+ 0x2a, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x55, 0xa0,
+ 0x0b, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80,
+ 0x01, 0x00, 0x00, 0x80, 0x29, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x02, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xaa, 0xa0,
+ 0x05, 0x00, 0xff, 0xa0, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x07, 0x80,
+ 0x02, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xff, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xf9, 0x80,
+ 0x02, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80,
+ 0x02, 0x00, 0xff, 0x90, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x06, 0x00, 0x00, 0xa0,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0xd0, 0x00, 0x00, 0xff, 0x80,
+ 0x0c, 0x00, 0xff, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0xd0,
+ 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80,
+ 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x0e, 0x00, 0x55, 0xa1,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80,
+ 0x0e, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90,
+ 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/leedsBuilding_mobile_vs_gl.inc b/src/extras/shaders/leedsBuilding_mobile_vs_gl.inc
new file mode 100644
index 00000000..56bb8a80
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_mobile_vs_gl.inc
@@ -0,0 +1,54 @@
+const char *leedsBuilding_mobile_vert_src =
+"uniform vec4 u_amb;\n"
+"uniform vec4 u_emiss;\n"
+
+"#define surfEmissive (u_surfProps.w)\n"
+
+"#define vertContrast (1.5)\n"
+"#define vertBrightness (0.25)\n"
+"#define ambientContrast (1.2)\n"
+"#define ambientBrightness (0.1)\n"
+"#define emissiveContrast (1.25)\n"
+"#define emissiveBrightness (0.05)\n"
+
+
+"VSIN(ATTRIB_POS) vec3 in_pos;\n"
+
+"VSOUT vec4 v_color;\n"
+"VSOUT vec2 v_tex0;\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"
+
+" vec4 vertCol = in_color;\n"
+" vec4 amb = u_amb;\n"
+" vec4 emiss = u_emiss;\n"
+
+" vertCol.xyz = ((vertCol.xyz - 0.5) * max(vertContrast, 0.0)) + 0.5;\n"
+" vertCol.xyz += vertBrightness;\n"
+" vertCol.xyz = max(vertCol.xyz, vec3(0.0,0.0,0.0));\n"
+" \n"
+" amb.xyz = ((amb.xyz - 0.5) * max(ambientContrast, 0.0)) + 0.5;\n"
+" amb.xyz += ambientBrightness;\n"
+" amb.xyz = max(amb.xyz, vec3(0.0,0.0,0.0));\n"
+" \n"
+" emiss.xyz = ((emiss.xyz - 0.5) * max(emissiveContrast, 0.0)) + 0.5;\n"
+" emiss.xyz += emissiveBrightness;\n"
+" emiss.xyz = max(emiss.xyz, vec3(0.0,0.0,0.0));\n"
+" v_color.xyz = emiss.xyz + (vertCol.xyz * amb.xyz);\n"
+" v_color.w = vertCol.w;\n"
+
+
+" v_color = clamp(v_color, 0.0, 1.0);\n"
+" v_color.a *= u_matColor.a;\n"
+
+" v_fog = DoFog(gl_Position.w);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/leedsBuilding_vs_gl.inc b/src/extras/shaders/leedsBuilding_vs_gl.inc
new file mode 100644
index 00000000..33c5eccc
--- /dev/null
+++ b/src/extras/shaders/leedsBuilding_vs_gl.inc
@@ -0,0 +1,30 @@
+const char *leedsBuilding_vert_src =
+"uniform vec4 u_amb;\n"
+"uniform vec4 u_emiss;\n"
+
+"#define surfEmissive (u_surfProps.w)\n"
+
+"VSIN(ATTRIB_POS) vec3 in_pos;\n"
+
+"VSOUT vec4 v_color;\n"
+"VSOUT vec2 v_tex0;\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_color = in_color;\n"
+" v_color.rgb *= u_amb.rgb;\n"
+" v_color.rgb += u_emiss.rgb*surfEmissive;\n"
+" v_color = clamp(v_color, 0.0, 1.0);\n"
+" v_color.a *= u_matColor.a;\n"
+
+" v_fog = DoFog(gl_Position.w);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/leedsVehicle.vert b/src/extras/shaders/leedsVehicle.vert
new file mode 100644
index 00000000..b93c7ea0
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle.vert
@@ -0,0 +1,27 @@
+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_VS.cso b/src/extras/shaders/leedsVehicle_VS.cso
new file mode 100644
index 00000000..57db3798
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_VS.hlsl b/src/extras/shaders/leedsVehicle_VS.hlsl
new file mode 100644
index 00000000..eb53313a
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_VS.hlsl
@@ -0,0 +1,45 @@
+#include "standardConstants.h"
+
+float4x4 texMat : register(c41);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float2 TexCoord1 : TEXCOORD1;
+ float4 Color : COLOR0;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 V = mul(worldMat, input.Position).xyz;
+ float3 N = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+ output.TexCoord1 = mul(texMat, float4(N, 1.0)).xy;
+
+ output.Color = input.Prelight;
+ output.Color.rgb += ambientLight.rgb * surfAmbient;
+
+ int i;
+ for(i = 0; i < numDirLights; i++)
+ output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse;
+ // PS2 clamps before material color
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.Color *= matCol;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/extras/shaders/leedsVehicle_VS.inc b/src/extras/shaders/leedsVehicle_VS.inc
new file mode 100644
index 00000000..89527d72
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_VS.inc
@@ -0,0 +1,103 @@
+static unsigned char leedsVehicle_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,
+ 0xf5, 0x01, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0f, 0x00,
+ 0x01, 0x00, 0x3e, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
+ 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, 0x42, 0x00, 0x2c, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00,
+ 0x01, 0x00, 0x3a, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x44, 0x01, 0x00, 0x00, 0x02, 0x00, 0x11, 0x00, 0x18, 0x00, 0x46, 0x00,
+ 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x32, 0x00, 0xf4, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00,
+ 0x03, 0x00, 0x22, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc4, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0xd4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x36, 0x00, 0xf4, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, 0x02, 0x00, 0x29, 0x00,
+ 0x04, 0x00, 0xa6, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x67, 0x68, 0x74,
+ 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62,
+ 0x69, 0x6e, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00,
+ 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x66, 0x69, 0x72, 0x73, 0x74, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x00, 0xab,
+ 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x00,
+ 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x00, 0xab, 0x4b, 0x01, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00,
+ 0x64, 0x01, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x6d, 0x01, 0x00, 0x00,
+ 0x54, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0c, 0x00,
+ 0x08, 0x00, 0x03, 0x00, 0x78, 0x01, 0x00, 0x00, 0x6d, 0x61, 0x74, 0x43,
+ 0x6f, 0x6c, 0x00, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74,
+ 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6d, 0x44,
+ 0x69, 0x72, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0xab, 0xab, 0xab,
+ 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x73, 0x75, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70,
+ 0x73, 0x00, 0x74, 0x65, 0x78, 0x4d, 0x61, 0x74, 0x00, 0x76, 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,
+ 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40,
+ 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x0a, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x05, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80,
+ 0x03, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x55, 0x90,
+ 0x09, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80,
+ 0x08, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x0a, 0x00, 0xe4, 0xa0,
+ 0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02,
+ 0x01, 0x00, 0x01, 0x80, 0x0d, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x04,
+ 0x01, 0x00, 0x07, 0x80, 0x0f, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x80,
+ 0x03, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x08, 0x80,
+ 0x04, 0x00, 0x00, 0xa0, 0x26, 0x00, 0x00, 0x01, 0x00, 0x00, 0xe4, 0xf0,
+ 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x80,
+ 0x10, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80,
+ 0x03, 0x00, 0x00, 0x80, 0x04, 0x00, 0x55, 0xa0, 0x2e, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x01, 0xb0, 0x03, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x04,
+ 0x03, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x13, 0x20, 0xe4, 0xa1,
+ 0x00, 0x00, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80,
+ 0x03, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x04,
+ 0x03, 0x00, 0x07, 0x80, 0x03, 0x00, 0x00, 0x80, 0x11, 0x20, 0xe4, 0xa0,
+ 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80,
+ 0x03, 0x00, 0xe4, 0x80, 0x0d, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xe4, 0x80,
+ 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80,
+ 0x04, 0x00, 0xaa, 0xa0, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02,
+ 0x02, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0x90, 0x0b, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0xa0,
+ 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xd0,
+ 0x01, 0x00, 0xe4, 0x80, 0x0c, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x55, 0x80, 0x2a, 0x00, 0xe4, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x29, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x03, 0x80, 0x2b, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0xe0,
+ 0x00, 0x00, 0xe4, 0x80, 0x2c, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x0e, 0x00, 0x55, 0xa1,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80,
+ 0x0e, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0xaa, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90,
+ 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/leedsVehicle_add.frag b/src/extras/shaders/leedsVehicle_add.frag
new file mode 100644
index 00000000..e9bcef74
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_add.frag
@@ -0,0 +1,32 @@
+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
new file mode 100644
index 00000000..11db8b0e
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_add_PS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_add_PS.hlsl b/src/extras/shaders/leedsVehicle_add_PS.hlsl
new file mode 100644
index 00000000..943926cf
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_add_PS.hlsl
@@ -0,0 +1,34 @@
+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.
+ // 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;
+
+ return color;
+}
diff --git a/src/extras/shaders/leedsVehicle_add_PS.inc b/src/extras/shaders/leedsVehicle_add_PS.inc
new file mode 100644
index 00000000..dc8378f4
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_add_PS.inc
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 00000000..a9835b13
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_add_gl.inc
@@ -0,0 +1,34 @@
+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.frag b/src/extras/shaders/leedsVehicle_blend.frag
new file mode 100644
index 00000000..a3fab072
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_blend.frag
@@ -0,0 +1,32 @@
+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*(1.0-pass2.a) + pass2.rgb*pass2.a;
+ color.a = pass1.a*(1.0-pass2.a) + pass2.a;
+
+ DoAlphaTest(color.a);
+
+ FRAGCOLOR(color);
+}
diff --git a/src/extras/shaders/leedsVehicle_blend_PS.cso b/src/extras/shaders/leedsVehicle_blend_PS.cso
new file mode 100644
index 00000000..8d104803
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_blend_PS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_blend_PS.hlsl b/src/extras/shaders/leedsVehicle_blend_PS.hlsl
new file mode 100644
index 00000000..e32970b2
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_blend_PS.hlsl
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 00000000..94fb000c
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_blend_PS.inc
@@ -0,0 +1,50 @@
+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_blend_gl.inc b/src/extras/shaders/leedsVehicle_blend_gl.inc
new file mode 100644
index 00000000..707afb10
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_blend_gl.inc
@@ -0,0 +1,34 @@
+const char *leedsVehicle_blend_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*(1.0-pass2.a) + pass2.rgb*pass2.a;\n"
+" color.a = pass1.a*(1.0-pass2.a) + pass2.a;\n"
+
+" DoAlphaTest(color.a);\n"
+
+" FRAGCOLOR(color);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/leedsVehicle_mobile.frag b/src/extras/shaders/leedsVehicle_mobile.frag
new file mode 100644
index 00000000..467379dd
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile.frag
@@ -0,0 +1,76 @@
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+uniform float u_fxparams;
+uniform vec3 u_skyTop;
+uniform vec3 u_skyBot;
+
+#define shininess (u_fxparams)
+
+// matfx:
+// case 1 normal envmap
+// custom1 (4.0, 1.0, 1.0, coef)
+// custom2 (0.25, 3.0, 1.0, 1.0)
+// case 2 too strong
+// custom1 (4.0, 1.0, 2.0, coef)
+// custom2 (0.5, 3.0, 1.0, 1.0)
+// ???: practically no fresnel
+// custom1 (4.0, 1.25, 0.01, coef)
+// custom2 (1.0, 2.0, 1.1, 2.0)
+
+#define power (4.0)
+
+#define preMult (1.0)
+#define postMult (1.0)
+#define minRefl (0.25)
+#define maxRefl (3.0)
+#define minOpacity (1.0)
+#define maxOpacity (1.0)
+
+//#define preMult (1.0)
+//#define postMult (2.0)
+//#define minRefl (0.5)
+//#define maxRefl (3.0)
+//#define minOpacity (1.0)
+//#define maxOpacity (1.0)
+
+//#define preMult (1.25)
+//#define postMult (0.01)
+//#define minRefl (1.0)
+//#define maxRefl (2.0)
+//#define minOpacity (1.1)
+//#define maxOpacity (2.0)
+
+FSIN vec4 v_color;
+FSIN vec2 v_tex0;
+FSIN vec2 v_tex1;
+FSIN float v_fog;
+FSIN vec2 v_reflData;
+
+#define v_NdotV (v_reflData.x)
+#define v_lightingCont (v_reflData.y)
+
+void
+main(void)
+{
+ vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
+
+ vec3 envtex = texture(tex1, v_tex1).rgb; // V flipped
+ vec3 skyColour = mix(u_skyBot, u_skyTop, envtex.g);
+ vec3 envOut = mix(envtex.rrr, skyColour, envtex.b);
+
+ float fresnel = mix(shininess, shininess * 2.0, v_NdotV);
+ fresnel = pow(v_NdotV * preMult, power);
+ fresnel = clamp(fresnel * postMult, 0.0, 1.0);
+ float reflectivity = v_lightingCont * mix(minRefl, maxRefl, fresnel)*shininess;
+
+ float opacity = mix(minOpacity, maxOpacity, fresnel)*pass1.a;
+ vec4 color = pass1 + vec4(reflectivity * envOut, 0.0);
+ color.a = opacity;
+
+ color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);
+
+ DoAlphaTest(color.a);
+
+ FRAGCOLOR(color);
+}
diff --git a/src/extras/shaders/leedsVehicle_mobile.vert b/src/extras/shaders/leedsVehicle_mobile.vert
new file mode 100644
index 00000000..b2123fa4
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile.vert
@@ -0,0 +1,40 @@
+uniform vec4 u_amb;
+uniform vec4 u_emiss;
+
+VSIN(ATTRIB_POS) vec3 in_pos;
+
+VSOUT vec4 v_color;
+VSOUT vec2 v_tex0;
+VSOUT vec2 v_tex1;
+VSOUT float v_fog;
+VSOUT vec2 v_reflData;
+
+#define v_NdotV (v_reflData.x)
+#define v_lightingCont (v_reflData.y)
+
+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;
+
+ vec3 ViewNormal = mat3(u_view) * Normal;
+ v_tex1 = (ViewNormal.xy + vec2(1.0, 1.0))*0.5;
+
+ v_color = in_color;
+ vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z);
+ v_color.rgb += combinedAmbient.rgb*surfAmbient;
+ v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;
+ v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0);
+ v_color *= u_matColor;
+
+ // for fresnel
+ vec3 camPos = -u_view[3].xyz * mat3(u_view);
+ vec3 viewVec = normalize(Vertex.xyz - camPos);
+ v_NdotV = 1.0 - dot(-Normal.xyz, viewVec.xyz);
+
+ v_fog = DoFog(gl_Position.w);
+}
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.cso b/src/extras/shaders/leedsVehicle_mobile_PS.cso
new file mode 100644
index 00000000..04ffcf8e
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_PS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl
new file mode 100644
index 00000000..da09b872
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl
@@ -0,0 +1,53 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float2 TexCoord1 : TEXCOORD1;
+ float2 ReflData : TEXCOORD2;
+ float4 Color : COLOR0;
+};
+
+#define NdotV (input.ReflData.x)
+#define lightingCont (input.ReflData.y)
+
+sampler2D diffTex : register(s0);
+sampler2D envTex : register(s1);
+
+float4 fogColor : register(c0);
+
+float4 fxparams : register(c1);
+float3 skyTop : register(c2);
+float3 skyBot : register(c3);
+
+#define shininess (fxparams.x)
+
+#define power (4.0)
+
+#define preMult (1.0)
+#define postMult (1.0)
+#define minRefl (0.25)
+#define maxRefl (3.0)
+#define minOpacity (1.0)
+#define maxOpacity (1.0)
+
+
+float4 main(VS_out input) : COLOR
+{
+ float4 pass1 = input.Color*tex2D(diffTex, input.TexCoord0.xy);
+
+ float3 envtex = tex2D(envTex, float2(input.TexCoord1.x, 1.0-input.TexCoord1.y)).rgb; // V flipped
+ float3 skyColour = lerp(skyBot, skyTop, envtex.g);
+ float3 envOut = lerp(envtex.rrr, skyColour, envtex.b);
+
+ float fresnel = lerp(shininess, shininess * 2.0, NdotV);
+ fresnel = pow(NdotV * preMult, power);
+ fresnel = clamp(fresnel * postMult, 0.0, 1.0);
+ float reflectivity = lightingCont * lerp(minRefl, maxRefl, fresnel)*shininess;
+
+ float opacity = lerp(minOpacity, maxOpacity, fresnel)*pass1.a;
+ float4 color = pass1 + float4(reflectivity * envOut, 0.0);
+ color.a = opacity;
+
+ color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z);
+
+ return color;
+}
diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.inc b/src/extras/shaders/leedsVehicle_mobile_PS.inc
new file mode 100644
index 00000000..ab8cc048
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_PS.inc
@@ -0,0 +1,63 @@
+static unsigned char leedsVehicle_mobile_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x51, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x06, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x07, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 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,
+ 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0a, 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,
+ 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, 0x73, 0x6b, 0x79, 0x42, 0x6f, 0x74, 0x00,
+ 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x73, 0x6b, 0x79, 0x54, 0x6f, 0x70, 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, 0x51, 0x00, 0x00, 0x05,
+ 0x04, 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,
+ 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, 0x02, 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,
+ 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x03, 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,
+ 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,
+ 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,
+ 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x18, 0x80, 0x03, 0x00, 0xff, 0x80,
+ 0x03, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x08, 0x80,
+ 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,
+ 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,
+ 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/leedsVehicle_mobile_VS.cso b/src/extras/shaders/leedsVehicle_mobile_VS.cso
new file mode 100644
index 00000000..85796f30
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_VS.cso
Binary files differ
diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.hlsl b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl
new file mode 100644
index 00000000..3085c5e4
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl
@@ -0,0 +1,57 @@
+#include "standardConstants.h"
+
+float4 emissive : register(c41);
+float4 ambient : register(c42);
+float4x4 viewMat : register(c43);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float2 TexCoord1 : TEXCOORD1;
+ float2 ReflData : TEXCOORD2;
+ float4 Color : COLOR0;
+};
+
+#define NdotV (output.ReflData.x)
+#define lightingCont (output.ReflData.y)
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 V = mul(worldMat, input.Position).xyz;
+ float3 N = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+
+ float4 ViewNormal = mul(viewMat, float4(N, 0.0));
+ output.TexCoord1 = (ViewNormal.xy + float2(1.0, 1.0))*0.5;
+
+ output.Color = input.Prelight;
+ float4 combinedAmbient = lerp(emissive, ambient, N.z);
+ output.Color.rgb += combinedAmbient.rgb * surfAmbient;
+
+ int i;
+ for(i = 0; i < numDirLights; i++)
+ output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse;
+ lightingCont = max(0.5, (output.Color.r + output.Color.g + output.Color.b) / 3.0);
+ output.Color *= matCol;
+
+ // for fresnel
+ float3 camPos = mul(-viewMat._m03_m13_m23, (float3x3)(viewMat));
+ float3 viewVec = normalize(V.xyz - camPos);
+ NdotV = 1.0 - dot(-N.xyz, viewVec.xyz);
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.inc b/src/extras/shaders/leedsVehicle_mobile_VS.inc
new file mode 100644
index 00000000..aa8859b1
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_VS.inc
@@ -0,0 +1,132 @@
+static unsigned char leedsVehicle_mobile_VS_cso[] = {
+ 0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0x99, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
+ 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x27, 0x02, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x2a, 0x00,
+ 0x01, 0x00, 0xaa, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x24, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
+ 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x29, 0x00, 0x01, 0x00, 0xa6, 0x00, 0x14, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00,
+ 0x01, 0x00, 0x42, 0x00, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x64, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x3a, 0x00,
+ 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x11, 0x00, 0x18, 0x00, 0x46, 0x00, 0xb8, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00,
+ 0x01, 0x00, 0x32, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xcf, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x03, 0x00, 0x22, 0x00,
+ 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xfc, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x00,
+ 0x01, 0x00, 0x36, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x16, 0x02, 0x00, 0x00, 0x02, 0x00, 0x2b, 0x00, 0x04, 0x00, 0xae, 0x00,
+ 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00,
+ 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x00, 0x30, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x00,
+ 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64,
+ 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x76, 0x65, 0x00, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4c, 0x69,
+ 0x67, 0x68, 0x74, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x67, 0x44,
+ 0x61, 0x74, 0x61, 0x00, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00,
+ 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0xab, 0x73, 0x01, 0x00, 0x00,
+ 0x7c, 0x01, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00,
+ 0x95, 0x01, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x03, 0x00, 0xa0, 0x01, 0x00, 0x00,
+ 0x6d, 0x61, 0x74, 0x43, 0x6f, 0x6c, 0x00, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
+ 0x6c, 0x4d, 0x61, 0x74, 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00,
+ 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x6e, 0x75, 0x6d, 0x44, 0x69, 0x72, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73,
+ 0x00, 0xab, 0xab, 0xab, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x75, 0x72, 0x66,
+ 0x50, 0x72, 0x6f, 0x70, 0x73, 0x00, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x61,
+ 0x74, 0x00, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x76,
+ 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, 0x51, 0x00, 0x00, 0x05,
+ 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x51, 0x00, 0x00, 0x05,
+ 0x0f, 0x00, 0x0f, 0xa0, 0xab, 0xaa, 0xaa, 0x3e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
+ 0x0a, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x05, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80,
+ 0x03, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x55, 0x90,
+ 0x05, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80,
+ 0x04, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x06, 0x00, 0xe4, 0xa0,
+ 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x07, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80,
+ 0x2e, 0x00, 0xe4, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80,
+ 0x01, 0x00, 0xe4, 0x81, 0x2b, 0x00, 0xe4, 0xa0, 0x08, 0x00, 0x00, 0x03,
+ 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0xe4, 0x81, 0x2c, 0x00, 0xe4, 0xa0,
+ 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x81,
+ 0x2d, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80,
+ 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x81, 0x24, 0x00, 0x00, 0x02,
+ 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x55, 0x90, 0x09, 0x00, 0xe4, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x08, 0x00, 0xe4, 0xa0,
+ 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x07, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90,
+ 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0xe4, 0x81, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x06, 0x80, 0x00, 0x00, 0x55, 0x80, 0x2c, 0x00, 0xd0, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x06, 0x80, 0x2b, 0x00, 0xd0, 0xa0,
+ 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
+ 0x01, 0x00, 0x06, 0x80, 0x2d, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xaa, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x06, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe9, 0x80, 0x0b, 0x00, 0x55, 0xa0,
+ 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x29, 0x00, 0xe4, 0xa0,
+ 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x81,
+ 0x2a, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80,
+ 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x90, 0xa0,
+ 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0xe4, 0x80,
+ 0x0d, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x90, 0x90, 0x01, 0x00, 0x00, 0x02,
+ 0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xf9, 0x80, 0x01, 0x00, 0x00, 0x02,
+ 0x03, 0x00, 0x01, 0x80, 0x0b, 0x00, 0xaa, 0xa0, 0x26, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0xe4, 0xf0, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x02, 0x80,
+ 0x03, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
+ 0x03, 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0x80, 0x0b, 0x00, 0xff, 0xa0,
+ 0x2e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0xb0, 0x03, 0x00, 0x55, 0x80,
+ 0x08, 0x00, 0x00, 0x04, 0x03, 0x00, 0x02, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x13, 0x20, 0xe4, 0xa1, 0x00, 0x00, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x03,
+ 0x03, 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0x80, 0x0b, 0x00, 0xaa, 0xa0,
+ 0x05, 0x00, 0x00, 0x04, 0x03, 0x00, 0x0e, 0x80, 0x03, 0x00, 0x55, 0x80,
+ 0x11, 0x20, 0x90, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00, 0x04,
+ 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xf9, 0x80, 0x0d, 0x00, 0xaa, 0xa0,
+ 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80,
+ 0x03, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x27, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0x90,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xd0, 0x02, 0x00, 0xe4, 0x80,
+ 0x0c, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0xe0,
+ 0x01, 0x00, 0x00, 0x81, 0x0b, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x80,
+ 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xa0, 0x0b, 0x00, 0x00, 0x03,
+ 0x02, 0x00, 0x02, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x55, 0xa0,
+ 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80,
+ 0x0e, 0x00, 0x55, 0xa1, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xff, 0xa0,
+ 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x80,
+ 0x0b, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xe0,
+ 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc b/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc
new file mode 100644
index 00000000..8098599c
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc
@@ -0,0 +1,78 @@
+const char *leedsVehicle_mobile_frag_src =
+"uniform sampler2D tex0;\n"
+"uniform sampler2D tex1;\n"
+
+"uniform float u_fxparams;\n"
+"uniform vec3 u_skyTop;\n"
+"uniform vec3 u_skyBot;\n"
+
+"#define shininess (u_fxparams)\n"
+
+"// matfx:\n"
+"// case 1 normal envmap\n"
+"// custom1 (4.0, 1.0, 1.0, coef)\n"
+"// custom2 (0.25, 3.0, 1.0, 1.0)\n"
+"// case 2 too strong\n"
+"// custom1 (4.0, 1.0, 2.0, coef)\n"
+"// custom2 (0.5, 3.0, 1.0, 1.0)\n"
+"// ???: practically no fresnel\n"
+"// custom1 (4.0, 1.25, 0.01, coef)\n"
+"// custom2 (1.0, 2.0, 1.1, 2.0)\n"
+
+"#define power (4.0)\n"
+
+"#define preMult (1.0)\n"
+"#define postMult (1.0)\n"
+"#define minRefl (0.25)\n"
+"#define maxRefl (3.0)\n"
+"#define minOpacity (1.0)\n"
+"#define maxOpacity (1.0)\n"
+
+"//#define preMult (1.0)\n"
+"//#define postMult (2.0)\n"
+"//#define minRefl (0.5)\n"
+"//#define maxRefl (3.0)\n"
+"//#define minOpacity (1.0)\n"
+"//#define maxOpacity (1.0)\n"
+
+"//#define preMult (1.25)\n"
+"//#define postMult (0.01)\n"
+"//#define minRefl (1.0)\n"
+"//#define maxRefl (2.0)\n"
+"//#define minOpacity (1.1)\n"
+"//#define maxOpacity (2.0)\n"
+
+"FSIN vec4 v_color;\n"
+"FSIN vec2 v_tex0;\n"
+"FSIN vec2 v_tex1;\n"
+"FSIN float v_fog;\n"
+"FSIN vec2 v_reflData;\n"
+
+"#define v_NdotV (v_reflData.x)\n"
+"#define v_lightingCont (v_reflData.y)\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+" vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
+
+" vec3 envtex = texture(tex1, v_tex1).rgb; // V flipped\n"
+" vec3 skyColour = mix(u_skyBot, u_skyTop, envtex.g);\n"
+" vec3 envOut = mix(envtex.rrr, skyColour, envtex.b);\n"
+
+" float fresnel = mix(shininess, shininess * 2.0, v_NdotV);\n"
+" fresnel = pow(v_NdotV * preMult, power);\n"
+" fresnel = clamp(fresnel * postMult, 0.0, 1.0);\n"
+" float reflectivity = v_lightingCont * mix(minRefl, maxRefl, fresnel)*shininess;\n"
+
+" float opacity = mix(minOpacity, maxOpacity, fresnel)*pass1.a;\n"
+" vec4 color = pass1 + vec4(reflectivity * envOut, 0.0);\n"
+" color.a = opacity;\n"
+
+" color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);\n"
+
+" DoAlphaTest(color.a);\n"
+
+" FRAGCOLOR(color);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc
new file mode 100644
index 00000000..3609e369
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc
@@ -0,0 +1,42 @@
+const char *leedsVehicle_mobile_vert_src =
+"uniform vec4 u_amb;\n"
+"uniform vec4 u_emiss;\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"
+"VSOUT vec2 v_reflData;\n"
+
+"#define v_NdotV (v_reflData.x)\n"
+"#define v_lightingCont (v_reflData.y)\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"
+
+" vec3 ViewNormal = mat3(u_view) * Normal;\n"
+" v_tex1 = (ViewNormal.xy + vec2(1.0, 1.0))*0.5;\n"
+
+" v_color = in_color;\n"
+" vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z);\n"
+" v_color.rgb += combinedAmbient.rgb*surfAmbient;\n"
+" v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n"
+" v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0);\n"
+" v_color *= u_matColor;\n"
+
+" // for fresnel\n"
+" vec3 camPos = -u_view[3].xyz * mat3(u_view);\n"
+" vec3 viewVec = normalize(Vertex.xyz - camPos);\n"
+" v_NdotV = 1.0 - dot(-Normal.xyz, viewVec.xyz);\n"
+
+" v_fog = DoFog(gl_Position.w);\n"
+"}\n"
+;
diff --git a/src/extras/shaders/leedsVehicle_vs_gl.inc b/src/extras/shaders/leedsVehicle_vs_gl.inc
new file mode 100644
index 00000000..eb36b6e9
--- /dev/null
+++ b/src/extras/shaders/leedsVehicle_vs_gl.inc
@@ -0,0 +1,29 @@
+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/scale.frag b/src/extras/shaders/scale.frag
new file mode 100644
index 00000000..29165154
--- /dev/null
+++ b/src/extras/shaders/scale.frag
@@ -0,0 +1,18 @@
+uniform sampler2D tex0;
+uniform vec4 u_colorscale;
+
+FSIN vec4 v_color;
+FSIN vec2 v_tex0;
+FSIN float v_fog;
+
+void
+main(void)
+{
+ vec4 color;
+ color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;
+ color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);
+ DoAlphaTest(color.a);
+
+ FRAGCOLOR(color);
+}
+
diff --git a/src/extras/shaders/scale_PS.cso b/src/extras/shaders/scale_PS.cso
new file mode 100644
index 00000000..d7f7374c
--- /dev/null
+++ b/src/extras/shaders/scale_PS.cso
Binary files differ
diff --git a/src/extras/shaders/scale_PS.hlsl b/src/extras/shaders/scale_PS.hlsl
new file mode 100644
index 00000000..92466e94
--- /dev/null
+++ b/src/extras/shaders/scale_PS.hlsl
@@ -0,0 +1,19 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float4 Color : COLOR0;
+};
+
+sampler2D tex0 : register(s0);
+
+float4 fogColor : register(c0);
+float4 colorscale : register(c1);
+
+float4 main(VS_out input) : COLOR
+{
+ float4 color = input.Color;
+ color *= tex2D(tex0, input.TexCoord0.xy);
+ color *= colorscale;
+ color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z);
+ return color;
+}
diff --git a/src/extras/shaders/scale_PS.inc b/src/extras/shaders/scale_PS.inc
new file mode 100644
index 00000000..5f711ac8
--- /dev/null
+++ b/src/extras/shaders/scale_PS.inc
@@ -0,0 +1,33 @@
+static unsigned char scale_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x34, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x94, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x06, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x84, 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, 0x66, 0x6f, 0x67, 0x43,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x74, 0x65, 0x78, 0x30, 0x00, 0xab, 0xab,
+ 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 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,
+ 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 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,
+ 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
+};
diff --git a/src/extras/shaders/scale_fs_gl.inc b/src/extras/shaders/scale_fs_gl.inc
new file mode 100644
index 00000000..8d9563e2
--- /dev/null
+++ b/src/extras/shaders/scale_fs_gl.inc
@@ -0,0 +1,20 @@
+const char *scale_frag_src =
+"uniform sampler2D tex0;\n"
+"uniform vec4 u_colorscale;\n"
+
+"FSIN vec4 v_color;\n"
+"FSIN vec2 v_tex0;\n"
+"FSIN float v_fog;\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+" vec4 color;\n"
+" color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y))*u_colorscale;\n"
+" color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);\n"
+" DoAlphaTest(color.a);\n"
+
+" FRAGCOLOR(color);\n"
+"}\n"
+
+;