diff --git a/bgfx/chains/pillarbox_left_horizontal.json b/bgfx/chains/pillarbox_left_horizontal.json index 4f608756e5b..bb0664330f0 100644 --- a/bgfx/chains/pillarbox_left_horizontal.json +++ b/bgfx/chains/pillarbox_left_horizontal.json @@ -79,7 +79,7 @@ "output": "internal" }, { - "effect": "misc/saturation", + "effect": "pillarbox_left_horizontal/offset_sat", "name": "Saturation Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "name": "saturation", "value": 100 } diff --git a/bgfx/chains/pillarbox_left_vertical.json b/bgfx/chains/pillarbox_left_vertical.json index 10b6dc86f29..9132b77eefa 100644 --- a/bgfx/chains/pillarbox_left_vertical.json +++ b/bgfx/chains/pillarbox_left_vertical.json @@ -79,7 +79,7 @@ "output": "internal" }, { - "effect": "misc/saturation", + "effect": "pillarbox_left_vertical/offset_sat", "name": "Saturation Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "name": "saturation", "value": 100 } diff --git a/bgfx/chains/pillarbox_right_horizontal.json b/bgfx/chains/pillarbox_right_horizontal.json index 78368b23b06..1b4798e6b18 100644 --- a/bgfx/chains/pillarbox_right_horizontal.json +++ b/bgfx/chains/pillarbox_right_horizontal.json @@ -79,7 +79,7 @@ "output": "internal" }, { - "effect": "misc/saturation", + "effect": "pillarbox_right_horizontal/offset_sat", "name": "Saturation Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "name": "saturation", "value": 100 } diff --git a/bgfx/chains/pillarbox_right_vertical.json b/bgfx/chains/pillarbox_right_vertical.json index 9c29e546c58..1dcc15c5d29 100644 --- a/bgfx/chains/pillarbox_right_vertical.json +++ b/bgfx/chains/pillarbox_right_vertical.json @@ -79,7 +79,7 @@ "output": "internal" }, { - "effect": "misc/saturation", + "effect": "pillarbox_right_vertical/offset_sat", "name": "Saturation Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "name": "saturation", "value": 100 } diff --git a/bgfx/effects/pillarbox_left_horizontal/offset_sat.json b/bgfx/effects/pillarbox_left_horizontal/offset_sat.json new file mode 100644 index 00000000000..b68e91cb8bc --- /dev/null +++ b/bgfx/effects/pillarbox_left_horizontal/offset_sat.json @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// offset_sat.json: Applies saturation to an image. +// +// Additionally, takes only a portion of the image, as +// this instance is intended for the left-hand pillarbox +// when displaying 4:3 content on a 16:9 screen. +// +//============================================================ +{ + "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/pillarbox_left_horizontal/vs_offset_sat", + "fragment": "chains/pillarbox_left_horizontal/fs_offset_sat", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/pillarbox_left_vertical/offset_sat.json b/bgfx/effects/pillarbox_left_vertical/offset_sat.json new file mode 100644 index 00000000000..521bcc88064 --- /dev/null +++ b/bgfx/effects/pillarbox_left_vertical/offset_sat.json @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// offset_sat.json: Applies saturation to an image. +// +// Additionally, takes only a portion of the image, as +// this instance is intended for the left-hand pillarbox +// when displaying 3:4 content on a 16:9 screen. +// +//============================================================ +{ + "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/pillarbox_left_vertical/vs_offset_sat", + "fragment": "chains/pillarbox_left_vertical/fs_offset_sat", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/pillarbox_right_horizontal/offset_sat.json b/bgfx/effects/pillarbox_right_horizontal/offset_sat.json new file mode 100644 index 00000000000..019161b2cd8 --- /dev/null +++ b/bgfx/effects/pillarbox_right_horizontal/offset_sat.json @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// offset_sat.json: Applies saturation to an image. +// +// Additionally, takes only a portion of the image, as +// this instance is intended for the right-hand pillarbox +// when displaying 4:3 content on a 16:9 screen. +// +//============================================================ +{ + "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/pillarbox_right_horizontal/vs_offset_sat", + "fragment": "chains/pillarbox_right_horizontal/fs_offset_sat", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/pillarbox_right_vertical/offset_sat.json b/bgfx/effects/pillarbox_right_vertical/offset_sat.json new file mode 100644 index 00000000000..66fab42c3e9 --- /dev/null +++ b/bgfx/effects/pillarbox_right_vertical/offset_sat.json @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// offset_sat.json: Applies saturation to an image. +// +// Additionally, takes only a portion of the image, as +// this instance is intended for the right-hand pillarbox +// when displaying 3:4 content on a 16:9 screen. +// +//============================================================ +{ + "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/pillarbox_right_vertical/vs_offset_sat", + "fragment": "chains/pillarbox_right_vertical/fs_offset_sat", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/shaders/dx11/chains/misc/vs_saturation.bin b/bgfx/shaders/dx11/chains/misc/vs_saturation.bin index 7a3bdff1a98..b0bebf9da4c 100644 Binary files a/bgfx/shaders/dx11/chains/misc/vs_saturation.bin and b/bgfx/shaders/dx11/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..eaec59b81d7 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..8d21d98385a Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_left_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..eaec59b81d7 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_left_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_left_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..7a3bdff1a98 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..eaec59b81d7 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..cde2b1546aa Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_right_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..eaec59b81d7 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_right_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx11/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/dx11/chains/pillarbox_right_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..ce4ae1dd5c7 Binary files /dev/null and b/bgfx/shaders/dx11/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_saturation.bin b/bgfx/shaders/dx9/chains/misc/vs_saturation.bin index 0b92c5f50bc..ea94c83e62d 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_saturation.bin and b/bgfx/shaders/dx9/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..5fe87a15fb5 Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..b9b18b7ac1a Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..5fe87a15fb5 Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..0b92c5f50bc Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..5fe87a15fb5 Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..e9bfb3062de Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..5fe87a15fb5 Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..55774bb38ab Binary files /dev/null and b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/misc/vs_saturation.bin b/bgfx/shaders/gles/chains/misc/vs_saturation.bin index dbce619ef26..9dd618de8a0 100644 Binary files a/bgfx/shaders/gles/chains/misc/vs_saturation.bin and b/bgfx/shaders/gles/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_left_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..2f6160fe747 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_left_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_left_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..42326d4324e Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_left_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..2f6160fe747 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_left_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_left_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..dbce619ef26 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_right_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..2f6160fe747 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_right_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_right_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..1e806909f59 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_right_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..2f6160fe747 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_right_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/gles/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/gles/chains/pillarbox_right_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..c0f4dfa5a88 Binary files /dev/null and b/bgfx/shaders/gles/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/misc/vs_saturation.bin b/bgfx/shaders/glsl/chains/misc/vs_saturation.bin index de0d4115e79..af6c9349f41 100644 Binary files a/bgfx/shaders/glsl/chains/misc/vs_saturation.bin and b/bgfx/shaders/glsl/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..4a3f80b56b9 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..061d861b6ed Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..4a3f80b56b9 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..de0d4115e79 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..4a3f80b56b9 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..c25635af5a8 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..4a3f80b56b9 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..3b5a651f2e7 Binary files /dev/null and b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/misc/vs_saturation.bin b/bgfx/shaders/metal/chains/misc/vs_saturation.bin index f9567cc2d50..122b7dee5c3 100644 Binary files a/bgfx/shaders/metal/chains/misc/vs_saturation.bin and b/bgfx/shaders/metal/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..de6ec5972af Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..79234729f36 Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..de6ec5972af Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..f9567cc2d50 Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_offset_sat.bin new file mode 100644 index 00000000000..de6ec5972af Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin new file mode 100644 index 00000000000..efd3de32003 Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_offset_sat.bin new file mode 100644 index 00000000000..de6ec5972af Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_offset_sat.bin differ diff --git a/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin new file mode 100644 index 00000000000..5fdb790c191 Binary files /dev/null and b/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp index b056037aba9..4ba069d18a4 100644 --- a/src/osd/modules/render/bgfx/chain.cpp +++ b/src/osd/modules/render/bgfx/chain.cpp @@ -76,7 +76,6 @@ void bgfx_chain::process(render_primitive* prim, int view, int screen, texture_m { screen_device_iterator screen_iterator(window.machine().root_device()); screen_device* screen_device = screen_iterator.byindex(screen); - render_container &screen_container = screen_device->container(); int current_view = view; uint16_t screen_width(floor((prim->bounds.x1 - prim->bounds.x0) + 0.5f)); @@ -88,10 +87,19 @@ void bgfx_chain::process(render_primitive* prim, int view, int screen, texture_m bool orientation_swap_xy = (window.machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; bool rotation_swap_xy = (window.target()->orientation() & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; bool swap_xy = orientation_swap_xy ^ rotation_swap_xy; - float screen_scale_x = 1.0f / screen_container.xscale(); - float screen_scale_y = 1.0f / screen_container.yscale(); - float screen_offset_x = -screen_container.xoffset(); - float screen_offset_y = -screen_container.yoffset(); + + float screen_scale_x = 1.0f; + float screen_scale_y = 1.0f; + float screen_offset_x = 0.0f; + float screen_offset_y = 0.0f; + if (screen_device != nullptr) + { + render_container &screen_container = screen_device->container(); + screen_scale_x = 1.0f / screen_container.xscale(); + screen_scale_y = 1.0f / screen_container.yscale(); + screen_offset_x = -screen_container.xoffset(); + screen_offset_y = -screen_container.yoffset(); + } for (bgfx_chain_entry* entry : m_entries) { diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp index a5964afc502..0b1316280d4 100644 --- a/src/osd/modules/render/bgfx/chainmanager.cpp +++ b/src/osd/modules/render/bgfx/chainmanager.cpp @@ -448,8 +448,10 @@ uint32_t chain_manager::handle_screen_chains(uint32_t view, render_primitive *st } const bool any_targets_rebuilt = m_targets.update_target_sizes(screen_index, screen_width, screen_height, TARGET_STYLE_NATIVE); - if (any_targets_rebuilt) { - for (bgfx_chain* chain : m_screen_chains) { + if (any_targets_rebuilt) + { + for (bgfx_chain* chain : m_screen_chains) + { chain->repopulate_targets(); } } diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc index fc524496a1f..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc @@ -9,6 +9,6 @@ $output v_texcoord0, v_color0 void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.1); + v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_offset_sat.sc new file mode 100644 index 00000000000..c14f61601c8 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_offset_sat.sc @@ -0,0 +1,25 @@ +$input v_color0, v_texcoord0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +#include "common.sh" + +// User-supplied +uniform vec4 u_saturation; + +// Samplers +SAMPLER2D(s_tex, 0); + +void main() +{ + vec4 base = texture2D(s_tex, v_texcoord0); + vec3 rgb = base.rgb; + + vec3 gray = vec3(0.299, 0.587, 0.114); + float luma = dot(rgb, gray); + vec3 chroma = rgb - luma; + vec3 saturated = luma + chroma * u_saturation.x; + + gl_FragColor = vec4(saturated, base.a); +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc new file mode 100644 index 00000000000..f071beaaa26 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc @@ -0,0 +1,17 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +// Vertex shader for the left-hand pillarbox when displaying 4:3 content on a 16:9 screen. +// Crops off roughly 10% on all borders and takes only a portion of the right-hand side of the content + +#include "common.sh" + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.1, 0.1); + v_color0 = a_color0; +} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_offset_sat.sc new file mode 100644 index 00000000000..c14f61601c8 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_offset_sat.sc @@ -0,0 +1,25 @@ +$input v_color0, v_texcoord0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +#include "common.sh" + +// User-supplied +uniform vec4 u_saturation; + +// Samplers +SAMPLER2D(s_tex, 0); + +void main() +{ + vec4 base = texture2D(s_tex, v_texcoord0); + vec3 rgb = base.rgb; + + vec3 gray = vec3(0.299, 0.587, 0.114); + float luma = dot(rgb, gray); + vec3 chroma = rgb - luma; + vec3 saturated = luma + chroma * u_saturation.x; + + gl_FragColor = vec4(saturated, base.a); +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc new file mode 100644 index 00000000000..a9f6649c1e5 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc @@ -0,0 +1,17 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +// Vertex shader for the left-hand pillarbox when displaying 3:4 content on a 16:9 screen. +// Crops off roughly 10% on all borders and takes only a portion of the right-hand side of the content + +#include "common.sh" + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.1); + v_color0 = a_color0; +} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_offset_sat.sc new file mode 100644 index 00000000000..c14f61601c8 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_offset_sat.sc @@ -0,0 +1,25 @@ +$input v_color0, v_texcoord0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +#include "common.sh" + +// User-supplied +uniform vec4 u_saturation; + +// Samplers +SAMPLER2D(s_tex, 0); + +void main() +{ + vec4 base = texture2D(s_tex, v_texcoord0); + vec3 rgb = base.rgb; + + vec3 gray = vec3(0.299, 0.587, 0.114); + float luma = dot(rgb, gray); + vec3 chroma = rgb - luma; + vec3 saturated = luma + chroma * u_saturation.x; + + gl_FragColor = vec4(saturated, base.a); +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc new file mode 100644 index 00000000000..a473bc4123c --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc @@ -0,0 +1,17 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +// Vertex shader for the right-hand pillarbox when displaying 4:3 content on a 16:9 screen. +// Crops off roughly 10% on all borders and takes only a portion of the right-hand side of the content + +#include "common.sh" + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.9 - 0.16666666 * 0.9, 0.1); + v_color0 = a_color0; +} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_offset_sat.sc new file mode 100644 index 00000000000..c14f61601c8 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_offset_sat.sc @@ -0,0 +1,25 @@ +$input v_color0, v_texcoord0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +#include "common.sh" + +// User-supplied +uniform vec4 u_saturation; + +// Samplers +SAMPLER2D(s_tex, 0); + +void main() +{ + vec4 base = texture2D(s_tex, v_texcoord0); + vec3 rgb = base.rgb; + + vec3 gray = vec3(0.299, 0.587, 0.114); + float luma = dot(rgb, gray); + vec3 chroma = rgb - luma; + vec3 saturated = luma + chroma * u_saturation.x; + + gl_FragColor = vec4(saturated, base.a); +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc new file mode 100644 index 00000000000..8af6a293d8e --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc @@ -0,0 +1,17 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +// Vertex shader for the right-hand pillarbox when displaying 3:4 content on a 16:9 screen. +// Crops off roughly 10% on all borders and takes only a portion of the right-hand side of the content + +#include "common.sh" + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.9 - 0.685185 * 0.9); + v_color0 = a_color0; +} \ No newline at end of file