mirror of
https://github.com/halpz/re3.git
synced 2024-12-26 18:15:27 +00:00
timecycle; some rendering
This commit is contained in:
parent
ebdf08a514
commit
37a58a04f2
|
@ -241,7 +241,7 @@ CFileMgr::SetDirMyDocuments(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode)
|
CFileMgr::LoadFile(const char *file, uint8 *buf, int maxlen, const char *mode)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
ssize_t n, len;
|
ssize_t n, len;
|
||||||
|
@ -257,6 +257,7 @@ CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode)
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
len += n;
|
len += n;
|
||||||
|
assert(len < maxlen);
|
||||||
}while(n == 0x4000);
|
}while(n == 0x4000);
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
myfclose(fd);
|
myfclose(fd);
|
||||||
|
|
|
@ -9,7 +9,7 @@ public:
|
||||||
static void ChangeDir(const char *dir);
|
static void ChangeDir(const char *dir);
|
||||||
static void SetDir(const char *dir);
|
static void SetDir(const char *dir);
|
||||||
static void SetDirMyDocuments(void);
|
static void SetDirMyDocuments(void);
|
||||||
static ssize_t LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
|
static ssize_t LoadFile(const char *file, uint8 *buf, int maxlen, const char *mode);
|
||||||
static int OpenFile(const char *file, const char *mode);
|
static int OpenFile(const char *file, const char *mode);
|
||||||
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
|
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
|
||||||
static int OpenFileForWriting(const char *file);
|
static int OpenFileForWriting(const char *file);
|
||||||
|
|
|
@ -541,7 +541,12 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId)
|
||||||
|
|
||||||
// Txd and anim have to be loaded
|
// Txd and anim have to be loaded
|
||||||
int animId = mi->GetAnimFileIndex();
|
int animId = mi->GetAnimFileIndex();
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if(!HasTxdLoaded(mi->GetTxdSlot()) ||
|
||||||
|
#else
|
||||||
|
// texDict will exist even if only first part has loaded
|
||||||
if(CTxdStore::GetSlot(mi->GetTxdSlot())->texDict == nil ||
|
if(CTxdStore::GetSlot(mi->GetTxdSlot())->texDict == nil ||
|
||||||
|
#endif
|
||||||
animId != -1 && !CAnimManager::GetAnimationBlock(animId)->isLoaded){
|
animId != -1 && !CAnimManager::GetAnimationBlock(animId)->isLoaded){
|
||||||
RemoveModel(streamId);
|
RemoveModel(streamId);
|
||||||
ReRequestModel(streamId);
|
ReRequestModel(streamId);
|
||||||
|
|
|
@ -71,7 +71,7 @@ enum Config {
|
||||||
|
|
||||||
PATHNODESIZE = 4500,
|
PATHNODESIZE = 4500,
|
||||||
|
|
||||||
NUMWEATHERS = 7,
|
NUMWEATHERS = 8,
|
||||||
NUMHOURS = 24,
|
NUMHOURS = 24,
|
||||||
|
|
||||||
NUMEXTRADIRECTIONALS = 4,
|
NUMEXTRADIRECTIONALS = 4,
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
GlobalScene Scene;
|
GlobalScene Scene;
|
||||||
|
|
||||||
uint8 work_buff[55000];
|
uint8 work_buff[55000 * 2];
|
||||||
char gString[256];
|
char gString[256];
|
||||||
char gString2[512];
|
char gString2[512];
|
||||||
wchar gUString[256];
|
wchar gUString[256];
|
||||||
|
|
|
@ -7,7 +7,7 @@ struct GlobalScene
|
||||||
};
|
};
|
||||||
extern GlobalScene Scene;
|
extern GlobalScene Scene;
|
||||||
|
|
||||||
extern uint8 work_buff[55000];
|
extern uint8 work_buff[55000 * 2];
|
||||||
extern char gString[256];
|
extern char gString[256];
|
||||||
extern char gString2[512];
|
extern char gString2[512];
|
||||||
extern wchar gUString[256];
|
extern wchar gUString[256];
|
||||||
|
|
|
@ -36,7 +36,13 @@ enum {
|
||||||
VSLOC_eye = rw::d3d::VSLOC_afterLights,
|
VSLOC_eye = rw::d3d::VSLOC_afterLights,
|
||||||
|
|
||||||
VSLOC_reflProps,
|
VSLOC_reflProps,
|
||||||
VSLOC_specLights
|
VSLOC_specLights,
|
||||||
|
|
||||||
|
// Leeds building
|
||||||
|
VSLOC_emissive = rw::d3d::VSLOC_afterLights,
|
||||||
|
VSLOC_ambient,
|
||||||
|
|
||||||
|
PSLOC_colorscale = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -182,11 +188,11 @@ DestroyVehiclePipe(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Neo World pipe
|
* Leeds World pipe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void *neoWorld_VS;
|
static void *leedsBuilding_VS;
|
||||||
static void *neoWorldVC_PS;
|
static void *scale_PS;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
|
worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
|
||||||
|
@ -195,79 +201,67 @@ worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
|
||||||
using namespace rw::d3d;
|
using namespace rw::d3d;
|
||||||
using namespace rw::d3d9;
|
using namespace rw::d3d9;
|
||||||
|
|
||||||
if(!LightmapEnable){
|
|
||||||
defaultRenderCB_Shader(atomic, header);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vsBits;
|
int vsBits;
|
||||||
setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
|
setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
|
||||||
setIndices(header->indexBuffer);
|
setIndices(header->indexBuffer);
|
||||||
setVertexDeclaration(header->vertexDeclaration);
|
setVertexDeclaration(header->vertexDeclaration);
|
||||||
|
|
||||||
vsBits = lightingCB_Shader(atomic);
|
setVertexShader(leedsBuilding_VS);
|
||||||
|
setPixelShader(scale_PS);
|
||||||
|
|
||||||
uploadMatrices(atomic->getFrame()->getLTM());
|
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;
|
||||||
|
|
||||||
float lightfactor[4];
|
d3ddevice->SetVertexShaderConstantF(VSLOC_ambient, (float*)&amb, 1);
|
||||||
|
d3ddevice->SetVertexShaderConstantF(VSLOC_emissive, (float*)&emiss, 1);
|
||||||
|
|
||||||
|
float colorscale[4];
|
||||||
|
colorscale[3] = 1.0f;
|
||||||
|
|
||||||
InstanceData *inst = header->inst;
|
InstanceData *inst = header->inst;
|
||||||
for(rw::uint32 i = 0; i < header->numMeshes; i++){
|
for(rw::uint32 i = 0; i < header->numMeshes; i++){
|
||||||
Material *m = inst->material;
|
Material *m = inst->material;
|
||||||
|
|
||||||
if(MatFX::getEffects(m) == MatFX::DUAL){
|
float cs = 1.0f;
|
||||||
setVertexShader(neoWorld_VS);
|
if(m->texture)
|
||||||
|
cs = 255/128.0f;
|
||||||
MatFX *matfx = MatFX::get(m);
|
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
||||||
Texture *dualtex = matfx->getDualTexture();
|
d3ddevice->SetPixelShaderConstantF(PSLOC_colorscale, colorscale, 1);
|
||||||
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);
|
|
||||||
|
|
||||||
if(m->texture)
|
if(m->texture)
|
||||||
d3d::setTexture(0, m->texture);
|
d3d::setTexture(0, m->texture);
|
||||||
else
|
else
|
||||||
d3d::setTexture(0, gpWhiteTexture);
|
d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
|
||||||
setPixelShader(neoWorldVC_PS);
|
|
||||||
|
setMaterial(m->color, m->surfaceProps, 0.5f);
|
||||||
|
|
||||||
|
SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
|
||||||
|
|
||||||
drawInst(header, inst);
|
drawInst(header, inst);
|
||||||
inst++;
|
inst++;
|
||||||
}
|
}
|
||||||
d3d::setTexture(1, nil);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CreateWorldPipe(void)
|
CreateWorldPipe(void)
|
||||||
{
|
{
|
||||||
if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
|
// if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
|
||||||
printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
|
// printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
|
||||||
else
|
// else
|
||||||
ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
|
// 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);
|
|
||||||
|
|
||||||
|
#include "shaders/leedsBuilding_VS.inc"
|
||||||
|
leedsBuilding_VS = rw::d3d::createVertexShader(leedsBuilding_VS_cso);
|
||||||
|
assert(leedsBuilding_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();
|
rw::d3d9::ObjPipeline *pipe = rw::d3d9::ObjPipeline::create();
|
||||||
pipe->instanceCB = rw::d3d9::defaultInstanceCB;
|
pipe->instanceCB = rw::d3d9::defaultInstanceCB;
|
||||||
|
@ -279,10 +273,10 @@ CreateWorldPipe(void)
|
||||||
void
|
void
|
||||||
DestroyWorldPipe(void)
|
DestroyWorldPipe(void)
|
||||||
{
|
{
|
||||||
rw::d3d::destroyVertexShader(neoWorld_VS);
|
rw::d3d::destroyVertexShader(leedsBuilding_VS);
|
||||||
neoWorld_VS = nil;
|
leedsBuilding_VS = nil;
|
||||||
rw::d3d::destroyPixelShader(neoWorldVC_PS);
|
rw::d3d::destroyPixelShader(scale_PS);
|
||||||
neoWorldVC_PS = nil;
|
scale_PS = nil;
|
||||||
|
|
||||||
|
|
||||||
((rw::d3d9::ObjPipeline*)worldPipe)->destroy();
|
((rw::d3d9::ObjPipeline*)worldPipe)->destroy();
|
||||||
|
|
|
@ -33,6 +33,10 @@ static int32 u_reflProps;
|
||||||
static int32 u_specDir;
|
static int32 u_specDir;
|
||||||
static int32 u_specColor;
|
static int32 u_specColor;
|
||||||
|
|
||||||
|
static int32 u_amb;
|
||||||
|
static int32 u_emiss;
|
||||||
|
static int32 u_colorscale;
|
||||||
|
|
||||||
#define U(i) currentShader->uniformLocations[i]
|
#define U(i) currentShader->uniformLocations[i]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -189,10 +193,10 @@ DestroyVehiclePipe(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Neo World pipe
|
* Leeds World pipe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rw::gl3::Shader *neoWorldShader;
|
rw::gl3::Shader *leedsWorldShader;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||||
|
@ -200,15 +204,9 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||||
using namespace rw;
|
using namespace rw;
|
||||||
using namespace rw::gl3;
|
using namespace rw::gl3;
|
||||||
|
|
||||||
if(!LightmapEnable){
|
|
||||||
gl3::defaultRenderCB(atomic, header);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Material *m;
|
Material *m;
|
||||||
|
|
||||||
setWorldMatrix(atomic->getFrame()->getLTM());
|
setWorldMatrix(atomic->getFrame()->getLTM());
|
||||||
lightingCB(atomic);
|
|
||||||
|
|
||||||
#ifdef RW_GL_USE_VAOS
|
#ifdef RW_GL_USE_VAOS
|
||||||
glBindVertexArray(header->vao);
|
glBindVertexArray(header->vao);
|
||||||
|
@ -221,39 +219,39 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||||
InstanceData *inst = header->inst;
|
InstanceData *inst = header->inst;
|
||||||
rw::int32 n = header->numMeshes;
|
rw::int32 n = header->numMeshes;
|
||||||
|
|
||||||
neoWorldShader->use();
|
leedsWorldShader->use();
|
||||||
|
|
||||||
float lightfactor[4];
|
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 colorscale[4];
|
||||||
|
colorscale[3] = 1.0f;
|
||||||
|
|
||||||
while(n--){
|
while(n--){
|
||||||
m = inst->material;
|
m = inst->material;
|
||||||
|
|
||||||
if(MatFX::getEffects(m) == MatFX::DUAL){
|
float cs = 1.0f;
|
||||||
MatFX *matfx = MatFX::get(m);
|
if(m->texture)
|
||||||
Texture *dualtex = matfx->getDualTexture();
|
cs = 255/128.0f;
|
||||||
if(dualtex == nil)
|
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
||||||
goto notex;
|
glUniform4fv(U(u_colorscale), 1, colorscale);
|
||||||
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);
|
|
||||||
|
|
||||||
setTexture(0, m->texture);
|
setTexture(0, m->texture);
|
||||||
|
|
||||||
|
setMaterial(m->color, m->surfaceProps);
|
||||||
|
|
||||||
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
|
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
|
||||||
|
|
||||||
drawInst(header, inst);
|
drawInst(header, inst);
|
||||||
inst++;
|
inst++;
|
||||||
}
|
}
|
||||||
setTexture(1, nil);
|
|
||||||
#ifndef RW_GL_USE_VAOS
|
#ifndef RW_GL_USE_VAOS
|
||||||
disableAttribPointers(header->attribDesc, header->numAttribs);
|
disableAttribPointers(header->attribDesc, header->numAttribs);
|
||||||
#endif
|
#endif
|
||||||
|
@ -265,18 +263,18 @@ CreateWorldPipe(void)
|
||||||
using namespace rw;
|
using namespace rw;
|
||||||
using namespace rw::gl3;
|
using namespace rw::gl3;
|
||||||
|
|
||||||
if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
|
// if(CFileMgr::LoadFile("neo/worldTweakingTable.dat", work_buff, sizeof(work_buff), "r") <= 0)
|
||||||
printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
|
// printf("Error: couldn't open 'neo/worldTweakingTable.dat'\n");
|
||||||
else
|
// else
|
||||||
ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
|
// ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
|
||||||
|
|
||||||
{
|
{
|
||||||
#include "shaders/neoWorldVC_fs_gl.inc"
|
#include "shaders/scale_fs_gl.inc"
|
||||||
#include "shaders/default_UV2_gl.inc"
|
#include "shaders/leedsBuilding_vs_gl.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, default_UV2_vert_src, nil };
|
const char *vs[] = { shaderDecl, header_vert_src, leedsBuilding_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, neoWorldVC_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, scale_frag_src, nil };
|
||||||
neoWorldShader = Shader::create(vs, fs);
|
leedsWorldShader = Shader::create(vs, fs);
|
||||||
assert(neoWorldShader);
|
assert(leedsWorldShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -290,8 +288,8 @@ CreateWorldPipe(void)
|
||||||
void
|
void
|
||||||
DestroyWorldPipe(void)
|
DestroyWorldPipe(void)
|
||||||
{
|
{
|
||||||
neoWorldShader->destroy();
|
leedsWorldShader->destroy();
|
||||||
neoWorldShader = nil;
|
leedsWorldShader = nil;
|
||||||
|
|
||||||
((rw::gl3::ObjPipeline*)worldPipe)->destroy();
|
((rw::gl3::ObjPipeline*)worldPipe)->destroy();
|
||||||
worldPipe = nil;
|
worldPipe = nil;
|
||||||
|
@ -609,6 +607,10 @@ CustomPipeRegisterGL(void)
|
||||||
u_reflProps = rw::gl3::registerUniform("u_reflProps");
|
u_reflProps = rw::gl3::registerUniform("u_reflProps");
|
||||||
u_specDir = rw::gl3::registerUniform("u_specDir");
|
u_specDir = rw::gl3::registerUniform("u_specDir");
|
||||||
u_specColor = rw::gl3::registerUniform("u_specColor");
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,14 @@ static RwIm2DVertex Vertex2[4];
|
||||||
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
|
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
|
||||||
|
|
||||||
#ifdef RW_D3D9
|
#ifdef RW_D3D9
|
||||||
void *colourfilterVC_PS;
|
void *colourfilterLCS_PS;
|
||||||
void *contrast_PS;
|
void *contrast_PS;
|
||||||
#endif
|
#endif
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
int32 u_blurcolor;
|
int32 u_blurcolor;
|
||||||
int32 u_contrastAdd;
|
int32 u_contrastAdd;
|
||||||
int32 u_contrastMult;
|
int32 u_contrastMult;
|
||||||
rw::gl3::Shader *colourFilterVC;
|
rw::gl3::Shader *colourFilterLCS;
|
||||||
rw::gl3::Shader *contrast;
|
rw::gl3::Shader *contrast;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -143,8 +143,8 @@ CPostFX::Open(RwCamera *cam)
|
||||||
|
|
||||||
|
|
||||||
#ifdef RW_D3D9
|
#ifdef RW_D3D9
|
||||||
#include "shaders/colourfilterVC_PS.inc"
|
#include "shaders/colourfilterLCS_PS.inc"
|
||||||
colourfilterVC_PS = rw::d3d::createPixelShader(colourfilterVC_PS_cso);
|
colourfilterLCS_PS = rw::d3d::createPixelShader(colourfilterLCS_PS_cso);
|
||||||
#include "shaders/contrastPS.inc"
|
#include "shaders/contrastPS.inc"
|
||||||
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
|
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
|
||||||
#endif
|
#endif
|
||||||
|
@ -153,11 +153,11 @@ CPostFX::Open(RwCamera *cam)
|
||||||
|
|
||||||
{
|
{
|
||||||
#include "shaders/im2d_gl.inc"
|
#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 *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, colourfilterVC_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, colourfilterLCS_frag_src, nil };
|
||||||
colourFilterVC = Shader::create(vs, fs);
|
colourFilterLCS = Shader::create(vs, fs);
|
||||||
assert(colourFilterVC);
|
assert(colourFilterLCS);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -184,9 +184,9 @@ CPostFX::Close(void)
|
||||||
pBackBuffer = nil;
|
pBackBuffer = nil;
|
||||||
}
|
}
|
||||||
#ifdef RW_D3D9
|
#ifdef RW_D3D9
|
||||||
if(colourfilterVC_PS){
|
if(colourfilterLCS_PS){
|
||||||
rw::d3d::destroyPixelShader(colourfilterVC_PS);
|
rw::d3d::destroyPixelShader(colourfilterLCS_PS);
|
||||||
colourfilterVC_PS = nil;
|
colourfilterLCS_PS = nil;
|
||||||
}
|
}
|
||||||
if(contrast_PS){
|
if(contrast_PS){
|
||||||
rw::d3d::destroyPixelShader(contrast_PS);
|
rw::d3d::destroyPixelShader(contrast_PS);
|
||||||
|
@ -194,9 +194,9 @@ CPostFX::Close(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
if(colourFilterVC){
|
if(colourFilterLCS){
|
||||||
colourFilterVC->destroy();
|
colourFilterLCS->destroy();
|
||||||
colourFilterVC = nil;
|
colourFilterLCS = nil;
|
||||||
}
|
}
|
||||||
if(contrast){
|
if(contrast){
|
||||||
contrast->destroy();
|
contrast->destroy();
|
||||||
|
@ -294,12 +294,12 @@ CPostFX::RenderOverlayShader(RwCamera *cam, int32 r, int32 g, int32 b, int32 a)
|
||||||
blurcolors[3] = 30/255.0f;
|
blurcolors[3] = 30/255.0f;
|
||||||
#ifdef RW_D3D9
|
#ifdef RW_D3D9
|
||||||
rw::d3d::d3ddevice->SetPixelShaderConstantF(10, blurcolors, 1);
|
rw::d3d::d3ddevice->SetPixelShaderConstantF(10, blurcolors, 1);
|
||||||
rw::d3d::im2dOverridePS = colourfilterVC_PS;
|
rw::d3d::im2dOverridePS = colourfilterLCS_PS;
|
||||||
#endif
|
#endif
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
rw::gl3::im2dOverrideShader = colourFilterVC;
|
rw::gl3::im2dOverrideShader = colourFilterLCS;
|
||||||
colourFilterVC->use();
|
colourFilterLCS->use();
|
||||||
glUniform4fv(colourFilterVC->uniformLocations[u_blurcolor], 1, blurcolors);
|
glUniform4fv(colourFilterLCS->uniformLocations[u_blurcolor], 1, blurcolors);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
|
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, Vertex, 4, Index, 6);
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \
|
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 \
|
neoRim_gl.inc neoRimSkin_gl.inc \
|
||||||
neoWorldVC_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \
|
neoWorldVC_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \
|
||||||
neoVehicle_vs_gl.inc neoVehicle_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 scale_fs_gl.inc
|
||||||
|
|
||||||
im2d_gl.inc: im2d.vert
|
im2d_gl.inc: im2d.vert
|
||||||
(echo 'const char *im2d_vert_src =';\
|
(echo 'const char *im2d_vert_src =';\
|
||||||
sed 's/..*/"&\\n"/' im2d.vert;\
|
sed 's/..*/"&\\n"/' im2d.vert;\
|
||||||
echo ';') >im2d_gl.inc
|
echo ';') >im2d_gl.inc
|
||||||
|
|
||||||
colourfilterVC_fs_gl.inc: colourfilterVC.frag
|
colourfilterLCS_fs_gl.inc: colourfilterLCS.frag
|
||||||
(echo 'const char *colourfilterVC_frag_src =';\
|
(echo 'const char *colourfilterLCS_frag_src =';\
|
||||||
sed 's/..*/"&\\n"/' colourfilterVC.frag;\
|
sed 's/..*/"&\\n"/' colourfilterLCS.frag;\
|
||||||
echo ';') >colourfilterVC_fs_gl.inc
|
echo ';') >colourfilterLCS_fs_gl.inc
|
||||||
simple_fs_gl.inc: simple.frag
|
simple_fs_gl.inc: simple.frag
|
||||||
(echo 'const char *simple_frag_src =';\
|
(echo 'const char *simple_frag_src =';\
|
||||||
sed 's/..*/"&\\n"/' simple.frag;\
|
sed 's/..*/"&\\n"/' simple.frag;\
|
||||||
|
@ -76,3 +77,13 @@ screenDroplet_fs_gl.inc: screenDroplet.frag
|
||||||
(echo 'const char *screenDroplet_frag_src =';\
|
(echo 'const char *screenDroplet_frag_src =';\
|
||||||
sed 's/..*/"&\\n"/' screenDroplet.frag;\
|
sed 's/..*/"&\\n"/' screenDroplet.frag;\
|
||||||
echo ';') >screenDroplet_fs_gl.inc
|
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
|
||||||
|
|
||||||
|
scale_fs_gl.inc: scale.frag
|
||||||
|
(echo 'const char *scale_frag_src =';\
|
||||||
|
sed 's/..*/"&\\n"/' scale.frag;\
|
||||||
|
echo ';') >scale_fs_gl.inc
|
||||||
|
|
20
src/extras/shaders/colourfilterLCS.frag
Normal file
20
src/extras/shaders/colourfilterLCS.frag
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
|
BIN
src/extras/shaders/colourfilterLCS_PS.cso
Normal file
BIN
src/extras/shaders/colourfilterLCS_PS.cso
Normal file
Binary file not shown.
13
src/extras/shaders/colourfilterLCS_PS.hlsl
Normal file
13
src/extras/shaders/colourfilterLCS_PS.hlsl
Normal file
|
@ -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;
|
||||||
|
}
|
27
src/extras/shaders/colourfilterLCS_PS.inc
Normal file
27
src/extras/shaders/colourfilterLCS_PS.inc
Normal file
|
@ -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
|
||||||
|
};
|
22
src/extras/shaders/colourfilterLCS_fs_gl.inc
Normal file
22
src/extras/shaders/colourfilterLCS_fs_gl.inc
Normal file
|
@ -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"
|
||||||
|
|
||||||
|
;
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
Binary file not shown.
|
@ -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;
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
};
|
|
|
@ -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"
|
|
||||||
|
|
||||||
;
|
|
26
src/extras/shaders/leedsBuilding.vert
Normal file
26
src/extras/shaders/leedsBuilding.vert
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
uniform vec4 u_amb;
|
||||||
|
uniform vec4 u_emiss;
|
||||||
|
|
||||||
|
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;
|
||||||
|
v_color = clamp(v_color, 0.0, 1.0);
|
||||||
|
v_color.a *= u_matColor.a;
|
||||||
|
|
||||||
|
v_fog = DoFog(gl_Position.w);
|
||||||
|
}
|
BIN
src/extras/shaders/leedsBuilding_VS.cso
Normal file
BIN
src/extras/shaders/leedsBuilding_VS.cso
Normal file
Binary file not shown.
44
src/extras/shaders/leedsBuilding_VS.hlsl
Normal file
44
src/extras/shaders/leedsBuilding_VS.hlsl
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
#include "standardConstants.h"
|
||||||
|
|
||||||
|
float4 emissive : register(c41);
|
||||||
|
float4 ambient : register(c42);
|
||||||
|
|
||||||
|
struct VS_in
|
||||||
|
{
|
||||||
|
float4 Position : POSITION;
|
||||||
|
float3 Normal : NORMAL;
|
||||||
|
float2 TexCoord : TEXCOORD0;
|
||||||
|
float2 TexCoord1 : TEXCOORD1;
|
||||||
|
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 Vertex = mul(worldMat, input.Position).xyz;
|
||||||
|
float3 Normal = mul(normalMat, input.Normal);
|
||||||
|
|
||||||
|
output.TexCoord0.xy = input.TexCoord;
|
||||||
|
output.TexCoord1.xy = input.TexCoord1;
|
||||||
|
|
||||||
|
output.Color = input.Prelight;
|
||||||
|
output.Color.rgb *= ambient.rgb;
|
||||||
|
output.Color.rgb += emissive.rgb;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
55
src/extras/shaders/leedsBuilding_VS.inc
Normal file
55
src/extras/shaders/leedsBuilding_VS.inc
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
static unsigned char leedsBuilding_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, 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,
|
||||||
|
0x05, 0x00, 0x01, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
|
||||||
|
0x0a, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x01, 0x00, 0x00, 0x02,
|
||||||
|
0x00, 0x00, 0x07, 0x80, 0x2a, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
|
||||||
|
0x00, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x90, 0x00, 0x00, 0xe4, 0x80,
|
||||||
|
0x29, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80,
|
||||||
|
0x03, 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,
|
||||||
|
0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90,
|
||||||
|
0xff, 0xff, 0x00, 0x00
|
||||||
|
};
|
28
src/extras/shaders/leedsBuilding_vs_gl.inc
Normal file
28
src/extras/shaders/leedsBuilding_vs_gl.inc
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
const char *leedsBuilding_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 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;\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"
|
||||||
|
;
|
18
src/extras/shaders/scale.frag
Normal file
18
src/extras/shaders/scale.frag
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
|
BIN
src/extras/shaders/scale_PS.cso
Normal file
BIN
src/extras/shaders/scale_PS.cso
Normal file
Binary file not shown.
19
src/extras/shaders/scale_PS.hlsl
Normal file
19
src/extras/shaders/scale_PS.hlsl
Normal file
|
@ -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;
|
||||||
|
}
|
33
src/extras/shaders/scale_PS.inc
Normal file
33
src/extras/shaders/scale_PS.inc
Normal file
|
@ -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
|
||||||
|
};
|
20
src/extras/shaders/scale_fs_gl.inc
Normal file
20
src/extras/shaders/scale_fs_gl.inc
Normal file
|
@ -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"
|
||||||
|
|
||||||
|
;
|
|
@ -136,6 +136,61 @@ float CTimeCycle::m_fShadowSideY[16];
|
||||||
float CTimeCycle::m_fShadowDisplacementX[16];
|
float CTimeCycle::m_fShadowDisplacementX[16];
|
||||||
float CTimeCycle::m_fShadowDisplacementY[16];
|
float CTimeCycle::m_fShadowDisplacementY[16];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static float tmp_nAmbientRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientRed_Obj[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientGreen_Obj[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientBlue_Obj[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientRed_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientGreen_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientBlue_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientRed_Obj_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientGreen_Obj_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nAmbientBlue_Obj_Bl[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nDirectionalRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyTopRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoreRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fSunSize[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fSpriteSize[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fSpriteBrightness[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nShadowStrength[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nPoleShadowStrength[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fFogStart[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fFarClip[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fLightsOnGroundBrightness[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fBlurRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fBlurGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fBlurBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fWaterRed[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fWaterGreen[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fWaterBlue[NUMHOURS][NUMWEATHERS];
|
||||||
|
static float tmp_fWaterAlpha[NUMHOURS][NUMWEATHERS];
|
||||||
|
|
||||||
void
|
void
|
||||||
CTimeCycle::Initialise(void)
|
CTimeCycle::Initialise(void)
|
||||||
{
|
{
|
||||||
|
@ -172,8 +227,9 @@ CTimeCycle::Initialise(void)
|
||||||
for(w = 0; w < NUMWEATHERS; w++)
|
for(w = 0; w < NUMWEATHERS; w++)
|
||||||
for(h = 0; h < NUMHOURS; h++){
|
for(h = 0; h < NUMHOURS; h++){
|
||||||
li = 0;
|
li = 0;
|
||||||
while(work_buff[bi] == '/'){
|
while(work_buff[bi] == '/' || work_buff[bi] == '\n' ||
|
||||||
while(work_buff[bi] != '\n')
|
work_buff[bi] == '\0' || work_buff[bi] == '\r'){
|
||||||
|
while(work_buff[bi] != '\n' && work_buff[bi] != '\0' && work_buff[bi] != '\r')
|
||||||
bi++;
|
bi++;
|
||||||
bi++;
|
bi++;
|
||||||
}
|
}
|
||||||
|
@ -208,65 +264,180 @@ CTimeCycle::Initialise(void)
|
||||||
&blurR, &blurG, &blurB,
|
&blurR, &blurG, &blurB,
|
||||||
&waterR, &waterG, &waterB, &waterA);
|
&waterR, &waterG, &waterB, &waterA);
|
||||||
|
|
||||||
m_nAmbientRed[h][w] = ambR;
|
tmp_nAmbientRed[h][w] = ambR;
|
||||||
m_nAmbientGreen[h][w] = ambG;
|
tmp_nAmbientGreen[h][w] = ambG;
|
||||||
m_nAmbientBlue[h][w] = ambB;
|
tmp_nAmbientBlue[h][w] = ambB;
|
||||||
m_nAmbientRed_Obj[h][w] = ambobjR;
|
tmp_nAmbientRed_Obj[h][w] = ambobjR;
|
||||||
m_nAmbientGreen_Obj[h][w] = ambobjG;
|
tmp_nAmbientGreen_Obj[h][w] = ambobjG;
|
||||||
m_nAmbientBlue_Obj[h][w] = ambobjB;
|
tmp_nAmbientBlue_Obj[h][w] = ambobjB;
|
||||||
m_nAmbientRed_Bl[h][w] = ambblR;
|
tmp_nAmbientRed_Bl[h][w] = ambblR;
|
||||||
m_nAmbientGreen_Bl[h][w] = ambblG;
|
tmp_nAmbientGreen_Bl[h][w] = ambblG;
|
||||||
m_nAmbientBlue_Bl[h][w] = ambblB;
|
tmp_nAmbientBlue_Bl[h][w] = ambblB;
|
||||||
m_nAmbientRed_Obj_Bl[h][w] = ambobjblR;
|
tmp_nAmbientRed_Obj_Bl[h][w] = ambobjblR;
|
||||||
m_nAmbientGreen_Obj_Bl[h][w] = ambobjblG;
|
tmp_nAmbientGreen_Obj_Bl[h][w] = ambobjblG;
|
||||||
m_nAmbientBlue_Obj_Bl[h][w] = ambobjblB;
|
tmp_nAmbientBlue_Obj_Bl[h][w] = ambobjblB;
|
||||||
m_nDirectionalRed[h][w] = dirR;
|
tmp_nDirectionalRed[h][w] = dirR;
|
||||||
m_nDirectionalGreen[h][w] = dirG;
|
tmp_nDirectionalGreen[h][w] = dirG;
|
||||||
m_nDirectionalBlue[h][w] = dirB;
|
tmp_nDirectionalBlue[h][w] = dirB;
|
||||||
m_nSkyTopRed[h][w] = skyTopR;
|
tmp_nSkyTopRed[h][w] = skyTopR;
|
||||||
m_nSkyTopGreen[h][w] = skyTopG;
|
tmp_nSkyTopGreen[h][w] = skyTopG;
|
||||||
m_nSkyTopBlue[h][w] = skyTopB;
|
tmp_nSkyTopBlue[h][w] = skyTopB;
|
||||||
m_nSkyBottomRed[h][w] = skyBotR;
|
tmp_nSkyBottomRed[h][w] = skyBotR;
|
||||||
m_nSkyBottomGreen[h][w] = skyBotG;
|
tmp_nSkyBottomGreen[h][w] = skyBotG;
|
||||||
m_nSkyBottomBlue[h][w] = skyBotB;
|
tmp_nSkyBottomBlue[h][w] = skyBotB;
|
||||||
m_nSunCoreRed[h][w] = sunCoreR;
|
tmp_nSunCoreRed[h][w] = sunCoreR;
|
||||||
m_nSunCoreGreen[h][w] = sunCoreG;
|
tmp_nSunCoreGreen[h][w] = sunCoreG;
|
||||||
m_nSunCoreBlue[h][w] = sunCoreB;
|
tmp_nSunCoreBlue[h][w] = sunCoreB;
|
||||||
m_nSunCoronaRed[h][w] = sunCoronaR;
|
tmp_nSunCoronaRed[h][w] = sunCoronaR;
|
||||||
m_nSunCoronaGreen[h][w] = sunCoronaG;
|
tmp_nSunCoronaGreen[h][w] = sunCoronaG;
|
||||||
m_nSunCoronaBlue[h][w] = sunCoronaB;
|
tmp_nSunCoronaBlue[h][w] = sunCoronaB;
|
||||||
m_fSunSize[h][w] = sunSz * 10.0f;
|
if(sunSz == -1)
|
||||||
m_fSpriteSize[h][w] = sprSz * 10.0f;
|
tmp_fSunSize[h][w] = -1;
|
||||||
m_fSpriteBrightness[h][w] = sprBght * 10.0f;
|
else
|
||||||
m_nShadowStrength[h][w] = shad;
|
tmp_fSunSize[h][w] = sunSz * 10.0f;
|
||||||
m_nLightShadowStrength[h][w] = lightShad;
|
if(sprSz == -1)
|
||||||
m_nPoleShadowStrength[h][w] = poleShad;
|
tmp_fSpriteSize[h][w] = -1;
|
||||||
m_fFarClip[h][w] = farClp;
|
else
|
||||||
m_fFogStart[h][w] = fogSt;
|
tmp_fSpriteSize[h][w] = sprSz * 10.0f;
|
||||||
m_fLightsOnGroundBrightness[h][w] = lightGnd * 10.0f;
|
if(sprBght == -1)
|
||||||
m_nLowCloudsRed[h][w] = cloudR;
|
tmp_fSpriteBrightness[h][w] = -1;
|
||||||
m_nLowCloudsGreen[h][w] = cloudG;
|
else
|
||||||
m_nLowCloudsBlue[h][w] = cloudB;
|
tmp_fSpriteBrightness[h][w] = sprBght * 10.0f;
|
||||||
m_nFluffyCloudsTopRed[h][w] = fluffyTopR;
|
tmp_nShadowStrength[h][w] = shad;
|
||||||
m_nFluffyCloudsTopGreen[h][w] = fluffyTopG;
|
tmp_nLightShadowStrength[h][w] = lightShad;
|
||||||
m_nFluffyCloudsTopBlue[h][w] = fluffyTopB;
|
tmp_nPoleShadowStrength[h][w] = poleShad;
|
||||||
m_nFluffyCloudsBottomRed[h][w] = fluffyBotR;
|
tmp_fFarClip[h][w] = farClp;
|
||||||
m_nFluffyCloudsBottomGreen[h][w] = fluffyBotG;
|
tmp_fFogStart[h][w] = fogSt;
|
||||||
m_nFluffyCloudsBottomBlue[h][w] = fluffyBotB;
|
if(lightGnd == -1)
|
||||||
m_fBlurRed[h][w] = blurR;
|
tmp_fLightsOnGroundBrightness[h][w] = -1;
|
||||||
m_fBlurGreen[h][w] = blurG;
|
else
|
||||||
m_fBlurBlue[h][w] = blurB;
|
tmp_fLightsOnGroundBrightness[h][w] = lightGnd * 10.0f;
|
||||||
m_fWaterRed[h][w] = waterR;
|
tmp_nLowCloudsRed[h][w] = cloudR;
|
||||||
m_fWaterGreen[h][w] = waterG;
|
tmp_nLowCloudsGreen[h][w] = cloudG;
|
||||||
m_fWaterBlue[h][w] = waterB;
|
tmp_nLowCloudsBlue[h][w] = cloudB;
|
||||||
m_fWaterAlpha[h][w] = waterA;
|
tmp_nFluffyCloudsTopRed[h][w] = fluffyTopR;
|
||||||
|
tmp_nFluffyCloudsTopGreen[h][w] = fluffyTopG;
|
||||||
|
tmp_nFluffyCloudsTopBlue[h][w] = fluffyTopB;
|
||||||
|
tmp_nFluffyCloudsBottomRed[h][w] = fluffyBotR;
|
||||||
|
tmp_nFluffyCloudsBottomGreen[h][w] = fluffyBotG;
|
||||||
|
tmp_nFluffyCloudsBottomBlue[h][w] = fluffyBotB;
|
||||||
|
tmp_fBlurRed[h][w] = blurR;
|
||||||
|
tmp_fBlurGreen[h][w] = blurG;
|
||||||
|
tmp_fBlurBlue[h][w] = blurB;
|
||||||
|
tmp_fWaterRed[h][w] = waterR;
|
||||||
|
tmp_fWaterGreen[h][w] = waterG;
|
||||||
|
tmp_fWaterBlue[h][w] = waterB;
|
||||||
|
tmp_fWaterAlpha[h][w] = waterA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateArrays();
|
||||||
|
|
||||||
m_FogReduction = 0;
|
m_FogReduction = 0;
|
||||||
|
|
||||||
debug("CTimeCycle ready\n");
|
debug("CTimeCycle ready\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T> void
|
||||||
|
FillGaps(T (*out)[NUMWEATHERS], float (*in)[NUMWEATHERS])
|
||||||
|
{
|
||||||
|
int w;
|
||||||
|
for(w = 0; w < NUMWEATHERS; w++){
|
||||||
|
for(int h = 0; h < NUMHOURS; h++)
|
||||||
|
out[h][w] = in[h][w];
|
||||||
|
|
||||||
|
#define NEXT(h) (((h)+1)%NUMHOURS)
|
||||||
|
#define PREV(h) (((h)+NUMHOURS-1)%NUMHOURS)
|
||||||
|
int hend, h1, h2;
|
||||||
|
for(hend = 0; hend < NUMHOURS; hend++)
|
||||||
|
if(in[hend][w] != -1.0f)
|
||||||
|
goto foundstart;
|
||||||
|
return; // this should never happen
|
||||||
|
foundstart:
|
||||||
|
// Found the start of a block of filled in entries
|
||||||
|
for(h1 = NEXT(hend); h1 != hend; h1 = h2){
|
||||||
|
// Skip filled in entries
|
||||||
|
for(; h1 != hend; h1 = NEXT(h1))
|
||||||
|
if(in[h1][w] == -1.0f)
|
||||||
|
goto foundfirst;
|
||||||
|
break; // all filled in already
|
||||||
|
foundfirst:
|
||||||
|
// h1 is now the first -1 after n filled in values
|
||||||
|
for(h2 = NEXT(h1); ; h2 = NEXT(h2))
|
||||||
|
if(in[h2][w] != -1.0f)
|
||||||
|
goto foundlast;
|
||||||
|
break;
|
||||||
|
foundlast:
|
||||||
|
// h2 is now the first entry after a row of -1s
|
||||||
|
h1 = PREV(h1); // make h1 the first before a row of -1s
|
||||||
|
int n = (h2-h1 + NUMHOURS) % NUMHOURS;
|
||||||
|
if(n == 0) n = NUMHOURS; // can't happen
|
||||||
|
float step = (in[h2][w] - in[h1][w])/n;
|
||||||
|
|
||||||
|
for(int i = 1; i < n; i++){
|
||||||
|
float f = (float)i/n;
|
||||||
|
out[(h1+i)%NUMHOURS][w] = in[h2][w]*f + in[h1][w]*(1.0f-f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CTimeCycle::UpdateArrays(void)
|
||||||
|
{
|
||||||
|
FillGaps(m_nAmbientRed, tmp_nAmbientRed);
|
||||||
|
FillGaps(m_nAmbientGreen, tmp_nAmbientGreen);
|
||||||
|
FillGaps(m_nAmbientBlue, tmp_nAmbientBlue);
|
||||||
|
FillGaps(m_nAmbientRed_Obj, tmp_nAmbientRed_Obj);
|
||||||
|
FillGaps(m_nAmbientGreen_Obj, tmp_nAmbientGreen_Obj);
|
||||||
|
FillGaps(m_nAmbientBlue_Obj, tmp_nAmbientBlue_Obj);
|
||||||
|
FillGaps(m_nAmbientRed_Bl, tmp_nAmbientRed_Bl);
|
||||||
|
FillGaps(m_nAmbientGreen_Bl, tmp_nAmbientGreen_Bl);
|
||||||
|
FillGaps(m_nAmbientBlue_Bl, tmp_nAmbientBlue_Bl);
|
||||||
|
FillGaps(m_nAmbientRed_Obj_Bl, tmp_nAmbientRed_Obj_Bl);
|
||||||
|
FillGaps(m_nAmbientGreen_Obj_Bl, tmp_nAmbientGreen_Obj_Bl);
|
||||||
|
FillGaps(m_nAmbientBlue_Obj_Bl, tmp_nAmbientBlue_Obj_Bl);
|
||||||
|
FillGaps(m_nDirectionalRed, tmp_nDirectionalRed);
|
||||||
|
FillGaps(m_nDirectionalGreen, tmp_nDirectionalGreen);
|
||||||
|
FillGaps(m_nDirectionalBlue, tmp_nDirectionalBlue);
|
||||||
|
FillGaps(m_nSkyTopRed, tmp_nSkyTopRed);
|
||||||
|
FillGaps(m_nSkyTopGreen, tmp_nSkyTopGreen);
|
||||||
|
FillGaps(m_nSkyTopBlue, tmp_nSkyTopBlue);
|
||||||
|
FillGaps(m_nSkyBottomRed, tmp_nSkyBottomRed);
|
||||||
|
FillGaps(m_nSkyBottomGreen, tmp_nSkyBottomGreen);
|
||||||
|
FillGaps(m_nSkyBottomBlue, tmp_nSkyBottomBlue);
|
||||||
|
FillGaps(m_nSunCoreRed, tmp_nSunCoreRed);
|
||||||
|
FillGaps(m_nSunCoreGreen, tmp_nSunCoreGreen);
|
||||||
|
FillGaps(m_nSunCoreBlue, tmp_nSunCoreBlue);
|
||||||
|
FillGaps(m_nSunCoronaRed, tmp_nSunCoronaRed);
|
||||||
|
FillGaps(m_nSunCoronaGreen, tmp_nSunCoronaGreen);
|
||||||
|
FillGaps(m_nSunCoronaBlue, tmp_nSunCoronaBlue);
|
||||||
|
FillGaps(m_fSunSize, tmp_fSunSize);
|
||||||
|
FillGaps(m_fSpriteSize, tmp_fSpriteSize);
|
||||||
|
FillGaps(m_fSpriteBrightness, tmp_fSpriteBrightness);
|
||||||
|
FillGaps(m_nShadowStrength, tmp_nShadowStrength);
|
||||||
|
FillGaps(m_nLightShadowStrength, tmp_nLightShadowStrength);
|
||||||
|
FillGaps(m_nPoleShadowStrength, tmp_nPoleShadowStrength);
|
||||||
|
FillGaps(m_fFogStart, tmp_fFogStart);
|
||||||
|
FillGaps(m_fFarClip, tmp_fFarClip);
|
||||||
|
FillGaps(m_fLightsOnGroundBrightness, tmp_fLightsOnGroundBrightness);
|
||||||
|
FillGaps(m_nLowCloudsRed, tmp_nLowCloudsRed);
|
||||||
|
FillGaps(m_nLowCloudsGreen, tmp_nLowCloudsGreen);
|
||||||
|
FillGaps(m_nLowCloudsBlue, tmp_nLowCloudsBlue);
|
||||||
|
FillGaps(m_nFluffyCloudsTopRed, tmp_nFluffyCloudsTopRed);
|
||||||
|
FillGaps(m_nFluffyCloudsTopGreen, tmp_nFluffyCloudsTopGreen);
|
||||||
|
FillGaps(m_nFluffyCloudsTopBlue, tmp_nFluffyCloudsTopBlue);
|
||||||
|
FillGaps(m_nFluffyCloudsBottomRed, tmp_nFluffyCloudsBottomRed);
|
||||||
|
FillGaps(m_nFluffyCloudsBottomGreen, tmp_nFluffyCloudsBottomGreen);
|
||||||
|
FillGaps(m_nFluffyCloudsBottomBlue, tmp_nFluffyCloudsBottomBlue);
|
||||||
|
FillGaps(m_fBlurRed, tmp_fBlurRed);
|
||||||
|
FillGaps(m_fBlurGreen, tmp_fBlurGreen);
|
||||||
|
FillGaps(m_fBlurBlue, tmp_fBlurBlue);
|
||||||
|
FillGaps(m_fWaterRed, tmp_fWaterRed);
|
||||||
|
FillGaps(m_fWaterGreen, tmp_fWaterGreen);
|
||||||
|
FillGaps(m_fWaterBlue, tmp_fWaterBlue);
|
||||||
|
FillGaps(m_fWaterAlpha, tmp_fWaterAlpha);
|
||||||
|
}
|
||||||
|
|
||||||
static float interp_c0, interp_c1, interp_c2, interp_c3;
|
static float interp_c0, interp_c1, interp_c2, interp_c3;
|
||||||
|
|
||||||
float CTimeCycle::Interpolate(int8 *a, int8 *b)
|
float CTimeCycle::Interpolate(int8 *a, int8 *b)
|
||||||
|
|
|
@ -185,6 +185,7 @@ public:
|
||||||
static int32 GetWaterAlpha(void) { return m_fCurrentWaterAlpha; }
|
static int32 GetWaterAlpha(void) { return m_fCurrentWaterAlpha; }
|
||||||
|
|
||||||
static void Initialise(void);
|
static void Initialise(void);
|
||||||
|
static void UpdateArrays(void);
|
||||||
static void Update(void);
|
static void Update(void);
|
||||||
static float Interpolate(int8 *a, int8 *b);
|
static float Interpolate(int8 *a, int8 *b);
|
||||||
static float Interpolate(uint8 *a, uint8 *b);
|
static float Interpolate(uint8 *a, uint8 *b);
|
||||||
|
|
|
@ -26,12 +26,7 @@ RwRGBAReal DirectionalLightColourForFrame;
|
||||||
RwRGBAReal AmbientLightColour;
|
RwRGBAReal AmbientLightColour;
|
||||||
RwRGBAReal DirectionalLightColour;
|
RwRGBAReal DirectionalLightColour;
|
||||||
|
|
||||||
#ifdef EXTENDED_COLOURFILTER
|
#define USEBLURCOLORS true // actually CMBlur::BlurOn, but that's always supposed to be on
|
||||||
#include "postfx.h"
|
|
||||||
#define USEBLURCOLORS CPostFX::UseBlurColours()
|
|
||||||
#else
|
|
||||||
#define USEBLURCOLORS CMBlur::BlurOn
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SetLightsWithTimeOfDayColour(RpWorld *)
|
SetLightsWithTimeOfDayColour(RpWorld *)
|
||||||
|
|
Loading…
Reference in a new issue