summaryrefslogtreecommitdiffstatshomepage
path: root/bgfx/effects/hlsl
diff options
context:
space:
mode:
author W. M. Martinez <anikom15@gmail.com>2018-09-14 19:00:52 -0700
committer W. M. Martinez <anikom15@gmail.com>2018-09-14 19:00:52 -0700
commitb4888aabc09a9a83ee2ae0e7e5a84d1a3a8bf2c6 (patch)
tree34ed95134e3eef5d387a97447c84b92929f4cc75 /bgfx/effects/hlsl
parente04d8520348ad845675539c08e10a1a628f6fb1a (diff)
Port scanline modification to BGFX
Diffstat (limited to 'bgfx/effects/hlsl')
-rw-r--r--bgfx/effects/hlsl/post.json11
-rw-r--r--bgfx/effects/hlsl/scanline.json44
2 files changed, 45 insertions, 10 deletions
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