summaryrefslogtreecommitdiffstats
path: root/bgfx
diff options
context:
space:
mode:
Diffstat (limited to 'bgfx')
-rw-r--r--bgfx/chains/hlsl.json32
-rw-r--r--bgfx/effects/hlsl/post.json11
-rw-r--r--bgfx/effects/hlsl/scanline.json44
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_post.binbin3737 -> 2411 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_scanline.binbin0 -> 2091 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_scanline.binbin0 -> 577 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_post.binbin3374 -> 2112 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_scanline.binbin0 -> 2024 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_scanline.binbin0 -> 320 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/fs_post.binbin5701 -> 3516 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/fs_scanline.binbin0 -> 3094 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_scanline.binbin0 -> 419 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/fs_post.binbin5417 -> 3333 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/fs_scanline.binbin0 -> 2936 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_scanline.binbin0 -> 377 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_post.binbin6251 -> 4020 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_scanline.binbin0 -> 3503 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_scanline.binbin0 -> 778 bytes
18 files changed, 68 insertions, 19 deletions
diff --git a/bgfx/chains/hlsl.json b/bgfx/chains/hlsl.json
index a3499dc7283..378102444fe 100644
--- a/bgfx/chains/hlsl.json
+++ b/bgfx/chains/hlsl.json
@@ -390,6 +390,29 @@
],
"output": "internal"
},
+ {
+ "effect": "hlsl/scanline",
+ "name": "Scanline Pass",
+ "disablewhen": [
+ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
+ { "type": "slider", "condition": "equal", "combine": "or", "name": "scanline_alpha", "value": 0 }
+ ],
+ "uniforms": [
+ { "uniform": "u_scanline_alpha", "slider": "scanline_alpha" },
+ { "uniform": "u_scanline_scale", "slider": "scanline_scale" },
+ { "uniform": "u_scanline_bright_scale", "slider": "scanline_bright_scale" },
+ { "uniform": "u_scanline_bright_offset", "slider": "scanline_bright_offset" },
+ { "uniform": "u_scanline_height", "slider": "scanline_height" },
+ { "uniform": "u_scanline_variation", "slider": "scanline_variation" },
+ { "uniform": "u_scanline_jitter", "slider": "scanline_jitter_amount" },
+ { "uniform": "u_jitter_amount", "parameter": "jitter" },
+ { "uniform": "u_time", "parameter": "time" }
+ ],
+ "input": [
+ { "sampler": "s_tex", "target": "internal" }
+ ],
+ "output": "internal"
+ },
{ "effect": "hlsl/defocus",
"name": "Defocus Pass",
"disablewhen": [
@@ -440,19 +463,12 @@
"name": "Non-Bloom Post Pass",
"disablewhen": [
{ "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
- { "type": "slider", "condition": "equal", "combine": "and", "name": "scanline_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "shadow_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "humbar_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "floor", "value": [ 0, 0, 0 ] },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "power", "value": [ 0, 0, 0 ] }
],
"uniforms": [
- { "uniform": "u_scanline_alpha", "slider": "scanline_alpha" },
- { "uniform": "u_scanline_scale", "slider": "scanline_scale" },
- { "uniform": "u_scanline_bright_scale", "slider": "scanline_bright_scale" },
- { "uniform": "u_scanline_bright_offset", "slider": "scanline_bright_offset" },
- { "uniform": "u_scanline_height", "slider": "scanline_height" },
- { "uniform": "u_scanline_variation", "slider": "scanline_variation" },
{ "uniform": "u_shadow_tile_mode", "slider": "shadow_tile_mode" },
{ "uniform": "u_shadow_alpha", "slider": "shadow_alpha" },
{ "uniform": "u_shadow_count", "slider": "shadow_uv_count" },
@@ -462,8 +478,6 @@
{ "uniform": "u_humbar_hertz_rate", "slider": "humbar_hertz_rate" },
{ "uniform": "u_floor", "slider": "floor" },
{ "uniform": "u_power", "slider": "power" },
- { "uniform": "u_scanline_jitter", "slider": "scanline_jitter_amount" },
- { "uniform": "u_jitter_amount", "parameter": "jitter" },
{ "uniform": "u_time", "parameter": "time" }
],
"input": [
diff --git a/bgfx/effects/hlsl/post.json b/bgfx/effects/hlsl/post.json
index db08baa4d82..904a27fb336 100644
--- a/bgfx/effects/hlsl/post.json
+++ b/bgfx/effects/hlsl/post.json
@@ -2,7 +2,7 @@
// copyright-holders:Ryan Holtz,ImJezze
//============================================================
//
-// post.json: Scanline, hum-bar, shadow-mask, and final
+// post.json: Hum-bar, shadow-mask, and final
// color convolution shader for CRT simulation.
//
//============================================================
@@ -31,21 +31,12 @@
{ "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
{ "name": "u_target_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
{ "name": "u_target_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_quad_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
{ "name": "u_humbar_hertz_rate", "type": "vec4", "values": [ 0.001, 0.0, 0.0, 0.0 ] },
{ "name": "u_humbar_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
{ "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_shadow_tile_mode", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_bright_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_bright_offset", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_jitter", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_height", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scanline_variation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_shadow_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_shadow_count", "type": "vec4", "values": [ 12.0, 12.0, 0.0, 0.0 ] },
{ "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.25, 0.0, 0.0 ] },
diff --git a/bgfx/effects/hlsl/scanline.json b/bgfx/effects/hlsl/scanline.json
new file mode 100644
index 00000000000..7f4f188c202
--- /dev/null
+++ b/bgfx/effects/hlsl/scanline.json
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz,ImJezze
+//============================================================
+//
+// scanline.json: Scanline shader for CRT simulation.
+//
+//============================================================
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "srcalpha",
+ "dstColor": "1-srcalpha",
+ "srcAlpha": "srcalpha",
+ "dstAlpha": "1-srcalpha"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": true,
+ "alpha": true
+ },
+ "vertex": "chains/hlsl/vs_scanline",
+ "fragment": "chains/hlsl/fs_scanline",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 0.0 ] },
+ { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
+ { "name": "u_target_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
+ { "name": "u_quad_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
+ { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
+ { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_bright_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_bright_offset", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_jitter", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_height", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scanline_variation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
index 913cbd52afa..86f083ae517 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin
new file mode 100644
index 00000000000..e51bfe7350d
--- /dev/null
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin b/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin
new file mode 100644
index 00000000000..d97141ff5f2
--- /dev/null
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
index 4d6c83c7559..499b7d46a1e 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin
new file mode 100644
index 00000000000..00f33632d2b
--- /dev/null
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin
new file mode 100644
index 00000000000..923fba0a293
--- /dev/null
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/fs_post.bin b/bgfx/shaders/essl/chains/hlsl/fs_post.bin
index a2beed2eb7a..cf41b694573 100644
--- a/bgfx/shaders/essl/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/essl/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin b/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin
new file mode 100644
index 00000000000..6d383ca99c5
--- /dev/null
+++ b/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin b/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin
new file mode 100644
index 00000000000..02eb754eaa3
--- /dev/null
+++ b/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin
index 330fd3d7a1e..226bbd57b86 100644
--- a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin b/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin
new file mode 100644
index 00000000000..e9ca861a2a8
--- /dev/null
+++ b/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin b/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin
new file mode 100644
index 00000000000..391ef1fda40
--- /dev/null
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
index 5695a0a7393..a7881efd77d 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
new file mode 100644
index 00000000000..c7e4065d7bf
--- /dev/null
+++ b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin
new file mode 100644
index 00000000000..00695b802d3
--- /dev/null
+++ b/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin
Binary files differ