Compare commits

...

No commits in common. 'master' and 'master' have entirely different histories.

234 changed files with 40422 additions and 9265 deletions
Split View
  1. +1
    -2
      .gitignore
  2. +0
    -80
      COPYING.md
  3. +1
    -3
      README.md
  4. +101
    -0
      bin_unix/readme.txt
  5. +1
    -1
      config/default.cfg
  6. +139
    -0
      config/default_map_settings.cfg
  7. +19
    -34
      config/glsl/aa.cfg
  8. +20
    -20
      config/glsl/ao.cfg
  9. +6
    -6
      config/glsl/blur.cfg
  10. +27
    -28
      config/glsl/decal.cfg
  11. +11
    -14
      config/glsl/deferred.cfg
  12. +13
    -13
      config/glsl/edit.cfg
  13. +18
    -18
      config/glsl/fxaa.cfg
  14. +45
    -45
      config/glsl/gi.cfg
  15. +10
    -10
      config/glsl/grass.cfg
  16. +52
    -52
      config/glsl/hud.cfg
  17. +71
    -71
      config/glsl/material.cfg
  18. +36
    -36
      config/glsl/misc.cfg
  19. +30
    -30
      config/glsl/model.cfg
  20. +34
    -34
      config/glsl/movie.cfg
  21. +35
    -35
      config/glsl/particle.cfg
  22. +34
    -34
      config/glsl/postfx.cfg
  23. +18
    -18
      config/glsl/scale.cfg
  24. +11
    -11
      config/glsl/shared.cfg
  25. +24
    -24
      config/glsl/sky.cfg
  26. +71
    -71
      config/glsl/smaa.cfg
  27. +9
    -9
      config/glsl/stain.cfg
  28. +76
    -76
      config/glsl/tonemap.cfg
  29. +5
    -5
      config/glsl/ui.cfg
  30. +12
    -12
      config/glsl/volumetric.cfg
  31. +77
    -100
      config/glsl/world.cfg
  32. +82
    -0
      config/server-init.cfg
  33. +46
    -0
      config/sound.cfg
  34. +577
    -0
      config/ui.cfg
  35. +1
    -1
      config/ui/edithud.cfg
  36. +1
    -1
      config/ui/fkey.cfg
  37. +222
    -0
      config/ui/scoreboard.cfg
  38. BIN
      media/blendbrush/circle_32_hard.png
  39. BIN
      media/blendbrush/circle_64_hard.png
  40. BIN
      media/interface/background.png
  41. BIN
      media/interface/crosshair/dot_hit.png
  42. BIN
      media/interface/crosshair/dot_normal.png
  43. BIN
      media/interface/crosshair/dot_normal_hit.png
  44. BIN
      media/interface/crosshair/dot_wide_hit.png
  45. BIN
      media/interface/crosshair/o_dot_hit.png
  46. BIN
      media/interface/crosshair/o_hit.png
  47. BIN
      media/interface/crosshair/o_x_hit.png
  48. BIN
      media/interface/crosshair/star_hit.png
  49. BIN
      media/interface/crosshair/teammate.png
  50. BIN
      media/interface/crosshair/wide_hit.png
  51. BIN
      media/interface/crosshair/x_dot_hit.png
  52. BIN
      media/interface/crosshair/x_hit.png
  53. BIN
      media/particle/base.png
  54. BIN
      media/particle/steam.png
  55. BIN
      media/texture/base/base2.png
  56. BIN
      media/texture/game/norender.png
  57. BIN
      media/texture/game/notexture.png
  58. BIN
      media/texture/game/sky.png
  59. BIN
      media/texture/mat_glass/nieb/cross-noise.png
  60. BIN
      media/texture/mat_glass/nieb/scratch2.png
  61. BIN
      media/texture/mat_glass/nieb/subtle.png
  62. BIN
      media/texture/mat_glass/nieb/vertical-noise.png
  63. BIN
      media/texture/mat_water/nieb/water.png
  64. BIN
      media/texture/mat_water/nieb/waterfall.png
  65. +1
    -5
      meson.build
  66. +65
    -0
      octacore_unix
  67. +22
    -8
      src/client/meson.build
  68. +150
    -0
      src/enet/.deps/callbacks.Plo
  69. +159
    -0
      src/enet/.deps/compress.Plo
  70. +159
    -0
      src/enet/.deps/host.Plo
  71. +150
    -0
      src/enet/.deps/list.Plo
  72. +159
    -0
      src/enet/.deps/packet.Plo
  73. +159
    -0
      src/enet/.deps/peer.Plo
  74. +185
    -0
      src/enet/.deps/protocol.Plo
  75. +228
    -0
      src/enet/.deps/unix.Plo
  76. +6
    -0
      src/enet/.deps/win32.Plo
  77. BIN
      src/enet/.libs/libenet.a
  78. +1
    -0
      src/enet/.libs/libenet.la
  79. +41
    -0
      src/enet/.libs/libenet.lai
  80. +179
    -0
      src/enet/ChangeLog
  81. +7
    -0
      src/enet/LICENSE
  82. +15
    -0
      src/enet/README
  83. +53
    -0
      src/enet/callbacks.c
  84. +654
    -0
      src/enet/compress.c
  85. +492
    -0
      src/enet/host.c
  86. +27
    -0
      src/enet/include/enet/callbacks.h
  87. +592
    -0
      src/enet/include/enet/enet.h
  88. +43
    -0
      src/enet/include/enet/list.h
  89. +198
    -0
      src/enet/include/enet/protocol.h
  90. +18
    -0
      src/enet/include/enet/time.h
  91. +13
    -0
      src/enet/include/enet/types.h
  92. +47
    -0
      src/enet/include/enet/unix.h
  93. +12
    -0
      src/enet/include/enet/utility.h
  94. +57
    -0
      src/enet/include/enet/win32.h
  95. +10
    -0
      src/enet/libenet.pc
  96. +75
    -0
      src/enet/list.c
  97. +62
    -0
      src/enet/meson.build
  98. +165
    -0
      src/enet/packet.c
  99. +1004
    -0
      src/enet/peer.c
  100. +1913
    -0
      src/enet/protocol.c

+ 1
- 2
.gitignore View File

@ -1,3 +1,2 @@
*.o
build
bin_unix/native_*
build

+ 0
- 80
COPYING.md View File

@ -1,80 +0,0 @@
# OctaCore license
All new OctaCore code is provided to you under the terms of the BSD-2-Clause
license, while the original Tesseract/Sauerbraten portions retain their original
license. OctaCore only ships the altered source code of the original projects,
without the media content.
Copyright (c) 2020 Daniel "q66" Kolesa
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.**
# Tesseract
OctaCore is derived from the Tesseract codebase:
Tesseract game engine source code, any release.
Copyright (C) 2001-2020 Wouter van Oortmerssen, Lee Salzman, Mike Dysart,
Robert Pointon, Quinton Reeves, and Benjamin Segovia
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
# Sauerbraten
Tesseract is based on Sauerbraten:
Sauerbraten game engine source code, any release.
Copyright (C) 2001-2020 Wouter van Oortmerssen, Lee Salzman, Mike Dysart,
Robert Pointon, and Quinton Reeves
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

+ 1
- 3
README.md View File

@ -1,5 +1,3 @@
# OctaCore
This is the upcoming engine part of the newly revived OctaForge project. For
now there is nothing much to see here, besides a plain Tesseract codebase
import. This is going to change in near future; stay tuned.
OctaCore is the engine component of OctaForge 2.0.

+ 101
- 0
bin_unix/readme.txt View File

@ -0,0 +1,101 @@
* Installing and Running Tesseract
*nix versions of Tesseract clients and standalone servers.
The clients function identical to the win32 client, see config.html for more
information about command-line options if necessary.
Please run "tesseract_unix" from the root Tesseract dir (NOT from inside the "bin_unix"
directory) to launch these, or set the TESS_DATA variable at the top of the "tesseract_unix"
script to an absolute path to allow it to be run from any location. Note that the "tesseract_unix"
script is set up to write any files (saved maps, configs, etc.) into the user's home
directory at "~/.tesseract".
Clients will need the following dynamic link libraries present:
* libGL (OpenGL)
* SDL2 (>= 2.0.0)
* SDL2_image
* SDL2_mixer
* libpng
* libjpeg
* zlib
If native binaries for your platform are not included, then try the following:
1) Ensure you have the DEVELOPMENT VERSIONS of the above libraries installed.
2) Type "make -C src install".
3) Re-run the "tesseract_unix" script if it succeeded.
The servers (bin_unix/linux_server or bin_unix/native_server) should need no libs
other than libstdc++ and zlib. Note that for the server to see the "config/server-init.cfg",
it must be run from the root Tesseract directory. If you run a server with the
"tesseract_unix -d" command, this happens automatically. However, if you wish to
run the standalone servers instead, then you may need to write an appropriate wrapper
script to change to the appropriate data directory before running the standalone
server binary, as described below in the packaging guide.
* Packaging Guide for Unix-like Operating System Developers/Maintainers
If you are packaging Tesseract up for redistribution in a Linux distribution or other
similar OS, please avoid using the "tesseract_unix" script in its default/unmodified form.
You should at least set the TESS_DATA variable to appropriately find the common Tesseract
data files, or better yet replace it with a more appropriate way of starting Tesseract using
the script as a basis. If the distribution happens to place program binaries in a specific
directory separate from data files, such as "/usr/bin", then much of the lines within the script
that deal with finding an appropriate binary can be removed, as they only exist to help people
running from the original Tesseract tarball. An example run script is shown further
below.
Also, please note, that if your distribution chooses to package the binaries and game data
as separate packages due to whatever licensing rules or cross-architecture package sharing,
that client binaries from newer Tesseract editions are NOT compatible with older versions of
game data, on whole, nor obviously compatible with newer versions of game data. Game data, as a
whole, and client binaries are only roughly compatible within individual Tesseract editions,
though patches to individual Tesseract editions generally always retain compatibility with
the game data.
For those writing custom Tesseract run scripts for packaging, they should adhere to the following
guidelines:
Tesseract finds all game files relative to the current directory from which Tesseract is run,
so any script running Tesseract should set its current directory to where the Tesseract data
files are located before it runs the Tesseract client binaries. No silly symlinking tricks should
be at all necessary.
When running the Tesseract client, one command-line switch should ALWAYS be supplied to
the client binary. This is "-u${HOME}/.tesseract", which will instruct Tesseract to
write any user private files such as saved maps and configurations to a private ".tesseract"
directory within each user's home directory. Tesseract will automatically create this
directory and any subdirectories for each user running it, so do not pre-create this directory
or install any symlinks within it - as some Linux distribution packages have erroneously done.
All command-line switches supplied to the Tesseract run script should be passed to the
Tesseract client after the "-u${HOME}/.tesseract" switch.
A simple script such as the following (with directory/file names set as appropriate) would
ultimately suffice for the client:
#!/bin/sh
TESS_DATA=/usr/share/games/tesseract
TESS_BIN=/usr/bin/tesseract_client
TESS_OPTIONS="-u${HOME}/.tesseract"
cd ${TESS_DATA}
exec ${TESS_BIN} ${TESS_OPTIONS} "$@"
A simple script for the server, which assumes a global default "config/server-init.cfg" in TESS_DATA,
but allows per-user overriding via the home directory, might be:
#!/bin/sh
TESS_DATA=/usr/share/games/tesseract
TESS_SERV_BIN=/usr/bin/tesseract_server
TESS_SERV_OPTIONS="-u${HOME}/.tesseract"
cd ${TESS_DATA}
exec ${TESS_SERV_BIN} ${TESS_SERV_OPTIONS} "$@"
With respect to libraries, make sure that you do not link Tesseract against any other ENet package
than the one that comes included with the Tesseract, as it may be different from the official ENet
releases and might fail to compile or communicate properly.

+ 1
- 1
config/default.cfg View File

@ -11,7 +11,7 @@ name "unnamed"
///////////////////////////////////////////////////////////////////////////////
miniconfilter 0x300 // display chat and team chat in mini-console
confilter (&~ 0xFFF $miniconfilter) // don't display other player frags or mini-console stuff in console
fullconsole = 0
///////////////////////////////////////////////////////////////////////////////
// Universal Mouse Scrollwheel //


+ 139
- 0
config/default_map_settings.cfg View File

@ -29,6 +29,7 @@ loop+ i 1 4 [
]
decalreset
decalload "nieb/complex/loadingbay"
texturereset // Start world texture list
texsky // Dummy "sky" texture
@ -39,4 +40,142 @@ texturereset // Start world texture list
texload "base/white"
texload "base/glow"
// Nieb/Complex
texload "nieb/complex/door_rail"
texload "nieb/complex/door_rail"; texrotate 1
texload "nieb/complex/electrical-outlet"
texload "nieb/complex/glass_2"
texload "nieb/complex/glass_subtle"
texload "nieb/complex/light-switch"
texload "nieb/complex/light01_off"
texload "nieb/complex/light01_on"
texload "nieb/complex/step01"
texload "nieb/complex/step01"; texrotate 1
texload "nieb/complex/step02"
texload "nieb/complex/step02"; texrotate 1
texload "nieb/complex/step03"
texload "nieb/complex/step03"; texrotate 1
texload "nieb/complex/tile01"
texload "nieb/complex/tile02"
texload "nieb/complex/vent"
texload "nieb/complex/wall01"
texload "nieb/complex/woodfloor01"
texload "nieb/complex/woodfloor02"
texload "nieb/complex/woodfloor03"
// CGTextures
texload "cgtextures/buildingshighrise0290"
texload "cgtextures/buildingshighrise0341"
texload "cgtextures/buildingshighrise0436"
texload "cgtextures/carpet01"
texload "cgtextures/ceilingtile01"
texload "cgtextures/tilesplain0119"
texload "cgtextures/tilesplain0119"; texrotate 1
// AGF81
texload "agf81/concrete1"
texload "agf81/concrete1w"
texload "agf81/concrete2"
texload "agf81/concrete2"; texrotate 1
texload "agf81/concrete3"
texload "agf81/concrete3"; texrotate 1
texload "agf81/concrete4"
texload "agf81/concrete5"
texload "agf81/door_texture_2"
texload "agf81/metal_a2"
// Nobiax
texload "nobiax/pattern019"
texload "nobiax/pattern037"
texload "nobiax/pattern042"
texload "nobiax/pattern044"
texload "nobiax/pattern045"
texload "nobiax/pattern047"
texload "nobiax/pattern055"
texload "nobiax/pattern056"
texload "nobiax/pattern057"
texload "nobiax/pattern205"
texload "nobiax/pattern208"
// philipk2
texload "philipk2/pk02_ceiling03"
texload "philipk2/pk02_door01"
texload "philipk2/pk02_door02"
texload "philipk2/pk02_door03"
texload "philipk2/pk02_floor01"
texload "philipk2/pk02_floor02"
texload "philipk2/pk02_floor03"
texload "philipk2/pk02_floor04"
texload "philipk2/pk02_floor05"
texload "philipk2/pk02_floor06a"
texload "philipk2/pk02_floor06b"
texload "philipk2/pk02_floor07"
texload "philipk2/pk02_floor08a"
texload "philipk2/pk02_floor08b"
texload "philipk2/pk02_floor09a"
texload "philipk2/pk02_floor09b"
texload "philipk2/pk02_floor10"
texload "philipk2/pk02_floor11"
texload "philipk2/pk02_floor12a"
texload "philipk2/pk02_floor12b"
texload "philipk2/pk02_floor13a"
texload "philipk2/pk02_floor13b"
texload "philipk2/pk02_floor_cyl01"
texload "philipk2/pk02_floor_cyl02"
texload "philipk2/pk02_generic01a"
texload "philipk2/pk02_generic01b"
texload "philipk2/pk02_light01a"
texload "philipk2/pk02_light01b"
texload "philipk2/pk02_panels01a"
texload "philipk2/pk02_panels01b"
texload "philipk2/pk02_panels01c"
texload "philipk2/pk02_plates01a"
texload "philipk2/pk02_plates01b"
texload "philipk2/pk02_rock01"
texload "philipk2/pk02_sand01"
texload "philipk2/pk02_switches01a"
texload "philipk2/pk02_trim01"
texload "philipk2/pk02_trim02"
texload "philipk2/pk02_trim03"
texload "philipk2/pk02_trim04a"
texload "philipk2/pk02_trim04b"
texload "philipk2/pk02_trim_set01a"
texload "philipk2/pk02_trim_set01b"
texload "philipk2/pk02_trim_set02a"
texload "philipk2/pk02_trim_set02b"
texload "philipk2/pk02_wall01"
texload "philipk2/pk02_wall03a"
texload "philipk2/pk02_wall03b"
texload "philipk2/pk02_wall04a"
texload "philipk2/pk02_wall04b"
texload "philipk2/pk02_wall05a"
texload "philipk2/pk02_wall05b"
texload "philipk2/pk02_wall05c"
texload "philipk2/pk02_wall06a"
texload "philipk2/pk02_wall06b"
texload "philipk2/pk02_wall07a"
texload "philipk2/pk02_wall07b"
texload "philipk2/pk02_wall_big01a"
texload "philipk2/pk02_wall_big01b"
texload "philipk2/pk02_wall_big02a"
texload "philipk2/pk02_wall_big02b"
texload "philipk2/pk02_wall08a"
texload "philipk2/pk02_wall08b"
texload "philipk2/pk02_ceiling02"
texload "philipk2/pk02_computer01a"
texload "philipk2/pk02_computer01b"
texload "philipk2/pk02_computer01c"
texload "philipk2/pk02_light02a"
texload "philipk2/pk02_light02b"
texload "philipk2/pk02_light02c"
texload "philipk2/pk02_light02"
texload "philipk2/pk02_light03"
texload "philipk2/pk02_pipes01"
texload "philipk2/pk02_switches01b"
texload "philipk2/pk02_switches01c"
texload "philipk2/pk02_wall02a"
texload "philipk2/pk02_wall02b"
texload "philipk2/pk02_wall02c"
setshader "stdworld"

+ 19
- 34
config/glsl/aa.cfg View File

@ -5,19 +5,15 @@
////////////////////////////////////////////////
lazyshader 0 "tqaaresolve" [
attribute vec4 vvertex;
in vec4 vvertex;
@(screentexcoord 0)
varying vec2 texcoord0;
@(? $tqaaresolvegather [
varying vec2 texcoord1;
])
out vec2 texcoord0;
out vec2 texcoord1;
void main(void)
{
gl_Position = vvertex;
texcoord0 = vtexcoord0;
@(? $tqaaresolvegather [
texcoord1 = vtexcoord0 - 0.5;
])
texcoord1 = vtexcoord0 - 0.5;
}
] [
@(gfetchdefs tex2)
@ -26,11 +22,9 @@ lazyshader 0 "tqaaresolve" [
uniform mat4 reprojectmatrix;
uniform vec2 maxvelocity;
uniform vec2 colorweight;
varying vec2 texcoord0;
@(? $tqaaresolvegather [
varying vec2 texcoord1;
])
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
in vec2 texcoord1;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(gdepthunpack depth [gfetch(tex2, texcoord0)] [
@ -42,28 +36,19 @@ lazyshader 0 "tqaaresolve" [
vec2 vel = prevtc.xy/prevtc.w - texcoord0;
float scale = clamp(maxvelocity.x*inversesqrt(dot(vel, vel) + 1e-6), 0.0, 1.0);
float mask = 1.0 - texture2DRect(tex0, texcoord0 + quincunx.xy).a;
vec4 color = texture2DRect(tex0, texcoord0 + mask*quincunx.xy);
vec4 prevcolor = texture2DRect(tex1, texcoord0 + mask*(quincunx.zw + vel*scale));
float mask = 1.0 - textureRect(tex0, texcoord0 + quincunx.xy).a;
vec4 color = textureRect(tex0, texcoord0 + mask*quincunx.xy);
vec4 prevcolor = textureRect(tex1, texcoord0 + mask*(quincunx.zw + vel*scale));
@(? $tqaaresolvegather [
vec4 l0 = textureGather(tex0, texcoord1, 1);
vec4 l1 = textureGatherOffset(tex0, texcoord1, ivec2(1, 1), 1);
float l2 = texture2DRectOffset(tex0, texcoord0, ivec2(1, -1)).g;
float l3 = texture2DRectOffset(tex0, texcoord0, ivec2(-1, 1)).g;
vec4 l01min = min(l0, l1), l01max = max(l0, l1);
l01min.xy = min(l01min.xy, l01min.zw);
l01max.xy = max(l01max.xy, l01max.zw);
float lmin = min(min(l01min.x, l01min.y), min(l2, l3));
float lmax = max(max(l01max.x, l01max.y), max(l2, l3));
] [
float l0 = texture2DRect(tex0, texcoord0 + vec2(-1.0, -0.5)).g;
float l1 = texture2DRect(tex0, texcoord0 + vec2( 0.5, -1.0)).g;
float l2 = texture2DRect(tex0, texcoord0 + vec2( 1.0, 0.5)).g;
float l3 = texture2DRect(tex0, texcoord0 + vec2(-0.5, 1.0)).g;
float lmin = min(color.g, min(min(l0, l1), min(l2, l3)));
float lmax = max(color.g, max(max(l0, l1), max(l2, l3)));
])
vec4 l0 = textureGather(tex0, texcoord1, 1);
vec4 l1 = textureGatherOffset(tex0, texcoord1, ivec2(1, 1), 1);
float l2 = textureRectOffset(tex0, texcoord0, ivec2(1, -1)).g;
float l3 = textureRectOffset(tex0, texcoord0, ivec2(-1, 1)).g;
vec4 l01min = min(l0, l1), l01max = max(l0, l1);
l01min.xy = min(l01min.xy, l01min.zw);
l01max.xy = max(l01max.xy, l01max.zw);
float lmin = min(min(l01min.x, l01min.y), min(l2, l3));
float lmax = max(max(l01max.x, l01max.y), max(l2, l3));
float weight = 0.5 - 0.5*clamp((colorweight.x*max(prevcolor.g - lmax, lmin - prevcolor.g) + colorweight.y) / (lmax - lmin + 1e-4), 0.0, 1.0);
weight *= clamp(1.0 - 2.0*(prevcolor.a - color.a), 0.0, 1.0);


+ 20
- 20
config/glsl/ao.cfg View File

@ -25,10 +25,10 @@ ambientobscurancevariantshader = [
derivnormal = (>= (strstr $arg2 "d") 0)
maxaotaps = $arg3
shader 0 $arg1 [
attribute vec4 vvertex;
in vec4 vvertex;
@(screentexcoord 0)
@(screentexcoord 1)
varying vec2 texcoord0, texcoord1;
out vec2 texcoord0, texcoord1;
void main(void)
{
gl_Position = vvertex;
@ -53,8 +53,8 @@ ambientobscurancevariantshader = [
#define depthtc texcoord0
])
uniform vec3 gdepthpackparams;
varying vec2 texcoord0, texcoord1;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0, texcoord1;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(if (&& $derivnormal [= $aodepthformat 1]) [result [
@ -90,7 +90,7 @@ ambientobscurancevariantshader = [
normal *= normscale > 0.75 ? normscale : 0.0;
normal = normalmatrix * normal;
]])
vec2 noise = texture2D(tex2, texcoord1).rg*2.0-1.0;
vec2 noise = texture(tex2, texcoord1).rg*2.0-1.0;
float obscure = 0.0;
@(loopconcat i $maxaotaps [result [
vec2 offset@[i] = reflect(vec2(@(at $aotapoffsets $i)), noise);
@ -127,9 +127,9 @@ ambientobscuranceshader = [
]
shader 0 "linearizedepth" [
attribute vec4 vvertex;
in vec4 vvertex;
@(screentexcoord 0)
varying vec2 texcoord0;
out vec2 texcoord0;
void main(void)
{
gl_Position = vvertex;
@ -138,8 +138,8 @@ shader 0 "linearizedepth" [
] [
@(gfetchdefs tex0 $msaasamples)
uniform vec3 gdepthpackparams;
varying vec2 texcoord0;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(if (! $aodepthformat) [
@ -165,14 +165,14 @@ bilateralvariantshader = [
reduced = $arg4
filterdir = $arg5
shader 0 $arg1 [
attribute vec4 vvertex;
in vec4 vvertex;
@(if $reduced [result [
@(screentexcoord 0)
varying vec2 texcoord0;
out vec2 texcoord0;
]])
@(if $upscaled [result [
@(screentexcoord 1)
varying vec2 texcoord1;
out vec2 texcoord1;
]])
void main(void)
{
@ -185,27 +185,27 @@ bilateralvariantshader = [
uniform sampler2DRect tex0;
uniform vec2 bilateralparams;
uniform vec3 gdepthpackparams;
@(? $reduced [varying vec2 texcoord0;])
@(? $upscaled [varying vec2 texcoord1;])
fragdata(0) vec4 fragcolor;
@(? $reduced [in vec2 texcoord0;])
@(? $upscaled [in vec2 texcoord1;])
layout(location = 0) out vec4 fragcolor;
void main(void)
{
#define tc @(? $upscaled [texcoord1] [gl_FragCoord.xy])
#define depthtc @(? $reduced [texcoord0] [gl_FragCoord.xy])
#define tapvec(type, i) @(? (=s $filterdir "x") [type(i, 0.0)] [type(0.0, i)])
#define texval(i) texture2DRect(tex0, tc + tapvec(vec2, i))
#define texvaloffset(i) texture2DRectOffset(tex0, tc, tapvec(ivec2, i))
#define texval(i) textureRect(tex0, tc + tapvec(vec2, i))
#define texvaloffset(i) textureRectOffset(tex0, tc, tapvec(ivec2, i))
#define depthval(i) gfetch(tex1, depthtc + tapvec(vec2, i))
#define depthvaloffset(i) gfetchoffset(tex1, depthtc, tapvec(ivec2, i))
@(cond [$packed] [
if $aodepthformat [result [
vec2 vals = texture2DRect(tex0, tc).rg;
vec2 vals = textureRect(tex0, tc).rg;
#define color vals.x
@(if $upscaled [gdepthunpack depth [gfetch(tex1, depthtc)]] [result [
#define depth vals.y
]])
]] [result [
vec4 vals = texture2DRect(tex0, tc);
vec4 vals = textureRect(tex0, tc);
#define color vals.a
@(if $upscaled [gdepthunpack depth [gfetch(tex1, depthtc)]] [result [
float depth = dot(vals.rgb, gdepthunpackparams);
@ -219,7 +219,7 @@ bilateralvariantshader = [
float depth = dot(gfetch(tex1, depthtc).rgb, gdepthunpackparams);
]])
]] [result [
float color = texture2DRect(tex0, tc).r;
float color = textureRect(tex0, tc).r;
@(gdepthunpack depth [gfetch(tex1, depthtc)])
]])
float weights = 1.0;


+ 6
- 6
config/glsl/blur.cfg View File

@ -6,12 +6,12 @@
blurshader = [
shader 0 $arg1 [
attribute vec4 vvertex;
in vec4 vvertex;
@(screentexcoord 0)
uniform float offsets[8];
varying vec2 texcoord0, texcoordp1, texcoordn1;
out vec2 texcoord0, texcoordp1, texcoordn1;
@(loopconcat+ i 2 (min (- $arg2 1) 2) [result [
varying vec2 texcoordp@i, texcoordn@i;
out vec2 texcoordp@i, texcoordn@i;
]])
void main(void)
{
@ -33,11 +33,11 @@ blurshader = [
uniform float weights[8];
uniform float offsets[8];
uniform sampler@[arg4] tex0;
varying vec2 texcoord0, texcoordp1, texcoordn1;
in vec2 texcoord0, texcoordp1, texcoordn1;
@(loopconcat+ i 2 (min (- $arg2 1) 2) [result [
varying vec2 texcoordp@i, texcoordn@i;
in vec2 texcoordp@i, texcoordn@i;
]])
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
#define texval(coords) texture@[arg4](tex0, (coords))


+ 27
- 28
config/glsl/decal.cfg View File

@ -51,22 +51,22 @@ decalvariantshader = [
defuniformparam "bumpblend" 1 // alpha-blend strength for normals
]
variantshader $stype $arg1 $srow [
attribute vec4 vvertex;
in vec4 vvertex;
@(? (dtopt "n") [
attribute vec4 vtangent;
varying mat3 world;
in vec4 vtangent;
out mat3 world;
] [
varying vec3 nvec;
out vec3 nvec;
])
attribute vec4 vnormal;
attribute vec3 vtexcoord0;
in vec4 vnormal;
in vec3 vtexcoord0;
uniform mat4 camprojmatrix;
varying vec4 texcoord0;
out vec4 texcoord0;
@(? (|| (dtopt "p") (dtopt "r")) [
uniform vec3 camera;
varying vec3 camvec;
out vec3 camvec;
])
@(? (dtopt "G") [uniform float millis; flat varying float pulse;])
@(? (dtopt "G") [uniform float millis; flat out float pulse;])
void main(void)
{
gl_Position = camprojmatrix * vvertex;
@ -91,38 +91,37 @@ decalvariantshader = [
}
] [
@(cond [dtopt "0"] [result [
fragdata(0) vec4 gcolor;
fragblend(0) vec4 gcolorblend;
layout(location = 0) out vec4 gcolor;
layout(location = 0, index = 1) out vec4 gcolorblend;
]] [dtopt "1"] [
? $usepacknorm [
fragdata(0) vec4 gnormal;
layout(location = 0) out vec4 gnormal;
] [
fragdata(0) vec4 gnormal;
fragblend(0) vec4 gnormalblend;
layout(location = 0) out vec4 gnormal;
layout(location = 0, index = 1) out vec4 gnormalblend;
]
] [result [
fragdata(0) vec4 gcolor;
fragdata(1) vec4 gnormal;
layout(location = 0) out vec4 gcolor;
layout(location = 1) out vec4 gnormal;
]])
uniform sampler2D diffusemap;
uniform vec4 colorparams;
varying vec4 texcoord0;
in vec4 texcoord0;
@(? (dtopt "n") [
uniform sampler2D normalmap;
varying mat3 world;
in mat3 world;
] [
varying vec3 nvec;
#define bumpblend vec4(1.0)
in vec3 nvec;
])
@(? (|| (dtopt "p") (dtopt "r")) [varying vec3 camvec;])
@(? (|| (dtopt "p") (dtopt "r")) [in vec3 camvec;])
@(? (|| (dtopt "g") (dtopt "S")) [uniform sampler2D glowmap;])
@(? (dtopt "G") [flat varying float pulse;])
@(? (dtopt "G") [flat in float pulse;])
@(? (dtopt "r") [uniform samplerCube envmap;])
void main(void)
{
@(if (dtopt "n") [result [
@(? (dtopt "p") [
float height = texture2D(normalmap, texcoord0.xy).a;
float height = texture(normalmap, texcoord0.xy).a;
vec3 camvecn = normalize(camvec);
vec2 dtc = texcoord0.xy + (camvecn * world).xy*(height*parallaxscale.x + parallaxscale.y);
] [
@ -130,7 +129,7 @@ decalvariantshader = [
])
@(? (|| (! (dtopt "0")) (dtopt "r")) [
vec3 bump = texture2D(normalmap, dtc).rgb*2.0 - 1.0;
vec3 bump = texture(normalmap, dtc).rgb*2.0 - 1.0;
vec3 bumpw = world * bump;
#define nvec bumpw
])
@ -138,10 +137,10 @@ decalvariantshader = [
#define dtc texcoord0.xy
]])
vec4 diffuse = texture2D(diffusemap, dtc);
vec4 diffuse = texture(diffusemap, dtc);
@(if (dtopt "g") [result [
vec4 glowspec = texture2D(glowmap, dtc);
vec4 glowspec = texture(glowmap, dtc);
#define glow glowspec.rgb
#define spec glowspec.a
glow *= @(? (dtopt "G") [mix(glowcolor.xyz, pulseglowcolor.xyz, pulse)] [glowcolor.xyz]);
@ -150,7 +149,7 @@ decalvariantshader = [
@(if (dtopt "0") [result [
@(if (&& (dtopt "S") [! (dtopt "g")]) [result [
float spec = @(? (|| (! (dtopt "n")) (dtopt "p")) [texture2D(glowmap, dtc).r] [texture2D(normalmap, dtc).a]);
float spec = @(? (|| (! (dtopt "n")) (dtopt "p")) [texture(glowmap, dtc).r] [texture(normalmap, dtc).a]);
]])
@(gspecpack [gloss.x] (if (dtopt "s") [? (dtopt "S") [spec * specscale.x] [specscale.x]]))
]])
@ -168,7 +167,7 @@ decalvariantshader = [
])
float invfresnel = dot(camvecn, nvec);
vec3 rvec = 2.0*nvec*invfresnel - camvecn;
vec3 reflect = textureCube(envmap, rvec).rgb * diffuse.a;
vec3 reflect = texture(envmap, rvec).rgb * diffuse.a;
@(? (dtopt "R") [
vec3 rmod = envscale.xyz*spec;
] [


+ 11
- 14
config/glsl/deferred.cfg View File

@ -36,7 +36,7 @@ msaadetectedges = [
]
lazyshader 0 msaaedgedetect [
attribute vec4 vvertex;
in vec4 vvertex;
void main(void)
{
gl_Position = vvertex;
@ -119,16 +119,13 @@ deferredlightvariantshader = [
transparent = (<= 8 $arg2 16)
avatar = (<= 17 $arg2 31)
variantshader 0 $arg1 $arg2 (? (< $arg2 0) [
attribute vec4 vvertex;
in vec4 vvertex;
uniform mat4 lightmatrix;
void main(void)
{
gl_Position = lightmatrix * vvertex;
}
]) [
@(? (&& (dlopt "S") [< $glslversion 400]) [
#extension GL_ARB_sample_shading : enable
])
@(? (&& (dlopt "T") [glext "GL_EXT_shader_samples_identical"]) [
#extension GL_EXT_shader_samples_identical : enable
])
@ -183,7 +180,7 @@ deferredlightvariantshader = [
uniform vec4 lightscale;
@(? (&& (dlopt "a") [! $avatar] [! $transparent]) [uniform sampler2DRect tex5; uniform vec2 aoscale; uniform vec4 aoparams;])
@(gdepthunpackparams)
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
@(if (dlopt "p") [
? $spotlight [
@ -253,7 +250,7 @@ deferredlightvariantshader = [
return dot(mix(cols.xyz, cols.yzw, offset.x), vec3(1.0/9.0));
}
]] [dlopt "E"] [result [
#define shadowval(xy, xoff, yoff) float(shadow2DRect(tex4, vec3(xy + vec2(xoff, yoff), shadowtc.z)))
#define shadowval(xy, xoff, yoff) float(textureRect(tex4, vec3(xy + vec2(xoff, yoff), shadowtc.z)))
float filtershadow(vec3 shadowtc)
{
vec2 offset = fract(shadowtc.xy - 0.5);
@ -272,7 +269,7 @@ deferredlightvariantshader = [
(4.0/25.0)*shadowval(center.xy, 0.0, 0.0);
}
]] [dlopt "F"] [result [
#define shadowval(center, xoff, yoff) float(shadow2DRect(tex4, center + vec3(xoff, yoff, 0.0)))
#define shadowval(center, xoff, yoff) float(textureRect(tex4, center + vec3(xoff, yoff, 0.0)))
float filtershadow(vec3 shadowtc)
{
vec2 offset = fract(shadowtc.xy - 0.5);
@ -293,7 +290,7 @@ deferredlightvariantshader = [
shadowval(center, 1.0, 1.0)));
}
]] [dlopt "f"] [result [
#define shadowval(center, xoff, yoff) float(shadow2DRect(tex4, center + vec3(xoff, yoff, 0.0)))
#define shadowval(center, xoff, yoff) float(textureRect(tex4, center + vec3(xoff, yoff, 0.0)))
float filtershadow(vec3 shadowtc)
{
return dot(vec4(0.25),
@ -303,7 +300,7 @@ deferredlightvariantshader = [
shadowval(shadowtc, 1.0, 0.4)));
}
]] [result [
#define filtershadow(shadowtc) float(shadow2DRect(tex4, shadowtc))
#define filtershadow(shadowtc) float(textureRect(tex4, shadowtc))
]]
])
@ -345,7 +342,7 @@ deferredlightvariantshader = [
]])
tc.xy += 0.5;
tc.z = tc.z * @(divf 1 $numrh) + offset;
vec4 shr = texture3D(tex6, tc), shg = texture3D(tex7, tc), shb = texture3D(tex8, tc), sha = texture3D(tex9, tc);
vec4 shr = texture(tex6, tc), shg = texture(tex7, tc), shb = texture(tex8, tc), sha = texture(tex9, tc);
shr.rgb -= 0.5;
shg.rgb -= 0.5;
shb.rgb -= 0.5;
@ -372,7 +369,7 @@ deferredlightvariantshader = [
#define accumalpha(alpha) resolved.a += alpha
@(if (&& [dlopt "a"] [! $avatar] [! $transparent]) [result [
float ao = texture2DRect(tex5, gl_FragCoord.xy*aoscale).r;
float ao = textureRect(tex5, gl_FragCoord.xy*aoscale).r;
]])
for(int sampleidx = 0; sampleidx < @msaasamples; sampleidx++)
@ -386,7 +383,7 @@ deferredlightvariantshader = [
#define accumalpha(alpha) fragcolor.a = alpha
]]
] [result [
#define gfetch(sampler, coords) texture2DRect(sampler, coords)
#define gfetch(sampler, coords) textureRect(sampler, coords)
#define accumlight(light) fragcolor.rgb = light
#define accumalpha(alpha) fragcolor.a = alpha
@ -469,7 +466,7 @@ deferredlightvariantshader = [
@(if (&& (dlopt "a") [! $avatar] [! $transparent]) [result [
@(? (! (&& (dlopt "M") [dlopt "R"])) [
float ao = texture2DRect(tex5, gl_FragCoord.xy*aoscale).r;
float ao = textureRect(tex5, gl_FragCoord.xy*aoscale).r;
])
@(if (dlopt "d") [result [
#define aomask ao


+ 13
- 13
config/glsl/edit.cfg View File

@ -5,12 +5,12 @@
////////////////////////////////////////////////
shader 0 "blendbrush" [
attribute vec4 vvertex, vcolor;
in vec4 vvertex, vcolor;
uniform mat4 camprojmatrix;
uniform vec4 texgenS, texgenT;
uniform float ldrscale;
varying vec4 color;
varying vec2 texcoord0;
out vec4 color;
out vec2 texcoord0;
void main(void)
{
gl_Position = camprojmatrix * vvertex;
@ -19,22 +19,22 @@ shader 0 "blendbrush" [
}
] [
uniform sampler2D tex0;
varying vec4 color;
varying vec2 texcoord0;
fragdata(0) vec4 fragcolor;
in vec4 color;
in vec2 texcoord0;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
fragcolor = texture2D(tex0, texcoord0).r * color;
fragcolor = texture(tex0, texcoord0).r * color;
}
]
lazyshader 0 "prefab" [
attribute vec4 vvertex, vcolor;
attribute vec3 vnormal;
in vec4 vvertex, vcolor;
in vec3 vnormal;
uniform mat4 prefabmatrix;
uniform mat3 prefabworld;
varying vec3 nvec;
varying vec4 color;
out vec3 nvec;
out vec4 color;
@(msaainterpvert)
void main(void)
@ -45,8 +45,8 @@ lazyshader 0 "prefab" [
@(msaapackvert)
}
] [
varying vec3 nvec;
varying vec4 color;
in vec3 nvec;
in vec4 color;
@(msaainterpfrag)
void main(void)


+ 18
- 18
config/glsl/fxaa.cfg View File

@ -216,9 +216,9 @@ fxaadefs = [
]
shader 0 [fxaa@fxaapreset@fxaaopts] [
attribute vec4 vvertex;
in vec4 vvertex;
@(screentexcoord 0)
varying vec2 texcoord0;
out vec2 texcoord0;
void main(void)
{
gl_Position = vvertex;
@ -226,17 +226,17 @@ shader 0 [fxaa@fxaapreset@fxaaopts] [
}
] [
@fxaadefs
varying vec2 texcoord0;
in vec2 texcoord0;
uniform sampler2DRect tex0;
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
#define posM texcoord0
vec4 rgbyM = texture2DRect(tex0, posM);
float lumaS = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2( 0, 1)));
float lumaE = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2( 1, 0)));
float lumaN = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2( 0, -1)));
float lumaW = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2(-1, 0)));
vec4 rgbyM = textureRect(tex0, posM);
float lumaS = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2( 0, 1)));
float lumaE = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2( 1, 0)));
float lumaN = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2( 0, -1)));
float lumaW = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2(-1, 0)));
#define lumaM FXAA_LUMA(rgbyM)
float maxSM = max(lumaS, lumaM);
@ -258,10 +258,10 @@ shader 0 [fxaa@fxaapreset@fxaaopts] [
return;
}
float lumaNW = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2(-1, -1)));
float lumaSE = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2( 1, 1)));
float lumaNE = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2( 1, -1)));
float lumaSW = FXAA_LUMA(texture2DRectOffset(tex0, posM, ivec2(-1, 1)));
float lumaNW = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2(-1, -1)));
float lumaSE = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2( 1, 1)));
float lumaNE = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2( 1, -1)));
float lumaSW = FXAA_LUMA(textureRectOffset(tex0, posM, ivec2(-1, 1)));
float lumaNS = lumaN + lumaS;
float lumaWE = lumaW + lumaE;
@ -311,9 +311,9 @@ shader 0 [fxaa@fxaapreset@fxaaopts] [
vec2 posN = posB - offNP * FXAA_QUALITY_P0;
vec2 posP = posB + offNP * FXAA_QUALITY_P0;
float subpixD = ((-2.0)*subpixC) + 3.0;
float lumaEndN = FXAA_LUMA(texture2DRect(tex0, posN));
float lumaEndN = FXAA_LUMA(textureRect(tex0, posN));
float subpixE = subpixC * subpixC;
float lumaEndP = FXAA_LUMA(texture2DRect(tex0, posP));
float lumaEndP = FXAA_LUMA(textureRect(tex0, posP));
if(!pairN) lumaNN = lumaSS;
float gradientScaled = gradient * 1.0/4.0;
@ -332,8 +332,8 @@ shader 0 [fxaa@fxaapreset@fxaaopts] [
#if (FXAA_QUALITY_PS > @i)
if(contN || contP)
{
if(contN) lumaEndN = FXAA_LUMA(texture2DRect(tex0, posN));
if(contP) lumaEndP = FXAA_LUMA(texture2DRect(tex0, posP));
if(contN) lumaEndN = FXAA_LUMA(textureRect(tex0, posN));
if(contP) lumaEndP = FXAA_LUMA(textureRect(tex0, posP));
if(contN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(contP) lumaEndP = lumaEndP - lumaNN * 0.5;
contN = abs(lumaEndN) < gradientScaled;
@ -369,7 +369,7 @@ shader 0 [fxaa@fxaapreset@fxaaopts] [
if(!horzSpan) posS.x += pixelOffsetSubpix * lengthSign;
if( horzSpan) posS.y += pixelOffsetSubpix * lengthSign;
fragcolor = texture2DRect(tex0, posS);
fragcolor = textureRect(tex0, posS);
}
]

+ 45
- 45
config/glsl/gi.cfg View File

@ -5,15 +5,15 @@
////////////////////////////////////////////////
lazyshader 0 "rsmsky" [
attribute vec4 vvertex;
in vec4 vvertex;
uniform mat4 rsmmatrix;
void main(void)
{
gl_Position = rsmmatrix * vvertex;
}
] [
fragdata(0) vec4 gcolor;
fragdata(1) vec4 gnormal;
layout(location = 0) out vec4 gcolor;
layout(location = 1) out vec4 gnormal;
void main(void)
{
gcolor = vec4(0.0, 0.0, 0.0, 1.0);
@ -170,11 +170,11 @@ rsmtapoffsets32 = [
radiancehintsshader = [
numtaps = (cond [> $arg1 20] 32 [> $arg1 12] 20 12)
shader 0 [radiancehints@arg1] [
attribute vec4 vvertex;
attribute vec3 vtexcoord0;
in vec4 vvertex;
in vec3 vtexcoord0;
uniform mat4 rsmtcmatrix;
varying vec3 rhcenter;
varying vec2 rsmcenter;
out vec3 rhcenter;
out vec2 rsmcenter;
void main(void)
{
gl_Position = vvertex;
@ -187,20 +187,20 @@ radiancehintsshader = [
uniform vec2 rsmspread;
uniform float rhatten, rhspread, rhaothreshold, rhaoatten, rhaoheight;
uniform vec3 rsmdir;
varying vec3 rhcenter;
varying vec2 rsmcenter;
fragdata(0) vec4 rhr;
fragdata(1) vec4 rhg;
fragdata(2) vec4 rhb;
fragdata(3) vec4 rha;
in vec3 rhcenter;
in vec2 rsmcenter;
layout(location = 0) out vec4 rhr;
layout(location = 1) out vec4 rhg;
layout(location = 2) out vec4 rhb;
layout(location = 3) out vec4 rha;
void calcrhsample(vec3 rhtap, vec2 rsmtap, inout vec4 shr, inout vec4 shg, inout vec4 shb, inout vec4 sha)
{
vec3 rhpos = rhcenter + rhtap*rhspread;
vec2 rsmtc = rsmcenter + rsmtap*rsmspread;
float rsmdepth = texture2DRect(tex0, rsmtc).x;
vec3 rsmcolor = texture2DRect(tex1, rsmtc).rgb;
vec3 rsmnormal = texture2DRect(tex2, rsmtc).xyz*2.0 - 1.0;
float rsmdepth = textureRect(tex0, rsmtc).x;
vec3 rsmcolor = textureRect(tex1, rsmtc).rgb;
vec3 rsmnormal = textureRect(tex2, rsmtc).xyz*2.0 - 1.0;
vec3 rsmpos = (rsmworldmatrix * vec4(rsmtc, rsmdepth, 1.0)).xyz;
vec3 dir = rhpos - rsmpos;
@ -234,9 +234,9 @@ radiancehintsshader = [
]
lazyshader 0 radiancehintsborder [
attribute vec4 vvertex;
attribute vec3 vtexcoord0;
varying vec3 texcoord0;
in vec4 vvertex;
in vec3 vtexcoord0;
out vec3 texcoord0;
void main(void)
{
gl_Position = vvertex;
@ -245,27 +245,27 @@ lazyshader 0 radiancehintsborder [
] [
uniform sampler3D tex3, tex4, tex5, tex6;
uniform vec3 bordercenter, borderrange, borderscale;
varying vec3 texcoord0;
fragdata(0) vec4 rhr;
fragdata(1) vec4 rhg;
fragdata(2) vec4 rhb;
fragdata(3) vec4 rha;
in vec3 texcoord0;
layout(location = 0) out vec4 rhr;
layout(location = 1) out vec4 rhg;
layout(location = 2) out vec4 rhb;
layout(location = 3) out vec4 rha;
void main(void)
{
float outside = clamp(borderscale.z*(abs(texcoord0.z - bordercenter.z) - borderrange.z), 0.0, 1.0);
vec3 tc = vec3(texcoord0.xy, clamp(texcoord0.z, bordercenter.z - borderrange.z, bordercenter.z + borderrange.z));
rhr = mix(texture3D(tex3, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rhg = mix(texture3D(tex4, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rhb = mix(texture3D(tex5, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rha = mix(texture3D(tex6, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rhr = mix(texture(tex3, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rhg = mix(texture(tex4, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rhb = mix(texture(tex5, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
rha = mix(texture(tex6, tc), vec4(0.5, 0.5, 0.5, 0.0), outside);
}
]
lazyshader 0 radiancehintscached [
attribute vec4 vvertex;
attribute vec3 vtexcoord0;
varying vec3 texcoord0;
in vec4 vvertex;
in vec3 vtexcoord0;
out vec3 texcoord0;
void main(void)
{
gl_Position = vvertex;
@ -273,23 +273,23 @@ lazyshader 0 radiancehintscached [
}
] [
uniform sampler3D tex7, tex8, tex9, tex10;
varying vec3 texcoord0;
fragdata(0) vec4 rhr;
fragdata(1) vec4 rhg;
fragdata(2) vec4 rhb;
fragdata(3) vec4 rha;
in vec3 texcoord0;
layout(location = 0) out vec4 rhr;
layout(location = 1) out vec4 rhg;
layout(location = 2) out vec4 rhb;
layout(location = 3) out vec4 rha;
void main(void)
{
rhr = texture3D(tex7, texcoord0);
rhg = texture3D(tex8, texcoord0);
rhb = texture3D(tex9, texcoord0);
rha = texture3D(tex10, texcoord0);
rhr = texture(tex7, texcoord0);
rhg = texture(tex8, texcoord0);
rhb = texture(tex9, texcoord0);
rha = texture(tex10, texcoord0);
}
]
lazyshader 0 radiancehintsdisable [
attribute vec4 vvertex;
in vec4 vvertex;
uniform vec3 rhcenter;
uniform float rhbounds;
void main(void)
@ -297,10 +297,10 @@ lazyshader 0 radiancehintsdisable [
gl_Position = vec4((vvertex.xy - rhcenter.xy)/rhbounds, vvertex.zw);
}
] [
fragdata(0) vec4 rhr;
fragdata(1) vec4 rhg;
fragdata(2) vec4 rhb;
fragdata(3) vec4 rha;
layout(location = 0) out vec4 rhr;
layout(location = 1) out vec4 rhg;
layout(location = 2) out vec4 rhb;
layout(location = 3) out vec4 rha;
void main(void)
{


+ 10
- 10
config/glsl/grass.cfg View File

@ -13,13 +13,13 @@ grassvariantshader = [
local grasstype
grasstype = $arg2
variantshader 0 $arg1 (? (grassopt "b") 0 -1) [
attribute vec4 vvertex, vcolor;
attribute vec2 vtexcoord0;
in vec4 vvertex, vcolor;
in vec2 vtexcoord0;
uniform mat4 camprojmatrix;
@(ginterpvert)
varying vec2 texcoord0;
varying vec4 colorscale;
@(? (grassopt "b") [uniform vec4 blendmapparams; varying vec2 texcoord1;])
out vec2 texcoord0;
out vec4 colorscale;
@(? (grassopt "b") [uniform vec4 blendmapparams; out vec2 texcoord1;])
void main(void)
{
gl_Position = camprojmatrix * vvertex;
@ -34,14 +34,14 @@ grassvariantshader = [
uniform sampler2D tex0;
uniform float grasstest;
@(ginterpfrag)
varying vec2 texcoord0;
varying vec4 colorscale;
@(? (grassopt "b") [uniform sampler2D tex1; varying vec2 texcoord1;])
in vec2 texcoord0;
in vec4 colorscale;
@(? (grassopt "b") [uniform sampler2D tex1; in vec2 texcoord1;])
void main(void)
{
vec4 color = texture2D(tex0, texcoord0) * colorscale;
vec4 color = texture(tex0, texcoord0) * colorscale;
@(? (grassopt "b") [
color.a *= texture2D(tex1, texcoord1).r;
color.a *= texture(tex1, texcoord1).r;
])
if(color.a <= grasstest)
discard;


+ 52
- 52
config/glsl/hud.cfg View File

@ -5,11 +5,11 @@
///////////////////////////////////////////////////
shader 0 "hud" [
attribute vec4 vvertex, vcolor;
attribute vec2 vtexcoord0;
in vec4 vvertex, vcolor;
in vec2 vtexcoord0;
uniform mat4 hudmatrix;
varying vec2 texcoord0;
varying vec4 colorscale;
out vec2 texcoord0;
out vec4 colorscale;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -18,22 +18,22 @@ shader 0 "hud" [
}
] [
uniform sampler2D tex0;
varying vec2 texcoord0;
varying vec4 colorscale;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
in vec4 colorscale;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
vec4 color = texture2D(tex0, texcoord0);
vec4 color = texture(tex0, texcoord0);
fragcolor = colorscale * color;
}
]
shader 0 "hudtext" [
attribute vec4 vvertex, vcolor;
attribute vec2 vtexcoord0;
in vec4 vvertex, vcolor;
in vec2 vtexcoord0;
uniform mat4 hudmatrix;
varying vec2 texcoord0;
varying vec4 colorscale;
out vec2 texcoord0;
out vec4 colorscale;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -43,12 +43,12 @@ shader 0 "hudtext" [
] [
uniform sampler2D tex0;
uniform vec4 textparams;
varying vec2 texcoord0;
varying vec4 colorscale;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
in vec4 colorscale;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
float dist = texture2D(tex0, texcoord0).r;
float dist = texture(tex0, texcoord0).r;
float border = smoothstep(textparams.x, textparams.y, dist);
float outline = smoothstep(textparams.z, textparams.w, dist);
fragcolor = vec4(colorscale.rgb * outline, colorscale.a * border);
@ -56,11 +56,11 @@ shader 0 "hudtext" [
]
shader 0 "hudrgb" [
attribute vec4 vvertex, vcolor;
attribute vec2 vtexcoord0;
in vec4 vvertex, vcolor;
in vec2 vtexcoord0;
uniform mat4 hudmatrix;
varying vec2 texcoord0;
varying vec4 colorscale;
out vec2 texcoord0;
out vec4 colorscale;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -69,29 +69,29 @@ shader 0 "hudrgb" [
}
] [
uniform sampler2D tex0;
varying vec2 texcoord0;
varying vec4 colorscale;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
in vec4 colorscale;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
vec4 color = texture2D(tex0, texcoord0);
vec4 color = texture(tex0, texcoord0);
fragcolor.rgb = colorscale.rgb * color.rgb;
fragcolor.a = colorscale.a;
}
]
shader 0 "hudnotexture" [
attribute vec4 vvertex, vcolor;
in vec4 vvertex, vcolor;
uniform mat4 hudmatrix;
varying vec4 color;
out vec4 color;
void main(void)
{
gl_Position = hudmatrix * vvertex;
color = vcolor;
}
] [
varying vec4 color;
fragdata(0) vec4 fragcolor;
in vec4 color;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
fragcolor = color;
@ -99,11 +99,11 @@ shader 0 "hudnotexture" [
]
shader 0 "hudrect" [
attribute vec4 vvertex, vcolor;
attribute vec2 vtexcoord0;
in vec4 vvertex, vcolor;
in vec2 vtexcoord0;
uniform mat4 hudmatrix;
varying vec2 texcoord0;
varying vec4 colorscale;
out vec2 texcoord0;
out vec4 colorscale;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -112,21 +112,21 @@ shader 0 "hudrect" [
}
] [
uniform sampler2DRect tex0;
varying vec2 texcoord0;
varying vec4 colorscale;
fragdata(0) vec4 fragcolor;
in vec2 texcoord0;
in vec4 colorscale;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
fragcolor = colorscale * texture2DRect(tex0, texcoord0);
fragcolor = colorscale * textureRect(tex0, texcoord0);
}
]
shader 0 "hud3d" [
attribute vec4 vvertex, vcolor;
attribute vec3 vtexcoord0;
in vec4 vvertex, vcolor;
in vec3 vtexcoord0;
uniform mat4 hudmatrix;
varying vec3 texcoord0;
varying vec4 color;
out vec3 texcoord0;
out vec4 color;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -135,21 +135,21 @@ shader 0 "hud3d" [
}
] [
uniform sampler3D tex0;
varying vec3 texcoord0;
varying vec4 color;
fragdata(0) vec4 fragcolor;
in vec3 texcoord0;
in vec4 color;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
fragcolor = color * texture3D(tex0, texcoord0);
fragcolor = color * texture(tex0, texcoord0);
}
]
shader 0 "hudcubemap" [
attribute vec4 vvertex, vcolor;
attribute vec3 vtexcoord0;
in vec4 vvertex, vcolor;
in vec3 vtexcoord0;
uniform mat4 hudmatrix;
varying vec3 texcoord0;
varying vec4 colorscale;
out vec3 texcoord0;
out vec4 colorscale;
void main(void)
{
gl_Position = hudmatrix * vvertex;
@ -158,12 +158,12 @@ shader 0 "hudcubemap" [
}
] [
uniform samplerCube tex0;
varying vec3 texcoord0;
varying vec4 colorscale;
fragdata(0) vec4 fragcolor;
in vec3 texcoord0;
in vec4 colorscale;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
fragcolor = colorscale * textureCube(tex0, texcoord0);
fragcolor = colorscale * texture(tex0, texcoord0);
}
]

+ 71
- 71
config/glsl/material.cfg View File

@ -5,7 +5,7 @@
///////////////////////////////////////////////////
shader 0 "refractmask" [
attribute vec4 vvertex;
in vec4 vvertex;
uniform mat4 camprojmatrix;
void main(void)
{
@ -14,7 +14,7 @@ shader 0 "refractmask" [
] [
@(gfetchdefs tex0)
uniform vec3 gdepthpackparams;
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(if (= $gdepthformat 1) [result [
@ -28,7 +28,7 @@ shader 0 "refractmask" [
]
lazyshader 0 "waterminimap" [
attribute vec4 vvertex;
in vec4 vvertex;
uniform mat4 camprojmatrix;
@(ginterpvert)
void main(void)
@ -50,15 +50,15 @@ lazyshader 0 "waterminimap" [
watershader = [
lazyshader 0 $arg1 [
attribute vec4 vvertex;
attribute vec2 vtexcoord0;
in vec4 vvertex;
in vec2 vtexcoord0;
uniform mat4 camprojmatrix;
uniform vec3 camera;
varying vec2 texcoord0, texcoord1;
varying vec3 surface;
out vec2 texcoord0, texcoord1;
out vec3 surface;
@(? (>= (strstr $arg1 "reflect") 0) [
uniform mat4 raymatrix;
varying vec3 esurface;
out vec3 esurface;
])
@(ginterpvert 1)
void main(void)
@ -77,8 +77,8 @@ watershader = [
uniform float millis;
uniform vec3 camera;
uniform mat4 linearworldmatrix;
varying vec2 texcoord0, texcoord1;
varying vec3 surface;
in vec2 texcoord0, texcoord1;
in vec3 surface;
uniform sampler2D tex0, tex1;
uniform vec4 viewsize;
uniform vec3 watercolor, waterdeepcolor, waterdeepfade;
@ -95,17 +95,17 @@ watershader = [
])
@(? (>= (strstr $arg1 "reflect") 0) [
uniform mat4 raymatrix;
varying vec3 esurface;
in vec3 esurface;
])
@(ginterpfrag 1)
void main(void)
{
vec3 camdir = camera - surface, camvec = normalize(camdir);
vec3 bump = texture2D(tex1, texcoord0 + millis*vec2( 0.25, 0.75)*0.1250).rgb;
vec3 bump2 = texture2D(tex1, texcoord0 + millis*vec2(-0.75, -0.25)*0.1450).rgb;
vec3 bump3 = texture2D(tex1, texcoord1 + millis*vec2(-0.50, 0.50)*0.0805).rgb;
vec3 bump4 = texture2D(tex1, texcoord1 + millis*vec2( 0.25, -0.75)*0.0825).rgb;
vec3 bump = texture(tex1, texcoord0 + millis*vec2( 0.25, 0.75)*0.1250).rgb;
vec3 bump2 = texture(tex1, texcoord0 + millis*vec2(-0.75, -0.25)*0.1450).rgb;
vec3 bump3 = texture(tex1, texcoord1 + millis*vec2(-0.50, 0.50)*0.0805).rgb;
vec3 bump4 = texture(tex1, texcoord1 + millis*vec2( 0.25, -0.75)*0.0825).rgb;
bump = normalize(bump + bump2 + bump3 + bump4 - 2.0);
vec2 rtc = bump.xy * waterrefract.w;
@ -126,7 +126,7 @@ watershader = [
@(? (>= (strstr $arg1 "caustics") 0) [
vec2 ctc = vec2(dot(causticsS, rpos.xyz), dot(causticsT, rpos.xyz));
float caustics = causticsblend.x*texture2D(tex2, ctc).r + causticsblend.y*texture2D(tex3, ctc).r + causticsblend.z;
float caustics = causticsblend.x*texture(tex2, ctc).r + causticsblend.y*texture(tex3, ctc).r + causticsblend.z;
rcolor *= caustics;
])
@ -157,7 +157,7 @@ watershader = [
float fresnel = 0.25 + 0.75*pow(clamp(1.0 - dot(camvec, bump), 0.0, 1.0), 4.0);
rcolor = mix(rcolor, reflect, fresnel*edgefade);
]] [if (>= (strstr $arg1 "env") 0) [result [
vec3 reflect = textureCube(tex4, reflectdir).rgb*0.5;
vec3 reflect = texture(tex4, reflectdir).rgb*0.5;
float fresnel = 0.5*pow(clamp(1.0 - dot(camvec, bump), 0.0, 1.0), 4.0);
rcolor = mix(rcolor, reflect, fresnel);
]]])
@ -181,7 +181,7 @@ watershader "underwater"
causticshader = [
lazyshader 0 $arg1 [
attribute vec4 vvertex;
in vec4 vvertex;
void main(void)
{
gl_Position = vvertex;
@ -192,7 +192,7 @@ causticshader = [
uniform vec3 causticsblend;
uniform sampler2D tex0, tex1;
uniform vec4 waterdeepfade;
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(gdepthunpack depth [gfetch(tex9, gl_FragCoord.xy)] [
@ -201,7 +201,7 @@ causticshader = [
vec4 ctc = causticsmatrix * vec4(gl_FragCoord.xy, depth, 1.0);
ctc.xyz /= ctc.w;
])
float caustics = causticsblend.x*texture2D(tex0, ctc.xy).r + causticsblend.y*texture2D(tex1, ctc.xy).r + causticsblend.z;
float caustics = causticsblend.x*texture(tex0, ctc.xy).r + causticsblend.y*texture(tex1, ctc.xy).r + causticsblend.z;
caustics *= clamp(ctc.z, 0.0, 1.0) * clamp(exp2(ctc.z*waterdeepfade.w), 0.0, 1.0);
fragcolor.rgb = vec3(0.5 + caustics);
}
@ -211,7 +211,7 @@ causticshader caustics
waterfogshader = [
lazyshader 0 $arg1 [
attribute vec4 vvertex;
in vec4 vvertex;
void main(void)
{
gl_Position = vvertex;
@ -224,7 +224,7 @@ waterfogshader = [
uniform vec2 fogdensity;
uniform vec3 waterdeepcolor, waterdeepfade;
uniform float waterheight;
fragdata(0) vec4 fragcolor;
layout(location = 0) out vec4 fragcolor;
void main(void)
{
@(gdepthunpack depth [gfetch(tex9, gl_FragCoord.xy)] [
@ -246,12 +246,12 @@ waterfogshader = [
waterfogshader waterfog
lazyshader 0 "lava" [
attribute vec4 vvertex;
attribute vec3 vnormal;
attribute vec2 vtexcoord0;
in vec4 vvertex;
in vec3 vnormal;
in vec2 vtexcoord0;
uniform mat4 camprojmatrix;
varying mat3 world;
varying vec2 texcoord0;
out mat3 world;
out vec2 texcoord0;
@(ginterpvert)
void main(void)
{
@ -265,14 +265,14 @@ lazyshader 0 "lava" [
] [
uniform sampler2D tex0, tex1;
uniform float lavaglow, lavaspec;
varying mat3 world;
varying vec2 texcoord0;
in mat3 world;
in vec2 texcoord0;
@(ginterpfrag)
void main(void)
{
vec3 diffuse = texture2D(tex0, texcoord0).rgb;
vec3 bump = texture2D(tex1, texcoord0).rgb*2.0-1.0;
vec3 diffuse = texture(tex0, texcoord0).rgb;
vec3 bump = texture(tex1, texcoord0).rgb*2.0-1.0;
vec3 bumpw = normalize(world * bump);
gcolor.rgb = diffuse;
@(gspecpack 0.0 lavaspec)
@ -283,14 +283,14 @@ lazyshader 0 "lava" [
]
lazyshader 0 "waterfallenv" [
attribute vec4 vvertex;
attribute vec3 vnormal;
attribute vec2 vtexcoord0;