summaryrefslogtreecommitdiffstats
path: root/src/extras/shaders
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-19 16:23:52 +0100
committeraap <aap@papnet.eu>2020-11-19 16:23:52 +0100
commit02c7f8381b81732645ed92fda0c5a66d0f1db265 (patch)
treed87d414e03af11fdaae5f197378a1906833edbab /src/extras/shaders
parentMerge branch 'master' of github.com:GTAmodding/re3 (diff)
downloadre3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar.gz
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar.bz2
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar.lz
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar.xz
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.tar.zst
re3-02c7f8381b81732645ed92fda0c5a66d0f1db265.zip
Diffstat (limited to 'src/extras/shaders')
-rw-r--r--src/extras/shaders/Makefile13
-rw-r--r--src/extras/shaders/im2d_UV2.vert21
-rw-r--r--src/extras/shaders/im2d_UV2_gl.inc23
-rw-r--r--src/extras/shaders/screenDroplet.frag18
-rw-r--r--src/extras/shaders/screenDroplet_PS.csobin0 -> 324 bytes
-rw-r--r--src/extras/shaders/screenDroplet_PS.hlsl17
-rw-r--r--src/extras/shaders/screenDroplet_PS.inc29
-rw-r--r--src/extras/shaders/screenDroplet_fs_gl.inc20
8 files changed, 140 insertions, 1 deletions
diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile
index 4b6027e2..51e009d6 100644
--- a/src/extras/shaders/Makefile
+++ b/src/extras/shaders/Makefile
@@ -2,7 +2,8 @@ all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \
colourfilterIII_fs_gl.inc contrast_fs_gl.inc \
neoRim_gl.inc neoRimSkin_gl.inc \
neoWorldIII_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \
- neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc
+ neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc \
+ im2d_UV2_gl.inc screenDroplet_fs_gl.inc
im2d_gl.inc: im2d.vert
(echo 'const char *im2d_vert_src =';\
@@ -66,3 +67,13 @@ 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/im2d_UV2.vert b/src/extras/shaders/im2d_UV2.vert
new file mode 100644
index 00000000..e5fd4d08
--- /dev/null
+++ b/src/extras/shaders/im2d_UV2.vert
@@ -0,0 +1,21 @@
+uniform vec4 u_xform;
+
+VSIN(ATTRIB_POS) vec4 in_pos;
+
+VSOUT vec4 v_color;
+VSOUT vec2 v_tex0;
+VSOUT vec2 v_tex1;
+VSOUT float v_fog;
+
+void
+main(void)
+{
+ gl_Position = in_pos;
+ gl_Position.w = 1.0;
+ gl_Position.xy = gl_Position.xy * u_xform.xy + u_xform.zw;
+ v_fog = DoFog(gl_Position.z);
+ gl_Position.xyz *= gl_Position.w;
+ v_color = in_color;
+ v_tex0 = in_tex0;
+ v_tex1 = in_tex1;
+}
diff --git a/src/extras/shaders/im2d_UV2_gl.inc b/src/extras/shaders/im2d_UV2_gl.inc
new file mode 100644
index 00000000..3feb2bc1
--- /dev/null
+++ b/src/extras/shaders/im2d_UV2_gl.inc
@@ -0,0 +1,23 @@
+const char *im2d_UV2_vert_src =
+"uniform vec4 u_xform;\n"
+
+"VSIN(ATTRIB_POS) vec4 in_pos;\n"
+
+"VSOUT vec4 v_color;\n"
+"VSOUT vec2 v_tex0;\n"
+"VSOUT vec2 v_tex1;\n"
+"VSOUT float v_fog;\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+" gl_Position = in_pos;\n"
+" gl_Position.w = 1.0;\n"
+" gl_Position.xy = gl_Position.xy * u_xform.xy + u_xform.zw;\n"
+" v_fog = DoFog(gl_Position.z);\n"
+" gl_Position.xyz *= gl_Position.w;\n"
+" v_color = in_color;\n"
+" v_tex0 = in_tex0;\n"
+" v_tex1 = in_tex1;\n"
+"}\n"
+;
diff --git a/src/extras/shaders/screenDroplet.frag b/src/extras/shaders/screenDroplet.frag
new file mode 100644
index 00000000..84d30bd5
--- /dev/null
+++ b/src/extras/shaders/screenDroplet.frag
@@ -0,0 +1,18 @@
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+FSIN vec4 v_color;
+FSIN vec2 v_tex0;
+FSIN vec2 v_tex1;
+FSIN float v_fog;
+
+void
+main(void)
+{
+ vec4 color;
+ color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));
+ color *= texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));
+
+ FRAGCOLOR(color);
+}
+
diff --git a/src/extras/shaders/screenDroplet_PS.cso b/src/extras/shaders/screenDroplet_PS.cso
new file mode 100644
index 00000000..5508096b
--- /dev/null
+++ b/src/extras/shaders/screenDroplet_PS.cso
Binary files differ
diff --git a/src/extras/shaders/screenDroplet_PS.hlsl b/src/extras/shaders/screenDroplet_PS.hlsl
new file mode 100644
index 00000000..4d41da68
--- /dev/null
+++ b/src/extras/shaders/screenDroplet_PS.hlsl
@@ -0,0 +1,17 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float2 TexCoord0 : TEXCOORD0;
+ float2 TexCoord1 : TEXCOORD1;
+ float4 Color : COLOR0;
+};
+
+sampler2D tex0 : register(s0);
+sampler2D tex1 : register(s1);
+
+float4 main(VS_out input) : COLOR
+{
+ float4 color = input.Color;
+ color *= tex2D(tex0, input.TexCoord0.xy);
+ color *= tex2D(tex1, input.TexCoord1.xy);
+ return color;
+}
diff --git a/src/extras/shaders/screenDroplet_PS.inc b/src/extras/shaders/screenDroplet_PS.inc
new file mode 100644
index 00000000..c2055188
--- /dev/null
+++ b/src/extras/shaders/screenDroplet_PS.inc
@@ -0,0 +1,29 @@
+static unsigned char screenDroplet_PS_cso[] = {
+ 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42,
+ 0x1c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x74, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00,
+ 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x30,
+ 0x00, 0xab, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x31,
+ 0x00, 0xab, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x32,
+ 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
+ 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68,
+ 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,
+ 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33,
+ 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x01, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x00, 0x08, 0x0f, 0xa0, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90,
+ 0x01, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0, 0x42, 0x00, 0x00, 0x03,
+ 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xb0, 0x01, 0x08, 0xe4, 0xa0,
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80,
+ 0x00, 0x00, 0xe4, 0x90, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80,
+ 0x01, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02,
+ 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00
+};
diff --git a/src/extras/shaders/screenDroplet_fs_gl.inc b/src/extras/shaders/screenDroplet_fs_gl.inc
new file mode 100644
index 00000000..dd393b02
--- /dev/null
+++ b/src/extras/shaders/screenDroplet_fs_gl.inc
@@ -0,0 +1,20 @@
+const char *screenDroplet_frag_src =
+"uniform sampler2D tex0;\n"
+"uniform sampler2D tex1;\n"
+
+"FSIN vec4 v_color;\n"
+"FSIN vec2 v_tex0;\n"
+"FSIN vec2 v_tex1;\n"
+"FSIN float v_fog;\n"
+
+"void\n"
+"main(void)\n"
+"{\n"
+" vec4 color;\n"
+" color = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n"
+" color *= texture(tex1, vec2(v_tex1.x, 1.0-v_tex1.y));\n"
+
+" FRAGCOLOR(color);\n"
+"}\n"
+
+;