diff --git a/gzdoom.sln b/gzdoom.sln new file mode 100644 index 0000000000..16d1acc3d3 --- /dev/null +++ b/gzdoom.sln @@ -0,0 +1,177 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gzdoom", "gzdoom.vcproj", "{8049475B-5C87-46F9-9358-635218A4EF18}" + ProjectSection(ProjectDependencies) = postProject + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96} = {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96} + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63} = {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63} + {6077B7D6-349F-4077-B552-3BC302EF5859} = {6077B7D6-349F-4077-B552-3BC302EF5859} + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E} = {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E} + {0F80ACBF-460E-44F0-B28E-B3272D1774A7} = {0F80ACBF-460E-44F0-B28E-B3272D1774A7} + {DA47396F-60C1-4BDE-A977-7F7DE461CF77} = {DA47396F-60C1-4BDE-A977-7F7DE461CF77} + {1D179D4B-F008-431B-8C72-111F8372584F} = {1D179D4B-F008-431B-8C72-111F8372584F} + {B68E0ABF-B627-48A3-A92F-D8F827A75054} = {B68E0ABF-B627-48A3-A92F-D8F827A75054} + {8997289F-10BF-4678-8BAA-3BB509C84953} = {8997289F-10BF-4678-8BAA-3BB509C84953} + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466} = {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466} + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4} = {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4} + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F} = {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcproj", "{F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lemon", "tools\lemon\lemon.vcproj", "{0F80ACBF-460E-44F0-B28E-B3272D1774A7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "tools\re2c\re2c.vcproj", "{667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wadsrc", "wadsrc\wadsrc.vcproj", "{1D179D4B-F008-431B-8C72-111F8372584F}" + ProjectSection(ProjectDependencies) = postProject + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3} = {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "updaterevision", "tools\updaterevision\updaterevision.vcproj", "{6077B7D6-349F-4077-B552-3BC302EF5859}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg-6b", "jpeg-6b\jpeg-6b.vcproj", "{AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fixrtext", "tools\fixrtext\fixrtext.vcproj", "{DA47396F-60C1-4BDE-A977-7F7DE461CF77}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumb_static", "dumb\vc6\dumb_static\dumb_static.vcproj", "{8997289F-10BF-4678-8BAA-3BB509C84953}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdtoa", "gdtoa\gdtoa.vcproj", "{B68E0ABF-B627-48A3-A92F-D8F827A75054}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zipdir", "tools\zipdir\zipdir.vcproj", "{24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}" + ProjectSection(ProjectDependencies) = postProject + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4} = {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4} + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63} = {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63} + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F} = {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzmalib", "lzma\lzmalib.vcproj", "{6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "bzip2\bzip2.vcproj", "{A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "game-music-emu", "game-music-emu\game-music-emu.vcproj", "{9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8049475B-5C87-46F9-9358-635218A4EF18}.Debug|Win32.ActiveCfg = Debug|Win32 + {8049475B-5C87-46F9-9358-635218A4EF18}.Debug|Win32.Build.0 = Debug|Win32 + {8049475B-5C87-46F9-9358-635218A4EF18}.Debug|x64.ActiveCfg = Debug|x64 + {8049475B-5C87-46F9-9358-635218A4EF18}.Debug|x64.Build.0 = Debug|x64 + {8049475B-5C87-46F9-9358-635218A4EF18}.Release|Win32.ActiveCfg = Release|Win32 + {8049475B-5C87-46F9-9358-635218A4EF18}.Release|Win32.Build.0 = Release|Win32 + {8049475B-5C87-46F9-9358-635218A4EF18}.Release|x64.ActiveCfg = Release|x64 + {8049475B-5C87-46F9-9358-635218A4EF18}.Release|x64.Build.0 = Release|x64 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Debug|Win32.ActiveCfg = Debug|Win32 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Debug|Win32.Build.0 = Debug|Win32 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Debug|x64.ActiveCfg = Debug|x64 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Debug|x64.Build.0 = Debug|x64 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Release|Win32.ActiveCfg = Release|Win32 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Release|Win32.Build.0 = Release|Win32 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Release|x64.ActiveCfg = Release|x64 + {F9D9E7D4-E1A2-4866-9E85-B1B14137EE63}.Release|x64.Build.0 = Release|x64 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Debug|Win32.ActiveCfg = Debug|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Debug|Win32.Build.0 = Debug|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Debug|x64.ActiveCfg = Release|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Debug|x64.Build.0 = Release|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Release|Win32.ActiveCfg = Release|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Release|Win32.Build.0 = Release|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Release|x64.ActiveCfg = Release|Win32 + {0F80ACBF-460E-44F0-B28E-B3272D1774A7}.Release|x64.Build.0 = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Debug|Win32.ActiveCfg = Debug|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Debug|Win32.Build.0 = Debug|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Debug|x64.ActiveCfg = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Debug|x64.Build.0 = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Release|Win32.ActiveCfg = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Release|Win32.Build.0 = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Release|x64.ActiveCfg = Release|Win32 + {667D2EE7-C357-49E2-9BAB-0A4A45F0F76E}.Release|x64.Build.0 = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Debug|Win32.ActiveCfg = Debug|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Debug|Win32.Build.0 = Debug|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Debug|x64.ActiveCfg = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Debug|x64.Build.0 = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Release|Win32.ActiveCfg = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Release|Win32.Build.0 = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Release|x64.ActiveCfg = Release|Win32 + {1D179D4B-F008-431B-8C72-111F8372584F}.Release|x64.Build.0 = Release|Win32 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Debug|Win32.ActiveCfg = Debug|Win32 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Debug|Win32.Build.0 = Debug|Win32 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Debug|x64.ActiveCfg = Debug|x64 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Debug|x64.Build.0 = Debug|x64 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Release|Win32.ActiveCfg = Release|Win32 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Release|Win32.Build.0 = Release|Win32 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Release|x64.ActiveCfg = Release|x64 + {6077B7D6-349F-4077-B552-3BC302EF5859}.Release|x64.Build.0 = Release|x64 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Debug|Win32.ActiveCfg = Debug|Win32 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Debug|Win32.Build.0 = Debug|Win32 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Debug|x64.ActiveCfg = Debug|x64 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Debug|x64.Build.0 = Debug|x64 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Release|Win32.ActiveCfg = Release|Win32 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Release|Win32.Build.0 = Release|Win32 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Release|x64.ActiveCfg = Release|x64 + {AC3F5340-40CB-4C3A-8AA7-CB7158DB4466}.Release|x64.Build.0 = Release|x64 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Debug|Win32.Build.0 = Debug|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Debug|x64.ActiveCfg = Debug|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Debug|x64.Build.0 = Debug|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Release|Win32.ActiveCfg = Release|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Release|Win32.Build.0 = Release|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Release|x64.ActiveCfg = Release|Win32 + {DA47396F-60C1-4BDE-A977-7F7DE461CF77}.Release|x64.Build.0 = Release|Win32 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Debug|Win32.ActiveCfg = Debug|Win32 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Debug|Win32.Build.0 = Debug|Win32 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Debug|x64.ActiveCfg = Debug|x64 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Debug|x64.Build.0 = Debug|x64 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Release|Win32.ActiveCfg = Release|Win32 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Release|Win32.Build.0 = Release|Win32 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Release|x64.ActiveCfg = Release|x64 + {8997289F-10BF-4678-8BAA-3BB509C84953}.Release|x64.Build.0 = Release|x64 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Debug|Win32.ActiveCfg = Debug|Win32 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Debug|Win32.Build.0 = Debug|Win32 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Debug|x64.ActiveCfg = Debug|x64 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Debug|x64.Build.0 = Debug|x64 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Release|Win32.ActiveCfg = Release|Win32 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Release|Win32.Build.0 = Release|Win32 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Release|x64.ActiveCfg = Release|x64 + {B68E0ABF-B627-48A3-A92F-D8F827A75054}.Release|x64.Build.0 = Release|x64 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Debug|Win32.ActiveCfg = Debug|Win32 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Debug|Win32.Build.0 = Debug|Win32 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Debug|x64.ActiveCfg = Debug|x64 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Debug|x64.Build.0 = Debug|x64 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Release|Win32.ActiveCfg = Release|Win32 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Release|Win32.Build.0 = Release|Win32 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Release|x64.ActiveCfg = Release|x64 + {24A19C02-F041-4AB0-A1A1-02E1E88EDBD3}.Release|x64.Build.0 = Release|x64 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Debug|Win32.ActiveCfg = Debug|Win32 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Debug|Win32.Build.0 = Debug|Win32 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Debug|x64.ActiveCfg = Debug|x64 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Debug|x64.Build.0 = Debug|x64 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Release|Win32.ActiveCfg = Release|Win32 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Release|Win32.Build.0 = Release|Win32 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Release|x64.ActiveCfg = Release|x64 + {6EB27E78-7C7A-4F08-8E19-957E8EB3A20F}.Release|x64.Build.0 = Release|x64 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Debug|Win32.Build.0 = Debug|Win32 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Debug|x64.ActiveCfg = Debug|x64 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Debug|x64.Build.0 = Debug|x64 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Release|Win32.ActiveCfg = Release|Win32 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Release|Win32.Build.0 = Release|Win32 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Release|x64.ActiveCfg = Release|x64 + {A7DE5C73-D623-4118-A48A-BDFD1FAE97D4}.Release|x64.Build.0 = Release|x64 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Debug|Win32.ActiveCfg = Release|Win32 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Debug|Win32.Build.0 = Release|Win32 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Debug|x64.ActiveCfg = Release|x64 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Debug|x64.Build.0 = Release|x64 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Release|Win32.ActiveCfg = Release|Win32 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Release|Win32.Build.0 = Release|Win32 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Release|x64.ActiveCfg = Release|x64 + {9B465A9E-E5C7-4577-B559-3CA2F7AE7D96}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/wadsrc/static/glstuff/gllight.png b/wadsrc/static/glstuff/gllight.png new file mode 100644 index 0000000000..a3a296b9f8 Binary files /dev/null and b/wadsrc/static/glstuff/gllight.png differ diff --git a/wadsrc/static/glstuff/glpart.png b/wadsrc/static/glstuff/glpart.png new file mode 100644 index 0000000000..ddb0aea8ea Binary files /dev/null and b/wadsrc/static/glstuff/glpart.png differ diff --git a/wadsrc/static/glstuff/glpart2.png b/wadsrc/static/glstuff/glpart2.png new file mode 100644 index 0000000000..f95255ebfb Binary files /dev/null and b/wadsrc/static/glstuff/glpart2.png differ diff --git a/wadsrc/static/glstuff/mirror.png b/wadsrc/static/glstuff/mirror.png new file mode 100644 index 0000000000..08a6abcbe6 Binary files /dev/null and b/wadsrc/static/glstuff/mirror.png differ diff --git a/wadsrc/static/shaders/glsl/fogboundary.fp b/wadsrc/static/shaders/glsl/fogboundary.fp new file mode 100644 index 0000000000..5b43dfd956 --- /dev/null +++ b/wadsrc/static/shaders/glsl/fogboundary.fp @@ -0,0 +1,36 @@ +uniform int fogenabled; +uniform vec4 fogcolor; +uniform vec3 camerapos; +varying vec4 pixelpos; +varying vec4 fogparm; + +//=========================================================================== +// +// Main shader routine +// +//=========================================================================== + +void main() +{ + float fogdist; + float fogfactor; + + // + // calculate fog factor + // + #ifndef NO_SM4 + if (fogenabled == -1) + { + fogdist = pixelpos.w; + } + else + { + fogdist = max(16.0, distance(pixelpos.xyz, camerapos)); + } + #else + fogdist = pixelpos.w; + #endif + fogfactor = exp2 (fogparm.z * fogdist); + gl_FragColor = vec4(fogcolor.rgb, 1.0 - fogfactor); +} + diff --git a/wadsrc/static/shaders/glsl/func_brightmap.fp b/wadsrc/static/shaders/glsl/func_brightmap.fp new file mode 100644 index 0000000000..e8ad0bb3d2 --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_brightmap.fp @@ -0,0 +1,9 @@ +uniform sampler2D texture2; + +vec4 Process(vec4 color) +{ + vec4 brightpix = desaturate(texture2D(texture2, gl_TexCoord[0].st)); + vec4 texel = getTexel(gl_TexCoord[0].st); + return vec4(texel.rgb * min (color.rgb + brightpix.rgb, 1.0), texel.a*color.a); +} + diff --git a/wadsrc/static/shaders/glsl/func_normal.fp b/wadsrc/static/shaders/glsl/func_normal.fp new file mode 100644 index 0000000000..f9297ca6f4 --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_normal.fp @@ -0,0 +1,7 @@ + +vec4 Process(vec4 color) +{ + vec4 pix = getTexel(gl_TexCoord[0].st); + return pix * color; +} + diff --git a/wadsrc/static/shaders/glsl/func_notexture.fp b/wadsrc/static/shaders/glsl/func_notexture.fp new file mode 100644 index 0000000000..99ef44f68d --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_notexture.fp @@ -0,0 +1,6 @@ + +vec4 Process(vec4 color) +{ + return color; +} + diff --git a/wadsrc/static/shaders/glsl/func_warp1.fp b/wadsrc/static/shaders/glsl/func_warp1.fp new file mode 100644 index 0000000000..c4acb88540 --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_warp1.fp @@ -0,0 +1,17 @@ +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + + const float pi = 3.14159265358979323846; + vec2 offset = vec2(0,0); + + offset.y = sin(pi * 2.0 * (texCoord.x + timer * 0.125)) * 0.1; + offset.x = sin(pi * 2.0 * (texCoord.y + timer * 0.125)) * 0.1; + + texCoord += offset; + + return getTexel(texCoord) * color; +} + diff --git a/wadsrc/static/shaders/glsl/func_warp2.fp b/wadsrc/static/shaders/glsl/func_warp2.fp new file mode 100644 index 0000000000..9d5b8f9dbb --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_warp2.fp @@ -0,0 +1,18 @@ +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + + const float pi = 3.14159265358979323846; + vec2 offset = vec2(0.0,0.0); + + float siny = sin(pi * 2.0 * (texCoord.y * 2.2 + timer * 0.75)) * 0.03; + offset.y = siny + sin(pi * 2.0 * (texCoord.x * 0.75 + timer * 0.75)) * 0.03; + offset.x = siny + sin(pi * 2.0 * (texCoord.x * 1.1 + timer * 0.45)) * 0.02; + + texCoord += offset; + + return getTexel(texCoord) * color; +} + diff --git a/wadsrc/static/shaders/glsl/func_wavex.fp b/wadsrc/static/shaders/glsl/func_wavex.fp new file mode 100644 index 0000000000..d90486358d --- /dev/null +++ b/wadsrc/static/shaders/glsl/func_wavex.fp @@ -0,0 +1,13 @@ +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + + const float pi = 3.14159265358979323846; + + texCoord.x += sin(pi * 2.0 * (texCoord.y + timer * 0.125)) * 0.1; + + return getTexel(texCoord) * color; +} + diff --git a/wadsrc/static/shaders/glsl/fuzz_jagged.fp b/wadsrc/static/shaders/glsl/fuzz_jagged.fp new file mode 100644 index 0000000000..d1d1c97279 --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_jagged.fp @@ -0,0 +1,25 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + + vec2 texSplat; + const float pi = 3.14159265358979323846; + texSplat.x = texCoord.x + mod(sin(pi * 2.0 * (texCoord.y + timer * 2.0)),0.1) * 0.1; + texSplat.y = texCoord.y + mod(cos(pi * 2.0 * (texCoord.x + timer * 2.0)),0.1) * 0.1; + + vec4 basicColor = getTexel(texSplat) * color; + + float texX = sin(texCoord.x * 100.0 + timer*5.0); + float texY = cos(texCoord.x * 100.0 + timer*5.0); + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + + float test = mod(timer*2.0+(vX + vY), 0.5); + + basicColor.a = basicColor.a * test; + + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_noise.fp b/wadsrc/static/shaders/glsl/fuzz_noise.fp new file mode 100644 index 0000000000..7e08646cb9 --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_noise.fp @@ -0,0 +1,21 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + texCoord.x = float( int(texCoord.x * 128.0) ) / 128.0; + texCoord.y = float( int(texCoord.y * 128.0) ) / 128.0; + + float texX = sin(mod(texCoord.x * 100.0 + timer*5.0, 3.489)) + texCoord.x / 4.0; + float texY = cos(mod(texCoord.y * 100.0 + timer*5.0, 3.489)) + texCoord.y / 4.0; + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + + float test = mod(timer*2.0+(vX + vY), 0.5); + basicColor.a = basicColor.a * test; + basicColor.rgb = vec3(0.0,0.0,0.0); + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_smooth.fp b/wadsrc/static/shaders/glsl/fuzz_smooth.fp new file mode 100644 index 0000000000..9cb840e785 --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_smooth.fp @@ -0,0 +1,19 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + float texX = texCoord.x / 3.0 + 0.66; + float texY = 0.34 - texCoord.y / 3.0; + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + float test = mod(timer*2.0+(vX + vY), 0.5); + + basicColor.a = basicColor.a * test; + basicColor.r = basicColor.g = basicColor.b = 0.0; + + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp b/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp new file mode 100644 index 0000000000..4c796de60f --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp @@ -0,0 +1,20 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + float texX = sin(mod(texCoord.x * 100.0 + timer*5.0, 3.489)) + texCoord.x / 4.0; + float texY = cos(mod(texCoord.y * 100.0 + timer*5.0, 3.489)) + texCoord.y / 4.0; + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + + + float test = mod(timer*2.0+(vX + vY), 0.5); + basicColor.a = basicColor.a * test; + + basicColor.rgb = vec3(0.0,0.0,0.0); + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp b/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp new file mode 100644 index 0000000000..074e5f10db --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp @@ -0,0 +1,19 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + float texX = sin(texCoord.x * 100.0 + timer*5.0); + float texY = cos(texCoord.x * 100.0 + timer*5.0); + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + + float test = mod(timer*2.0+(vX + vY), 0.5); + + basicColor.a = basicColor.a * test; + + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_standard.fp b/wadsrc/static/shaders/glsl/fuzz_standard.fp new file mode 100644 index 0000000000..a93bef849d --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_standard.fp @@ -0,0 +1,22 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + texCoord.x = float( int(texCoord.x * 128.0) ) / 128.0; + texCoord.y = float( int(texCoord.y * 128.0) ) / 128.0; + + float texX = texCoord.x / 3.0 + 0.66; + float texY = 0.34 - texCoord.y / 3.0; + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + float test = mod(timer*2.0+(vX + vY), 0.5); + + basicColor.a = basicColor.a * test; + basicColor.r = basicColor.g = basicColor.b = 0.0; + + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/fuzz_swirly.fp b/wadsrc/static/shaders/glsl/fuzz_swirly.fp new file mode 100644 index 0000000000..19816f8f49 --- /dev/null +++ b/wadsrc/static/shaders/glsl/fuzz_swirly.fp @@ -0,0 +1,19 @@ +//created by Evil Space Tomato +uniform float timer; + +vec4 Process(vec4 color) +{ + vec2 texCoord = gl_TexCoord[0].st; + vec4 basicColor = getTexel(texCoord) * color; + + float texX = sin(texCoord.x * 100.0 + timer*5.0); + float texY = cos(texCoord.x * 100.0 + timer*5.0); + float vX = (texX/texY)*21.0; + float vY = (texY/texX)*13.0; + float test = mod(timer*2.0+(vX + vY), 0.5); + + basicColor.a = basicColor.a * test; + basicColor.r = basicColor.g = basicColor.b = 0.0; + + return basicColor; +} diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp new file mode 100644 index 0000000000..aa2c33238e --- /dev/null +++ b/wadsrc/static/shaders/glsl/main.fp @@ -0,0 +1,262 @@ + +// Changing this constant gives results very similar to changing r_visibility. +// Default is 232, it seems to give exactly the same light bands as software renderer. +#define DOOMLIGHTFACTOR 232.0 + + +#ifdef DYNLIGHT + +// ATI does not like this inside an #ifdef so it will be prepended by the compiling code inside the .EXE now. +//#version 120 +//#extension GL_EXT_gpu_shader4 : enable + +uniform ivec3 lightrange; +#ifndef MAXLIGHTS128 +uniform vec4 lights[256]; +#else +uniform vec4 lights[128]; +#endif + +#endif + + + +uniform int fogenabled; +uniform vec4 fogcolor; +uniform vec3 dlightcolor; +uniform vec3 camerapos; +varying vec4 pixelpos; +varying vec4 fogparm; +//uniform vec2 lightparms; +uniform float desaturation_factor; + +uniform vec4 topglowcolor; +uniform vec4 bottomglowcolor; +varying vec2 glowdist; + +uniform int texturemode; +uniform sampler2D tex; + +vec4 Process(vec4 color); + + +varying float lightlevel; + +#ifdef SOFTLIGHT +// Doom lighting equation ripped from EDGE. +// Big thanks to EDGE developers for making the only port +// that actually replicates software renderer's lighting in OpenGL. +// Float version. +// Basically replace int with float and divide all constants by 31. +float R_DoomLightingEquation(float light, float dist) +{ + /* L in the range 0 to 63 */ + float L = light * 63.0/31.0; + + float min_L = clamp(36.0/31.0 - L, 0.0, 1.0); + + // Fix objects getting totally black when close. + if (dist < 0.0001) + dist = 0.0001; + + float scale = 1.0 / dist; + float index = (59.0/31.0 - L) - (scale * DOOMLIGHTFACTOR/31.0 - DOOMLIGHTFACTOR/31.0); + + /* result is colormap index (0 bright .. 31 dark) */ + return clamp(index, min_L, 1.0); +} +#endif + +//=========================================================================== +// +// Desaturate a color +// +//=========================================================================== + +vec4 desaturate(vec4 texel) +{ + #ifndef NO_DESATURATE + float gray = (texel.r * 0.3 + texel.g * 0.56 + texel.b * 0.14); + return mix (vec4(gray,gray,gray,texel.a), texel, desaturation_factor); + #else + return texel; + #endif +} + +//=========================================================================== +// +// Calculate light +// +//=========================================================================== + +vec4 getLightColor(float fogdist, float fogfactor) +{ + vec4 color = gl_Color; + #ifdef SOFTLIGHT + float newlightlevel = 1.0 - R_DoomLightingEquation(lightlevel, gl_FragCoord.z); + color.rgb *= clamp(vec3(newlightlevel) + dlightcolor, 0.0, 1.0); + #endif + #ifndef NO_FOG + // + // apply light diminishing + // + if (fogenabled > 0) + { + #if (!defined(NO_SM4) || defined(DOOMLIGHT)) && !defined SOFTLIGHT + // special lighting mode 'Doom' not available on older cards for performance reasons. + if (fogdist < fogparm.y) + { + color.rgb *= fogparm.x - (fogdist / fogparm.y) * (fogparm.x - 1.0); + } + #endif + + //color = vec4(color.rgb * (1.0 - fogfactor), color.a); + color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, fogfactor); + } + #endif + + #ifndef NO_GLOW + // + // handle glowing walls + // + if (topglowcolor.a > 0.0 && glowdist.x < topglowcolor.a) + { + color.rgb += desaturate(topglowcolor * (1.0 - glowdist.x / topglowcolor.a)).rgb; + } + if (bottomglowcolor.a > 0.0 && glowdist.y < bottomglowcolor.a) + { + color.rgb += desaturate(bottomglowcolor * (1.0 - glowdist.y / bottomglowcolor.a)).rgb; + } + color = min(color, 1.0); + #endif + + // calculation of actual light color is complete. + return color; +} + +//=========================================================================== +// +// Gets a texel and performs common manipulations +// +//=========================================================================== + +vec4 getTexel(vec2 st) +{ + vec4 texel = texture2D(tex, st); + + #ifndef NO_TEXTUREMODE + // + // Apply texture modes + // + if (texturemode == 2) + { + texel.a = 1.0; + } + else if (texturemode == 1) + { + texel.rgb = vec3(1.0,1.0,1.0); + } + #endif + + return desaturate(texel); +} + +//=========================================================================== +// +// Applies colored fog +// +//=========================================================================== + +#ifndef NO_FOG +vec4 applyFog(vec4 frag, float fogfactor) +{ + return vec4(mix(fogcolor.rgb, frag.rgb, fogfactor), frag.a); +} +#endif + + +//=========================================================================== +// +// Main shader routine +// +//=========================================================================== + +void main() +{ + float fogdist = 0.0; + float fogfactor = 0.0; + + #ifdef DYNLIGHT + vec4 dynlight = vec4(0.0,0.0,0.0,0.0); + vec4 addlight = vec4(0.0,0.0,0.0,0.0); + #endif + + #ifndef NO_FOG + // + // calculate fog factor + // + if (fogenabled != 0) + { + #ifndef NO_SM4 + if (fogenabled == 1 || fogenabled == -1) + { + fogdist = pixelpos.w; + } + else + { + fogdist = max(16.0, distance(pixelpos.xyz, camerapos)); + } + #elif !defined(FOG_RADIAL) + fogdist = pixelpos.w; + #else + fogdist = max(16.0, distance(pixelpos.xyz, camerapos)); + #endif + fogfactor = exp2 (fogparm.z * fogdist); + } + #endif + + vec4 frag = getLightColor(fogdist, fogfactor); + + + #ifdef DYNLIGHT + for(int i=0; i