From 425f360363419bef0c7bed0df5d79798408e6cf0 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 6 Feb 2021 16:49:52 +0100 Subject: [PATCH] reorganize shaders; use modulate flag; update librw --- src/extras/custompipes_d3d9.cpp | 31 +++---- src/extras/custompipes_gl.cpp | 34 ++++---- src/extras/postfx.cpp | 12 +-- src/extras/screendroplets.cpp | 6 +- src/extras/shaders/Makefile | 78 ------------------ src/extras/shaders/make_glsl.sh | 9 ++ .../shaders/{make.cmd => make_hlsl.cmd} | 4 +- src/extras/shaders/makeinc_glsl.sh | 6 ++ .../shaders/{makeinc.sh => makeinc_hlsl.sh} | 1 + .../shaders/{ => obj}/colourfilterVC_PS.cso | Bin .../shaders/{ => obj}/colourfilterVC_PS.inc | 0 .../colourfilterVC_frag.inc} | 0 src/extras/shaders/{ => obj}/contrastPS.cso | Bin src/extras/shaders/{ => obj}/contrastPS.inc | 0 .../contrast_frag.inc} | 0 .../shaders/{ => obj}/default_UV2_VS.cso | Bin .../shaders/{ => obj}/default_UV2_VS.inc | 0 .../default_UV2_vert.inc} | 0 .../im2d_UV2_vert.inc} | 0 .../{im2d_gl.inc => obj/im2d_vert.inc} | 0 src/extras/shaders/{ => obj}/neoGloss_PS.cso | Bin src/extras/shaders/{ => obj}/neoGloss_PS.inc | 0 src/extras/shaders/{ => obj}/neoGloss_VS.cso | Bin src/extras/shaders/{ => obj}/neoGloss_VS.inc | 0 .../neoGloss_frag.inc} | 0 .../neoGloss_vert.inc} | 0 .../shaders/{ => obj}/neoRimSkin_VS.cso | Bin .../shaders/{ => obj}/neoRimSkin_VS.inc | 0 .../neoRimSkin_vert.inc} | 0 src/extras/shaders/{ => obj}/neoRim_VS.cso | Bin src/extras/shaders/{ => obj}/neoRim_VS.inc | 0 .../{neoRim_gl.inc => obj/neoRim_vert.inc} | 0 .../shaders/{ => obj}/neoVehicle_PS.cso | Bin .../shaders/{ => obj}/neoVehicle_PS.inc | 0 .../shaders/{ => obj}/neoVehicle_VS.cso | Bin .../shaders/{ => obj}/neoVehicle_VS.inc | 0 .../neoVehicle_frag.inc} | 0 .../neoVehicle_vert.inc} | 0 .../shaders/{ => obj}/neoWorldVC_PS.cso | Bin .../shaders/{ => obj}/neoWorldVC_PS.inc | 0 .../neoWorldVC_frag.inc} | 0 .../shaders/{ => obj}/screenDroplet_PS.cso | Bin .../shaders/{ => obj}/screenDroplet_PS.inc | 0 .../screenDroplet_frag.inc} | 0 .../{simple_fs_gl.inc => obj/simple_frag.inc} | 0 vendor/librw | 2 +- 46 files changed, 64 insertions(+), 119 deletions(-) delete mode 100644 src/extras/shaders/Makefile create mode 100644 src/extras/shaders/make_glsl.sh rename src/extras/shaders/{make.cmd => make_hlsl.cmd} (58%) create mode 100644 src/extras/shaders/makeinc_glsl.sh rename src/extras/shaders/{makeinc.sh => makeinc_hlsl.sh} (93%) rename src/extras/shaders/{ => obj}/colourfilterVC_PS.cso (100%) rename src/extras/shaders/{ => obj}/colourfilterVC_PS.inc (100%) rename src/extras/shaders/{colourfilterVC_fs_gl.inc => obj/colourfilterVC_frag.inc} (100%) rename src/extras/shaders/{ => obj}/contrastPS.cso (100%) rename src/extras/shaders/{ => obj}/contrastPS.inc (100%) rename src/extras/shaders/{contrast_fs_gl.inc => obj/contrast_frag.inc} (100%) rename src/extras/shaders/{ => obj}/default_UV2_VS.cso (100%) rename src/extras/shaders/{ => obj}/default_UV2_VS.inc (100%) rename src/extras/shaders/{default_UV2_gl.inc => obj/default_UV2_vert.inc} (100%) rename src/extras/shaders/{im2d_UV2_gl.inc => obj/im2d_UV2_vert.inc} (100%) rename src/extras/shaders/{im2d_gl.inc => obj/im2d_vert.inc} (100%) rename src/extras/shaders/{ => obj}/neoGloss_PS.cso (100%) rename src/extras/shaders/{ => obj}/neoGloss_PS.inc (100%) rename src/extras/shaders/{ => obj}/neoGloss_VS.cso (100%) rename src/extras/shaders/{ => obj}/neoGloss_VS.inc (100%) rename src/extras/shaders/{neoGloss_fs_gl.inc => obj/neoGloss_frag.inc} (100%) rename src/extras/shaders/{neoGloss_vs_gl.inc => obj/neoGloss_vert.inc} (100%) rename src/extras/shaders/{ => obj}/neoRimSkin_VS.cso (100%) rename src/extras/shaders/{ => obj}/neoRimSkin_VS.inc (100%) rename src/extras/shaders/{neoRimSkin_gl.inc => obj/neoRimSkin_vert.inc} (100%) rename src/extras/shaders/{ => obj}/neoRim_VS.cso (100%) rename src/extras/shaders/{ => obj}/neoRim_VS.inc (100%) rename src/extras/shaders/{neoRim_gl.inc => obj/neoRim_vert.inc} (100%) rename src/extras/shaders/{ => obj}/neoVehicle_PS.cso (100%) rename src/extras/shaders/{ => obj}/neoVehicle_PS.inc (100%) rename src/extras/shaders/{ => obj}/neoVehicle_VS.cso (100%) rename src/extras/shaders/{ => obj}/neoVehicle_VS.inc (100%) rename src/extras/shaders/{neoVehicle_fs_gl.inc => obj/neoVehicle_frag.inc} (100%) rename src/extras/shaders/{neoVehicle_vs_gl.inc => obj/neoVehicle_vert.inc} (100%) rename src/extras/shaders/{ => obj}/neoWorldVC_PS.cso (100%) rename src/extras/shaders/{ => obj}/neoWorldVC_PS.inc (100%) rename src/extras/shaders/{neoWorldVC_fs_gl.inc => obj/neoWorldVC_frag.inc} (100%) rename src/extras/shaders/{ => obj}/screenDroplet_PS.cso (100%) rename src/extras/shaders/{ => obj}/screenDroplet_PS.inc (100%) rename src/extras/shaders/{screenDroplet_fs_gl.inc => obj/screenDroplet_frag.inc} (100%) rename src/extras/shaders/{simple_fs_gl.inc => obj/simple_frag.inc} (100%) diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp index d7634e99..3ad824e3 100644 --- a/src/extras/custompipes_d3d9.cpp +++ b/src/extras/custompipes_d3d9.cpp @@ -89,6 +89,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices(header->indexBuffer); setVertexDeclaration(header->vertexDeclaration); @@ -120,7 +121,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) reflProps[3] = m->surfaceProps.specular == 0.0f ? 0.0f : VehicleSpecularity; d3ddevice->SetVertexShaderConstantF(VSLOC_reflProps, reflProps, 1); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture) d3d::setTexture(0, m->texture); @@ -150,11 +151,11 @@ CreateVehiclePipe(void) fp = ReadTweakValueTable(fp, SpecColor); } -#include "shaders/neoVehicle_VS.inc" +#include "shaders/obj/neoVehicle_VS.inc" neoVehicle_VS = rw::d3d::createVertexShader(neoVehicle_VS_cso); assert(neoVehicle_VS); -#include "shaders/neoVehicle_PS.inc" +#include "shaders/obj/neoVehicle_PS.inc" neoVehicle_PS = rw::d3d::createPixelShader(neoVehicle_PS_cso); assert(neoVehicle_PS); @@ -260,11 +261,11 @@ CreateWorldPipe(void) else ReadTweakValueTable((char*)work_buff, WorldLightmapBlend); -#include "shaders/default_UV2_VS.inc" +#include "shaders/obj/default_UV2_VS.inc" neoWorld_VS = rw::d3d::createVertexShader(default_UV2_VS_cso); assert(neoWorld_VS); -#include "shaders/neoWorldVC_PS.inc" +#include "shaders/obj/neoWorldVC_PS.inc" neoWorldVC_PS = rw::d3d::createPixelShader(neoWorldVC_PS_cso); assert(neoWorldVC_PS); @@ -347,11 +348,11 @@ glossRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) void CreateGlossPipe(void) { -#include "shaders/neoGloss_VS.inc" +#include "shaders/obj/neoGloss_VS.inc" neoGloss_VS = rw::d3d::createVertexShader(neoGloss_VS_cso); assert(neoGloss_VS); -#include "shaders/neoGloss_PS.inc" +#include "shaders/obj/neoGloss_PS.inc" neoGloss_PS = rw::d3d::createPixelShader(neoGloss_PS_cso); assert(neoGloss_PS); @@ -421,6 +422,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices(header->indexBuffer); setVertexDeclaration(header->vertexDeclaration); @@ -438,7 +440,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture){ d3d::setTexture(0, m->texture); @@ -464,7 +466,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) } int vsBits; - + rw::uint32 flags = atomic->geometry->flags; setStreamSource(0, (IDirect3DVertexBuffer9*)header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride); setIndices((IDirect3DIndexBuffer9*)header->indexBuffer); @@ -485,7 +487,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255); - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(inst->material->texture){ d3d::setTexture(0, m->texture); @@ -513,11 +515,11 @@ CreateRimLightPipes(void) } -#include "shaders/neoRim_VS.inc" +#include "shaders/obj/neoRim_VS.inc" neoRim_VS = rw::d3d::createVertexShader(neoRim_VS_cso); assert(neoRim_VS); -#include "shaders/neoRimSkin_VS.inc" +#include "shaders/obj/neoRimSkin_VS.inc" neoRimSkin_VS = rw::d3d::createVertexShader(neoRimSkin_VS_cso); assert(neoRimSkin_VS); @@ -611,6 +613,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) assert(building->instHeader->platform == PLATFORM_D3D9); building->fadeAlpha = 255; building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT); + rw::uint32 flags = atomic->geometry->flags; bool setupDone = false; bool defer = false; @@ -640,7 +643,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) setupDone = true; } - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); if(m->texture){ d3d::setTexture(0, m->texture); @@ -703,7 +706,7 @@ RenderBlendPass(int pass) rw::RGBA color = m->color; color.alpha = (color.alpha * building->fadeAlpha)/255; - setMaterial(color, m->surfaceProps); + setMaterial(color, m->surfaceProps); // always modulate here if(m->texture){ d3d::setTexture(0, m->texture); diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp index 8a574579..6cbd0bb7 100644 --- a/src/extras/custompipes_gl.cpp +++ b/src/extras/custompipes_gl.cpp @@ -87,6 +87,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -119,7 +120,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -160,8 +161,8 @@ CreateVehiclePipe(void) { -#include "shaders/neoVehicle_fs_gl.inc" -#include "shaders/neoVehicle_vs_gl.inc" +#include "shaders/obj/neoVehicle_frag.inc" +#include "shaders/obj/neoVehicle_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoVehicle_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil }; neoVehicleShader = Shader::create(vs, fs); @@ -271,8 +272,8 @@ CreateWorldPipe(void) ReadTweakValueTable((char*)work_buff, WorldLightmapBlend); { -#include "shaders/neoWorldVC_fs_gl.inc" -#include "shaders/default_UV2_gl.inc" +#include "shaders/obj/neoWorldVC_frag.inc" +#include "shaders/obj/default_UV2_vert.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); @@ -379,8 +380,8 @@ CreateGlossPipe(void) using namespace rw::gl3; { -#include "shaders/neoGloss_fs_gl.inc" -#include "shaders/neoGloss_vs_gl.inc" +#include "shaders/obj/neoGloss_frag.inc" +#include "shaders/obj/neoGloss_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoGloss_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, neoGloss_frag_src, nil }; neoGlossShader = Shader::create(vs, fs); @@ -449,6 +450,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -472,7 +474,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -499,6 +501,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) Material *m; + rw::uint32 flags = atomic->geometry->flags; setWorldMatrix(atomic->getFrame()->getLTM()); lightingCB(atomic); @@ -520,7 +523,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) while(n--){ m = inst->material; - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -551,8 +554,8 @@ CreateRimLightPipes(void) } { -#include "shaders/simple_fs_gl.inc" -#include "shaders/neoRimSkin_gl.inc" +#include "shaders/obj/simple_frag.inc" +#include "shaders/obj/neoRimSkin_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoRimSkin_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil }; neoRimSkinShader = Shader::create(vs, fs); @@ -560,8 +563,8 @@ CreateRimLightPipes(void) } { -#include "shaders/simple_fs_gl.inc" -#include "shaders/neoRim_gl.inc" +#include "shaders/obj/simple_frag.inc" +#include "shaders/obj/neoRim_vert.inc" const char *vs[] = { shaderDecl, header_vert_src, neoRim_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil }; neoRimShader = Shader::create(vs, fs); @@ -665,6 +668,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) assert(building->instHeader->platform == PLATFORM_GL3); building->fadeAlpha = 255; building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT); + rw::uint32 flags = atomic->geometry->flags; WorldLights lights; lights.numAmbients = 1; @@ -704,7 +708,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass) setupDone = true; } - setMaterial(m->color, m->surfaceProps); + setMaterial(flags, m->color, m->surfaceProps); setTexture(0, m->texture); @@ -773,7 +777,7 @@ RenderBlendPass(int pass) rw::RGBA color = m->color; color.alpha = (color.alpha * building->fadeAlpha)/255; - setMaterial(color, m->surfaceProps); + setMaterial(color, m->surfaceProps); // always modulate here setTexture(0, m->texture); diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp index 03010267..b47deab4 100644 --- a/src/extras/postfx.cpp +++ b/src/extras/postfx.cpp @@ -142,17 +142,17 @@ CPostFX::Open(RwCamera *cam) #ifdef RW_D3D9 -#include "shaders/colourfilterVC_PS.inc" +#include "shaders/obj/colourfilterVC_PS.inc" colourfilterVC_PS = rw::d3d::createPixelShader(colourfilterVC_PS_cso); -#include "shaders/contrastPS.inc" +#include "shaders/obj/contrastPS.inc" contrast_PS = rw::d3d::createPixelShader(contrastPS_cso); #endif #ifdef RW_OPENGL using namespace rw::gl3; { -#include "shaders/im2d_gl.inc" -#include "shaders/colourfilterVC_fs_gl.inc" +#include "shaders/obj/im2d_vert.inc" +#include "shaders/obj/colourfilterVC_frag.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); @@ -160,8 +160,8 @@ CPostFX::Open(RwCamera *cam) } { -#include "shaders/im2d_gl.inc" -#include "shaders/contrast_fs_gl.inc" +#include "shaders/obj/im2d_vert.inc" +#include "shaders/obj/contrast_frag.inc" const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, contrast_frag_src, nil }; contrast = Shader::create(vs, fs); diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp index 74c44da0..1412141e 100644 --- a/src/extras/screendroplets.cpp +++ b/src/extras/screendroplets.cpp @@ -112,14 +112,14 @@ ScreenDroplets::InitDraw(void) openim2d_uv2(); #ifdef RW_D3D9 -#include "shaders/screenDroplet_PS.inc" +#include "shaders/obj/screenDroplet_PS.inc" screenDroplet_PS = rw::d3d::createPixelShader(screenDroplet_PS_cso); #endif #ifdef RW_GL3 using namespace rw::gl3; { -#include "shaders/im2d_UV2_gl.inc" -#include "shaders/screenDroplet_fs_gl.inc" +#include "shaders/obj/im2d_UV2_vert.inc" +#include "shaders/obj/screenDroplet_frag.inc" const char *vs[] = { shaderDecl, header_vert_src, im2d_UV2_vert_src, nil }; const char *fs[] = { shaderDecl, header_frag_src, screenDroplet_frag_src, nil }; screenDroplet = Shader::create(vs, fs); diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile deleted file mode 100644 index 5089e16a..00000000 --- a/src/extras/shaders/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \ - colourfilterVC_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_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 -simple_fs_gl.inc: simple.frag - (echo 'const char *simple_frag_src =';\ - sed 's/..*/"&\\n"/' simple.frag;\ - echo ';') >simple_fs_gl.inc - -default_UV2_gl.inc: default_UV2.vert - (echo 'const char *default_UV2_vert_src =';\ - sed 's/..*/"&\\n"/' default_UV2.vert;\ - echo ';') >default_UV2_gl.inc - - - -contrast_fs_gl.inc: contrast.frag - (echo 'const char *contrast_frag_src =';\ - sed 's/..*/"&\\n"/' contrast.frag;\ - echo ';') >contrast_fs_gl.inc - - -neoRim_gl.inc: neoRim.vert - (echo 'const char *neoRim_vert_src =';\ - sed 's/..*/"&\\n"/' neoRim.vert;\ - echo ';') >neoRim_gl.inc - -neoRimSkin_gl.inc: neoRimSkin.vert - (echo 'const char *neoRimSkin_vert_src =';\ - sed 's/..*/"&\\n"/' neoRimSkin.vert;\ - echo ';') >neoRimSkin_gl.inc - -neoWorldVC_fs_gl.inc: neoWorldVC.frag - (echo 'const char *neoWorldVC_frag_src =';\ - sed 's/..*/"&\\n"/' neoWorldVC.frag;\ - echo ';') >neoWorldVC_fs_gl.inc - -neoGloss_fs_gl.inc: neoGloss.frag - (echo 'const char *neoGloss_frag_src =';\ - sed 's/..*/"&\\n"/' neoGloss.frag;\ - echo ';') >neoGloss_fs_gl.inc - -neoGloss_vs_gl.inc: neoGloss.vert - (echo 'const char *neoGloss_vert_src =';\ - sed 's/..*/"&\\n"/' neoGloss.vert;\ - echo ';') >neoGloss_vs_gl.inc - -neoVehicle_vs_gl.inc: neoVehicle.vert - (echo 'const char *neoVehicle_vert_src =';\ - sed 's/..*/"&\\n"/' neoVehicle.vert;\ - echo ';') >neoVehicle_vs_gl.inc - -neoVehicle_fs_gl.inc: neoVehicle.frag - (echo 'const char *neoVehicle_frag_src =';\ - sed 's/..*/"&\\n"/' neoVehicle.frag;\ - echo ';') >neoVehicle_fs_gl.inc - -im2d_UV2_gl.inc: im2d_UV2.vert - (echo 'const char *im2d_UV2_vert_src =';\ - sed 's/..*/"&\\n"/' im2d_UV2.vert;\ - echo ';') >im2d_UV2_gl.inc - -screenDroplet_fs_gl.inc: screenDroplet.frag - (echo 'const char *screenDroplet_frag_src =';\ - sed 's/..*/"&\\n"/' screenDroplet.frag;\ - echo ';') >screenDroplet_fs_gl.inc diff --git a/src/extras/shaders/make_glsl.sh b/src/extras/shaders/make_glsl.sh new file mode 100644 index 00000000..0af98961 --- /dev/null +++ b/src/extras/shaders/make_glsl.sh @@ -0,0 +1,9 @@ +#!sh +for i in *.vert; do + echo $i + ./makeinc_glsl.sh $i +done +for i in *.frag; do + echo $i + ./makeinc_glsl.sh $i +done diff --git a/src/extras/shaders/make.cmd b/src/extras/shaders/make_hlsl.cmd similarity index 58% rename from src/extras/shaders/make.cmd rename to src/extras/shaders/make_hlsl.cmd index 8404ac6c..dee95283 100644 --- a/src/extras/shaders/make.cmd +++ b/src/extras/shaders/make_hlsl.cmd @@ -1,3 +1,3 @@ @echo off -for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo %%~nf.cso %%f -for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo %%~nf.cso %%f +for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f +for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f diff --git a/src/extras/shaders/makeinc_glsl.sh b/src/extras/shaders/makeinc_glsl.sh new file mode 100644 index 00000000..2bc6a387 --- /dev/null +++ b/src/extras/shaders/makeinc_glsl.sh @@ -0,0 +1,6 @@ +#!sh +ext=${1##*.} +name=${1%.*} +(echo "const char *${name}_${ext}_src =";\ +sed 's/..*/"&\\n"/' $1;\ +echo ';') > obj/${name}_${ext}.inc diff --git a/src/extras/shaders/makeinc.sh b/src/extras/shaders/makeinc_hlsl.sh similarity index 93% rename from src/extras/shaders/makeinc.sh rename to src/extras/shaders/makeinc_hlsl.sh index a649af33..a5b12867 100644 --- a/src/extras/shaders/makeinc.sh +++ b/src/extras/shaders/makeinc_hlsl.sh @@ -1,4 +1,5 @@ #!sh +cd obj for i in *cso; do (echo -n 'static ' xxd -i $i | grep -v '_len = ') > ${i%cso}inc diff --git a/src/extras/shaders/colourfilterVC_PS.cso b/src/extras/shaders/obj/colourfilterVC_PS.cso similarity index 100% rename from src/extras/shaders/colourfilterVC_PS.cso rename to src/extras/shaders/obj/colourfilterVC_PS.cso diff --git a/src/extras/shaders/colourfilterVC_PS.inc b/src/extras/shaders/obj/colourfilterVC_PS.inc similarity index 100% rename from src/extras/shaders/colourfilterVC_PS.inc rename to src/extras/shaders/obj/colourfilterVC_PS.inc diff --git a/src/extras/shaders/colourfilterVC_fs_gl.inc b/src/extras/shaders/obj/colourfilterVC_frag.inc similarity index 100% rename from src/extras/shaders/colourfilterVC_fs_gl.inc rename to src/extras/shaders/obj/colourfilterVC_frag.inc diff --git a/src/extras/shaders/contrastPS.cso b/src/extras/shaders/obj/contrastPS.cso similarity index 100% rename from src/extras/shaders/contrastPS.cso rename to src/extras/shaders/obj/contrastPS.cso diff --git a/src/extras/shaders/contrastPS.inc b/src/extras/shaders/obj/contrastPS.inc similarity index 100% rename from src/extras/shaders/contrastPS.inc rename to src/extras/shaders/obj/contrastPS.inc diff --git a/src/extras/shaders/contrast_fs_gl.inc b/src/extras/shaders/obj/contrast_frag.inc similarity index 100% rename from src/extras/shaders/contrast_fs_gl.inc rename to src/extras/shaders/obj/contrast_frag.inc diff --git a/src/extras/shaders/default_UV2_VS.cso b/src/extras/shaders/obj/default_UV2_VS.cso similarity index 100% rename from src/extras/shaders/default_UV2_VS.cso rename to src/extras/shaders/obj/default_UV2_VS.cso diff --git a/src/extras/shaders/default_UV2_VS.inc b/src/extras/shaders/obj/default_UV2_VS.inc similarity index 100% rename from src/extras/shaders/default_UV2_VS.inc rename to src/extras/shaders/obj/default_UV2_VS.inc diff --git a/src/extras/shaders/default_UV2_gl.inc b/src/extras/shaders/obj/default_UV2_vert.inc similarity index 100% rename from src/extras/shaders/default_UV2_gl.inc rename to src/extras/shaders/obj/default_UV2_vert.inc diff --git a/src/extras/shaders/im2d_UV2_gl.inc b/src/extras/shaders/obj/im2d_UV2_vert.inc similarity index 100% rename from src/extras/shaders/im2d_UV2_gl.inc rename to src/extras/shaders/obj/im2d_UV2_vert.inc diff --git a/src/extras/shaders/im2d_gl.inc b/src/extras/shaders/obj/im2d_vert.inc similarity index 100% rename from src/extras/shaders/im2d_gl.inc rename to src/extras/shaders/obj/im2d_vert.inc diff --git a/src/extras/shaders/neoGloss_PS.cso b/src/extras/shaders/obj/neoGloss_PS.cso similarity index 100% rename from src/extras/shaders/neoGloss_PS.cso rename to src/extras/shaders/obj/neoGloss_PS.cso diff --git a/src/extras/shaders/neoGloss_PS.inc b/src/extras/shaders/obj/neoGloss_PS.inc similarity index 100% rename from src/extras/shaders/neoGloss_PS.inc rename to src/extras/shaders/obj/neoGloss_PS.inc diff --git a/src/extras/shaders/neoGloss_VS.cso b/src/extras/shaders/obj/neoGloss_VS.cso similarity index 100% rename from src/extras/shaders/neoGloss_VS.cso rename to src/extras/shaders/obj/neoGloss_VS.cso diff --git a/src/extras/shaders/neoGloss_VS.inc b/src/extras/shaders/obj/neoGloss_VS.inc similarity index 100% rename from src/extras/shaders/neoGloss_VS.inc rename to src/extras/shaders/obj/neoGloss_VS.inc diff --git a/src/extras/shaders/neoGloss_fs_gl.inc b/src/extras/shaders/obj/neoGloss_frag.inc similarity index 100% rename from src/extras/shaders/neoGloss_fs_gl.inc rename to src/extras/shaders/obj/neoGloss_frag.inc diff --git a/src/extras/shaders/neoGloss_vs_gl.inc b/src/extras/shaders/obj/neoGloss_vert.inc similarity index 100% rename from src/extras/shaders/neoGloss_vs_gl.inc rename to src/extras/shaders/obj/neoGloss_vert.inc diff --git a/src/extras/shaders/neoRimSkin_VS.cso b/src/extras/shaders/obj/neoRimSkin_VS.cso similarity index 100% rename from src/extras/shaders/neoRimSkin_VS.cso rename to src/extras/shaders/obj/neoRimSkin_VS.cso diff --git a/src/extras/shaders/neoRimSkin_VS.inc b/src/extras/shaders/obj/neoRimSkin_VS.inc similarity index 100% rename from src/extras/shaders/neoRimSkin_VS.inc rename to src/extras/shaders/obj/neoRimSkin_VS.inc diff --git a/src/extras/shaders/neoRimSkin_gl.inc b/src/extras/shaders/obj/neoRimSkin_vert.inc similarity index 100% rename from src/extras/shaders/neoRimSkin_gl.inc rename to src/extras/shaders/obj/neoRimSkin_vert.inc diff --git a/src/extras/shaders/neoRim_VS.cso b/src/extras/shaders/obj/neoRim_VS.cso similarity index 100% rename from src/extras/shaders/neoRim_VS.cso rename to src/extras/shaders/obj/neoRim_VS.cso diff --git a/src/extras/shaders/neoRim_VS.inc b/src/extras/shaders/obj/neoRim_VS.inc similarity index 100% rename from src/extras/shaders/neoRim_VS.inc rename to src/extras/shaders/obj/neoRim_VS.inc diff --git a/src/extras/shaders/neoRim_gl.inc b/src/extras/shaders/obj/neoRim_vert.inc similarity index 100% rename from src/extras/shaders/neoRim_gl.inc rename to src/extras/shaders/obj/neoRim_vert.inc diff --git a/src/extras/shaders/neoVehicle_PS.cso b/src/extras/shaders/obj/neoVehicle_PS.cso similarity index 100% rename from src/extras/shaders/neoVehicle_PS.cso rename to src/extras/shaders/obj/neoVehicle_PS.cso diff --git a/src/extras/shaders/neoVehicle_PS.inc b/src/extras/shaders/obj/neoVehicle_PS.inc similarity index 100% rename from src/extras/shaders/neoVehicle_PS.inc rename to src/extras/shaders/obj/neoVehicle_PS.inc diff --git a/src/extras/shaders/neoVehicle_VS.cso b/src/extras/shaders/obj/neoVehicle_VS.cso similarity index 100% rename from src/extras/shaders/neoVehicle_VS.cso rename to src/extras/shaders/obj/neoVehicle_VS.cso diff --git a/src/extras/shaders/neoVehicle_VS.inc b/src/extras/shaders/obj/neoVehicle_VS.inc similarity index 100% rename from src/extras/shaders/neoVehicle_VS.inc rename to src/extras/shaders/obj/neoVehicle_VS.inc diff --git a/src/extras/shaders/neoVehicle_fs_gl.inc b/src/extras/shaders/obj/neoVehicle_frag.inc similarity index 100% rename from src/extras/shaders/neoVehicle_fs_gl.inc rename to src/extras/shaders/obj/neoVehicle_frag.inc diff --git a/src/extras/shaders/neoVehicle_vs_gl.inc b/src/extras/shaders/obj/neoVehicle_vert.inc similarity index 100% rename from src/extras/shaders/neoVehicle_vs_gl.inc rename to src/extras/shaders/obj/neoVehicle_vert.inc diff --git a/src/extras/shaders/neoWorldVC_PS.cso b/src/extras/shaders/obj/neoWorldVC_PS.cso similarity index 100% rename from src/extras/shaders/neoWorldVC_PS.cso rename to src/extras/shaders/obj/neoWorldVC_PS.cso diff --git a/src/extras/shaders/neoWorldVC_PS.inc b/src/extras/shaders/obj/neoWorldVC_PS.inc similarity index 100% rename from src/extras/shaders/neoWorldVC_PS.inc rename to src/extras/shaders/obj/neoWorldVC_PS.inc diff --git a/src/extras/shaders/neoWorldVC_fs_gl.inc b/src/extras/shaders/obj/neoWorldVC_frag.inc similarity index 100% rename from src/extras/shaders/neoWorldVC_fs_gl.inc rename to src/extras/shaders/obj/neoWorldVC_frag.inc diff --git a/src/extras/shaders/screenDroplet_PS.cso b/src/extras/shaders/obj/screenDroplet_PS.cso similarity index 100% rename from src/extras/shaders/screenDroplet_PS.cso rename to src/extras/shaders/obj/screenDroplet_PS.cso diff --git a/src/extras/shaders/screenDroplet_PS.inc b/src/extras/shaders/obj/screenDroplet_PS.inc similarity index 100% rename from src/extras/shaders/screenDroplet_PS.inc rename to src/extras/shaders/obj/screenDroplet_PS.inc diff --git a/src/extras/shaders/screenDroplet_fs_gl.inc b/src/extras/shaders/obj/screenDroplet_frag.inc similarity index 100% rename from src/extras/shaders/screenDroplet_fs_gl.inc rename to src/extras/shaders/obj/screenDroplet_frag.inc diff --git a/src/extras/shaders/simple_fs_gl.inc b/src/extras/shaders/obj/simple_frag.inc similarity index 100% rename from src/extras/shaders/simple_fs_gl.inc rename to src/extras/shaders/obj/simple_frag.inc diff --git a/vendor/librw b/vendor/librw index 60a5ace1..5c953008 160000 --- a/vendor/librw +++ b/vendor/librw @@ -1 +1 @@ -Subproject commit 60a5ace16309ccd3d174a3ec14a1062540934066 +Subproject commit 5c95300890559c85a2764bc200361f904cd4f9f4