From c0b118271258cae30a9eaff517e91c1d8c96231e Mon Sep 17 00:00:00 2001 From: "therealmogminer@gmail.com" Date: Mon, 28 Mar 2016 22:58:16 +0200 Subject: Final bgfx fixups for release --- bgfx/chains/default.json | 4 +- bgfx/chains/hlsl.json | 62 +++++++++--------- bgfx/chains/unfiltered.json | 4 +- bgfx/effects/blit.json | 121 ----------------------------------- bgfx/effects/color.json | 35 ---------- bgfx/effects/deconverge.json | 37 ----------- bgfx/effects/default/LICENSE | 27 ++++++++ bgfx/effects/default/README.md | 5 ++ bgfx/effects/default/blit.json | 121 +++++++++++++++++++++++++++++++++++ bgfx/effects/defocus.json | 31 --------- bgfx/effects/distortion.json | 40 ------------ bgfx/effects/hlsl/LICENSE | 27 ++++++++ bgfx/effects/hlsl/README.md | 5 ++ bgfx/effects/hlsl/blit.json | 121 +++++++++++++++++++++++++++++++++++ bgfx/effects/hlsl/color.json | 35 ++++++++++ bgfx/effects/hlsl/deconverge.json | 37 +++++++++++ bgfx/effects/hlsl/defocus.json | 31 +++++++++ bgfx/effects/hlsl/distortion.json | 40 ++++++++++++ bgfx/effects/hlsl/ntsc_decode.json | 42 ++++++++++++ bgfx/effects/hlsl/ntsc_encode.json | 38 +++++++++++ bgfx/effects/hlsl/phosphor.json | 33 ++++++++++ bgfx/effects/hlsl/post.json | 53 +++++++++++++++ bgfx/effects/hlsl/prescale.json | 32 +++++++++ bgfx/effects/ntsc_decode.json | 42 ------------ bgfx/effects/ntsc_encode.json | 38 ----------- bgfx/effects/phosphor.json | 33 ---------- bgfx/effects/post.json | 56 ---------------- bgfx/effects/prescale.json | 32 --------- bgfx/effects/unfiltered/LICENSE | 27 ++++++++ bgfx/effects/unfiltered/README.md | 5 ++ bgfx/effects/unfiltered/blit.json | 121 +++++++++++++++++++++++++++++++++++ bgfx/shaders/dx11/fs_blit.bin | Bin 42904 -> 42904 bytes bgfx/shaders/dx11/fs_color.bin | Bin 45305 -> 45305 bytes bgfx/shaders/dx11/fs_deconverge.bin | Bin 43108 -> 43108 bytes bgfx/shaders/dx11/fs_defocus.bin | Bin 49898 -> 49898 bytes bgfx/shaders/dx11/fs_distortion.bin | Bin 60482 -> 60482 bytes bgfx/shaders/dx11/fs_gui.bin | Bin 42904 -> 42904 bytes bgfx/shaders/dx11/fs_ntsc_decode.bin | Bin 60967 -> 60967 bytes bgfx/shaders/dx11/fs_ntsc_encode.bin | Bin 50379 -> 50379 bytes bgfx/shaders/dx11/fs_phosphor.bin | Bin 45190 -> 45190 bytes bgfx/shaders/dx11/fs_post.bin | Bin 58147 -> 57706 bytes bgfx/shaders/dx11/fs_prescale.bin | Bin 45438 -> 45438 bytes bgfx/shaders/dx11/fs_screen.bin | Bin 42904 -> 42904 bytes bgfx/shaders/dx11/vs_blit.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_color.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_deconverge.bin | Bin 45836 -> 45836 bytes bgfx/shaders/dx11/vs_defocus.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_distortion.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_gui.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_ntsc_decode.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_ntsc_encode.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_phosphor.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_post.bin | Bin 43264 -> 43223 bytes bgfx/shaders/dx11/vs_prescale.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx11/vs_screen.bin | Bin 43083 -> 43083 bytes bgfx/shaders/dx9/fs_post.bin | Bin 5228 -> 4835 bytes bgfx/shaders/dx9/vs_post.bin | Bin 1171 -> 1142 bytes bgfx/shaders/gles/fs_post.bin | Bin 4212 -> 3805 bytes bgfx/shaders/gles/vs_post.bin | Bin 750 -> 629 bytes bgfx/shaders/glsl/fs_post.bin | Bin 4012 -> 3603 bytes bgfx/shaders/glsl/vs_post.bin | Bin 684 -> 569 bytes bgfx/shaders/metal/fs_post.bin | Bin 4823 -> 4384 bytes bgfx/shaders/metal/vs_post.bin | Bin 1048 -> 925 bytes 63 files changed, 835 insertions(+), 500 deletions(-) delete mode 100644 bgfx/effects/blit.json delete mode 100644 bgfx/effects/color.json delete mode 100644 bgfx/effects/deconverge.json create mode 100644 bgfx/effects/default/LICENSE create mode 100644 bgfx/effects/default/README.md create mode 100644 bgfx/effects/default/blit.json delete mode 100644 bgfx/effects/defocus.json delete mode 100644 bgfx/effects/distortion.json create mode 100644 bgfx/effects/hlsl/LICENSE create mode 100644 bgfx/effects/hlsl/README.md create mode 100644 bgfx/effects/hlsl/blit.json create mode 100644 bgfx/effects/hlsl/color.json create mode 100644 bgfx/effects/hlsl/deconverge.json create mode 100644 bgfx/effects/hlsl/defocus.json create mode 100644 bgfx/effects/hlsl/distortion.json create mode 100644 bgfx/effects/hlsl/ntsc_decode.json create mode 100644 bgfx/effects/hlsl/ntsc_encode.json create mode 100644 bgfx/effects/hlsl/phosphor.json create mode 100644 bgfx/effects/hlsl/post.json create mode 100644 bgfx/effects/hlsl/prescale.json delete mode 100644 bgfx/effects/ntsc_decode.json delete mode 100644 bgfx/effects/ntsc_encode.json delete mode 100644 bgfx/effects/phosphor.json delete mode 100644 bgfx/effects/post.json delete mode 100644 bgfx/effects/prescale.json create mode 100644 bgfx/effects/unfiltered/LICENSE create mode 100644 bgfx/effects/unfiltered/README.md create mode 100644 bgfx/effects/unfiltered/blit.json (limited to 'bgfx') diff --git a/bgfx/chains/default.json b/bgfx/chains/default.json index 9888b590727..1142275e528 100644 --- a/bgfx/chains/default.json +++ b/bgfx/chains/default.json @@ -7,14 +7,14 @@ } ], "passes": [ - { "effect": "blit", + { "effect": "default\blit", "name": "Copy To Unstretched Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } ], "output": "temp" }, - { "effect": "blit", + { "effect": "default\blit", "name": "Final Upscale", "input": [ { "sampler": "s_tex", "target": "temp" } diff --git a/bgfx/chains/hlsl.json b/bgfx/chains/hlsl.json index 17757bb8c38..3353f92018a 100644 --- a/bgfx/chains/hlsl.json +++ b/bgfx/chains/hlsl.json @@ -88,27 +88,27 @@ { "type": "color", "name": "phosphor", "text": "Phosphor Persistence, ", "default": [ 55, 55, 55 ], "max": [ 100, 100, 100 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_alpha", "text": "Scanline Amount", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_scale", "text": "Overall Scanline Scale", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_bright_scale", "text": "Scanline Brightness Scale", "default": 200, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_bright_offset", "text": "Scanline Brightness Offset", "default": 0, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_jitter_amount", "text": "Scanline Jitter Amount", "default": 0, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_height", "text": "Individual Scanline Scale", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "scanline_variation", "text": "Scanline Variation", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "shadow_alpha", "text": "Shadow Mask Amount", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "vec2", "name": "shadow_uv_size", "text": "Shadow Mask UV Size ", "default": [ 250, 333 ], "max": [ 1000, 1000 ], "min": [ 0, 0 ], "step": 1, "scale": 0.001, "format": "%1.4f", "screen": "crt" }, - { "type": "vec2", "name": "shadow_uv_offset", "text": "Shadow Mask UV Offset ", "default": [ 0, 0 ], "max": [ 1000, 1000 ], "min": [ 0, 0 ], "step": 1, "scale": 0.001, "format": "%1.4f", "screen": "crt" }, - { "type": "intenum", "name": "shadow_tile_mode", "text": "Shadow Mask Tile Mode", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "crt", "strings": [ "Screen", "Source" ] }, - { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 5, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "humbar_hertz_rate", "text": "Hum Bar Frequency", "default": 100, "max": 10000, "min": 0, "step": 1, "scale": 0.00001, "format": "%1.7f", "screen": "crt" }, - { "type": "color", "name": "floor", "text": "Signal Floor, ", "default": [ 5, 5, 5 ], "max": [ 100, 100, 100 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "color", "name": "power", "text": "Signal Exponent, ", "default": [ 100, 100, 100 ], "max": [ 400, 400, 400 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_alpha", "text": "Scanline Amount", "default": 40, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_scale", "text": "Overall Scanline Scale", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_bright_scale", "text": "Scanline Brightness Scale", "default": 200, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_bright_offset", "text": "Scanline Brightness Offset", "default": 0, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_jitter_amount", "text": "Scanline Jitter Amount", "default": 0, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_height", "text": "Individual Scanline Scale", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_variation", "text": "Scanline Variation", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "shadow_alpha", "text": "Shadow Mask Amount", "default": 20, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "vec2", "name": "shadow_uv_count", "text": "Shadow Mask Pixel Count ", "default": [ 12, 12 ], "max": [ 128, 128 ], "min": [ 1, 1 ], "step": 1, "scale": 1.0, "format": "%3f", "screen": "crt" }, + { "type": "vec2", "name": "shadow_uv_size", "text": "Shadow Mask UV Size ", "default": [ 500, 500 ], "max": [ 1000, 1000 ], "min": [ 0, 0 ], "step": 1, "scale": 0.001, "format": "%1.4f", "screen": "crt" }, + { "type": "vec2", "name": "shadow_uv_offset", "text": "Shadow Mask UV Offset ", "default": [ 0, 0 ], "max": [ 1000, 1000 ], "min": [ 0, 0 ], "step": 1, "scale": 0.001, "format": "%1.4f", "screen": "crt" }, + { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "humbar_hertz_rate", "text": "Hum Bar Frequency", "default": 100, "max": 10000, "min": 0, "step": 1, "scale": 0.00001, "format": "%1.7f", "screen": "crt" }, + { "type": "color", "name": "floor", "text": "Signal Floor, ", "default": [ 5, 5, 5 ], "max": [ 100, 100, 100 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "color", "name": "power", "text": "Signal Exponent, ", "default": [ 80, 80, 80 ], "max": [ 400, 400, 400 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "curvature", "text": "Screen Curvature Amount", "default": 25, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "curvature", "text": "Screen Curvature Amount", "default": 20, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, { "type": "float", "name": "round_corner", "text": "Rounded Corner Amount", "default": 15, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, { "type": "float", "name": "smooth_border", "text": "Smooth Border Amount", "default": 5, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, { "type": "float", "name": "vignetting", "text": "Vignetting Amount", "default": 20, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, - { "type": "float", "name": "reflection", "text": "Reflection Amount", "default": 25, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" } + { "type": "float", "name": "reflection", "text": "Reflection Amount", "default": 15, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" } ], // parameters (optional): A list of procedurally-generated parameters that can be bound to entry uniforms. @@ -172,7 +172,7 @@ { // effect (required): The name of the effect JSON file to load for this pass. // value: Any valid JSON filename included in your shader chain, without the extension. - "effect": "ntsc_encode", + "effect": "hlsl/ntsc_encode", // name (required): A verbal name for the effect. It is only used internally, but is required nonetheless. // value: Any valid ASCII string. @@ -254,7 +254,7 @@ // value: Any valid ASCII string that names a target. "output": "guest" }, - { "effect": "ntsc_decode", + { "effect": "hlsl/ntsc_decode", "name": "NTSC Decode", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -278,7 +278,7 @@ ], "output": "guest" }, - { "effect": "blit", + { "effect": "hlsl/blit", "name": "NTSC Skip", "disablewhen": [ { "type": "slider", "condition": "notequal", "combine": "and", "name": "adjustments", "value": 0 }, @@ -289,7 +289,7 @@ ], "output": "guest" }, - { "effect": "color", + { "effect": "hlsl/color", "name": "Color Convolution", "disablewhen": [ { "type": "slider", "condition": "equal", "name": "adjustments", "value": 0 } @@ -307,14 +307,14 @@ ], "output": "guest" }, - { "effect": "prescale", + { "effect": "hlsl/prescale", "name": "Prescale", "input": [ { "sampler": "s_tex", "target": "guest" } ], "output": "internal" }, - { "effect": "deconverge", + { "effect": "hlsl/deconverge", "name": "Deconvergence", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -338,7 +338,7 @@ ], "output": "internal" }, - { "effect": "defocus", + { "effect": "hlsl/defocus", "name": "Defocus Pass 1", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -352,7 +352,7 @@ ], "output": "internal" }, - { "effect": "defocus", + { "effect": "hlsl/defocus", "name": "Defocus Pass 2", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -366,7 +366,7 @@ ], "output": "internal" }, - { "effect": "phosphor", + { "effect": "hlsl/phosphor", "name": "Phosphor Decay", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -382,7 +382,7 @@ ], "output": "internal" }, - { "effect": "phosphor", + { "effect": "hlsl/phosphor", "name": "Phosphor Store", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -398,7 +398,7 @@ ], "output": "previous" }, - { "effect": "post", + { "effect": "hlsl/post", "name": "Non-Bloom Post Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -416,9 +416,9 @@ { "uniform": "u_scanline_height", "slider": "scanline_height" }, { "uniform": "u_scanline_variation", "slider": "scanline_variation" }, { "uniform": "u_shadow_alpha", "slider": "shadow_alpha" }, + { "uniform": "u_shadow_count", "slider": "shadow_uv_count" }, { "uniform": "u_shadow_uv", "slider": "shadow_uv_size" }, { "uniform": "u_shadow_uv_offset", "slider": "shadow_uv_offset" }, - { "uniform": "u_shadow_tile_mode", "slider": "shadow_tile_mode" }, { "uniform": "u_humbar_alpha", "slider": "humbar_alpha" }, { "uniform": "u_humbar_hertz_rate", "slider": "humbar_hertz_rate" }, { "uniform": "u_floor", "slider": "floor" }, @@ -433,7 +433,7 @@ ], "output": "internal" }, - { "effect": "distortion", + { "effect": "hlsl/distortion", "name": "Distortion Pass", "disablewhen": [ { "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 }, @@ -455,7 +455,7 @@ ], "output": "internal" }, - { "effect": "blit", + { "effect": "hlsl/blit", "name": "Final Blit", "input": [ { "sampler": "s_tex", "target": "internal" } diff --git a/bgfx/chains/unfiltered.json b/bgfx/chains/unfiltered.json index ac9556a1a41..19d74cd5eec 100644 --- a/bgfx/chains/unfiltered.json +++ b/bgfx/chains/unfiltered.json @@ -7,14 +7,14 @@ } ], "passes": [ - { "effect": "blit", + { "effect": "unfiltered\blit", "name": "Copy To Unstretched Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } ], "output": "temp" }, - { "effect": "blit", + { "effect": "unfiltered\blit", "name": "Final Upscale", "input": [ { "sampler": "s_tex", "target": "temp" } diff --git a/bgfx/effects/blit.json b/bgfx/effects/blit.json deleted file mode 100644 index bbc9fd295d4..00000000000 --- a/bgfx/effects/blit.json +++ /dev/null @@ -1,121 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -//============================================================ -// -// blit.json: A simple texture-to-target copy. -// -//============================================================ -{ - // blend (required): The blend state for this effect. - "blend": { - // equation (optional): What equation to perform on the source and destination blend values. - // values: "add", "sub", "revSub", "min", "max" - // default: "add" - // - // "subtract" and "revSubtract" are provided as aliases for "sub" and "revSub" - "equation": "add", - - // blend function parameters (optional): What factors to use in the blend function when calculating the final pixel. - // values: "0", "1", "srcColor", "1-srcColor", "dstColor", "1-dstColor", "srcAlpha", "1-srcAlpha", "dstAlpha", "1-dstAlpha" - // defaults (srcColor, srcAlpha): "1" - // defaults (dstColor, dstAlpha): "0" - // - // "zero", "one", "invSrcColor", "invDstColor", "invSrcAlpha", and "invDstAlpha" are provided as aliases for "0", "1", "1-srcColor", "1-dstColor", "1-srcAlpha", and "1-dstAlpha" - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - - // depth (required): The depth state for this effect. - "depth": { - // function (optional): The depth function to use when drawing. - // values: "never", "less", "equal", "lequal", "greater", "notequal", "gequal", "always" - // default: "always" - "function": "always", - - // writeenable (optional): Whether to store Z-buffer data. - // values: true, false - // default: false - "writeenable": false - }, - - // cull (required): The cull mode for this effect. - "cull": { - // mode (optional): What winding, if any, to cull. - // values: "none", "cw", "ccw" - // default: "ccw" - // - // "clockwise" and "counterclockwise" are provided as aliases for "cw" and "ccw" - "mode": "none" - }, - - // write (required): Write enable for color and alpha channels. - "write": { - // rgb (optional): Whether to store color data when drawing. - // values: true, false - // default: false - "rgb": true, - - // alpha (optional): Whether to store alpha data when drawing. - // values: true, false - // default: false - "alpha": true - }, - - // vertex (required): The vertex shader to use when drawing. - // value: A string containing the name of a shader file to use, minus the extension. - "vertex": "vs_blit", - - // pixel/fragment (required): The pixel or fragment shader to use when drawing. - // value: A string containing the name of a shader file to use, minus the extension. - "fragment": "fs_blit", - - // uniforms (required): The list of uniforms for this effect. Can be empty, but must exist. - "uniforms": [ - { - // name (required): The name of the uniform, as used in either the vertex or pixel/fragment shader. - // value: A string containing the name of the uniform as described above. - // - // NOTE: Some names correspond to special values that will be automatically filled by the BGFX - // code if they are used by the shader. These names are: - // "u_screen_dims" - // The dimensions of the first texture input if present, otherwise the dimensions of the output window. - // Valid values: xy - // "u_inv_screen_dims" - // The reciprocal of u_screen_dims. - // Valid values: xy - // "u_source_dims" - // The size, in pixels, of the screen texture incoming to the chain. - // Valid values: xy - // "u_rotation_type" - // This screen's rotation type. 0 if ROT0, 1 if ROT90, 2 if ROT180, 3 of ROT270. - // Valid values: x - // "u_swap_xy" - // Whether this screen is swapped on the X and Y axes. 1 if true, 0 if false. - // Valid values: x - // "u_quad_dims" - // The dimensions, in pixels, occupied by this one screen primitive itself in the output window. - // Valid values: xy - // "u_tex_sizeN" - // The dimensions, in pixels, of the texture in input pair N. Starts at 0. - // valid values: xy - "name": "s_tex", - - // type (required): The type of the uniform. - // values: "int", "vec4", "mat3", "mat4" - // - // Note: "int" should only be used for samplers. - "type": "int", - - // values (required): The array of numbers with which to initialize the uniform. - // value: A JSON array containin the correct amount of numbers to initialize a uniform of the - // above-specified type. The following size rules should be followed: - // "int": 1 float - // "vec4": 4 floats - // "mat3": 9 floats - // "mat4": 16 floats - "values": [ 1.0 ] - } - ] -} \ No newline at end of file diff --git a/bgfx/effects/color.json b/bgfx/effects/color.json deleted file mode 100644 index 5a033140233..00000000000 --- a/bgfx/effects/color.json +++ /dev/null @@ -1,35 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// color.json: Color aberration shader for CRT simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_color", - "fragment": "fs_color", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, - { "name": "u_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scale", "type": "vec4", "values": [ 0.95, 0.95, 0.95, 0.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.5, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/deconverge.json b/bgfx/effects/deconverge.json deleted file mode 100644 index dafd2fb630e..00000000000 --- a/bgfx/effects/deconverge.json +++ /dev/null @@ -1,37 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// deconverge.json: Electron-gun misalignment shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_deconverge", - "fragment": "fs_deconverge", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_source_size", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_converge_red", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.5, 0.0, 0.0 ] }, - { "name": "u_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/default/LICENSE b/bgfx/effects/default/LICENSE new file mode 100644 index 00000000000..e1a4f1f53d6 --- /dev/null +++ b/bgfx/effects/default/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016, Ryan Holtz and MAME Development Team +All rights reserved. + +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 disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of bsd3 nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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. diff --git a/bgfx/effects/default/README.md b/bgfx/effects/default/README.md new file mode 100644 index 00000000000..72aad88f861 --- /dev/null +++ b/bgfx/effects/default/README.md @@ -0,0 +1,5 @@ +# **BGFX shader effects** # + +Cointains definitions for BGFX shader effects + +Licensed under [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) by Ryan Holtz and MAME Development Team diff --git a/bgfx/effects/default/blit.json b/bgfx/effects/default/blit.json new file mode 100644 index 00000000000..bbc9fd295d4 --- /dev/null +++ b/bgfx/effects/default/blit.json @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// blit.json: A simple texture-to-target copy. +// +//============================================================ +{ + // blend (required): The blend state for this effect. + "blend": { + // equation (optional): What equation to perform on the source and destination blend values. + // values: "add", "sub", "revSub", "min", "max" + // default: "add" + // + // "subtract" and "revSubtract" are provided as aliases for "sub" and "revSub" + "equation": "add", + + // blend function parameters (optional): What factors to use in the blend function when calculating the final pixel. + // values: "0", "1", "srcColor", "1-srcColor", "dstColor", "1-dstColor", "srcAlpha", "1-srcAlpha", "dstAlpha", "1-dstAlpha" + // defaults (srcColor, srcAlpha): "1" + // defaults (dstColor, dstAlpha): "0" + // + // "zero", "one", "invSrcColor", "invDstColor", "invSrcAlpha", and "invDstAlpha" are provided as aliases for "0", "1", "1-srcColor", "1-dstColor", "1-srcAlpha", and "1-dstAlpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + + // depth (required): The depth state for this effect. + "depth": { + // function (optional): The depth function to use when drawing. + // values: "never", "less", "equal", "lequal", "greater", "notequal", "gequal", "always" + // default: "always" + "function": "always", + + // writeenable (optional): Whether to store Z-buffer data. + // values: true, false + // default: false + "writeenable": false + }, + + // cull (required): The cull mode for this effect. + "cull": { + // mode (optional): What winding, if any, to cull. + // values: "none", "cw", "ccw" + // default: "ccw" + // + // "clockwise" and "counterclockwise" are provided as aliases for "cw" and "ccw" + "mode": "none" + }, + + // write (required): Write enable for color and alpha channels. + "write": { + // rgb (optional): Whether to store color data when drawing. + // values: true, false + // default: false + "rgb": true, + + // alpha (optional): Whether to store alpha data when drawing. + // values: true, false + // default: false + "alpha": true + }, + + // vertex (required): The vertex shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "vertex": "vs_blit", + + // pixel/fragment (required): The pixel or fragment shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "fragment": "fs_blit", + + // uniforms (required): The list of uniforms for this effect. Can be empty, but must exist. + "uniforms": [ + { + // name (required): The name of the uniform, as used in either the vertex or pixel/fragment shader. + // value: A string containing the name of the uniform as described above. + // + // NOTE: Some names correspond to special values that will be automatically filled by the BGFX + // code if they are used by the shader. These names are: + // "u_screen_dims" + // The dimensions of the first texture input if present, otherwise the dimensions of the output window. + // Valid values: xy + // "u_inv_screen_dims" + // The reciprocal of u_screen_dims. + // Valid values: xy + // "u_source_dims" + // The size, in pixels, of the screen texture incoming to the chain. + // Valid values: xy + // "u_rotation_type" + // This screen's rotation type. 0 if ROT0, 1 if ROT90, 2 if ROT180, 3 of ROT270. + // Valid values: x + // "u_swap_xy" + // Whether this screen is swapped on the X and Y axes. 1 if true, 0 if false. + // Valid values: x + // "u_quad_dims" + // The dimensions, in pixels, occupied by this one screen primitive itself in the output window. + // Valid values: xy + // "u_tex_sizeN" + // The dimensions, in pixels, of the texture in input pair N. Starts at 0. + // valid values: xy + "name": "s_tex", + + // type (required): The type of the uniform. + // values: "int", "vec4", "mat3", "mat4" + // + // Note: "int" should only be used for samplers. + "type": "int", + + // values (required): The array of numbers with which to initialize the uniform. + // value: A JSON array containin the correct amount of numbers to initialize a uniform of the + // above-specified type. The following size rules should be followed: + // "int": 1 float + // "vec4": 4 floats + // "mat3": 9 floats + // "mat4": 16 floats + "values": [ 1.0 ] + } + ] +} \ No newline at end of file diff --git a/bgfx/effects/defocus.json b/bgfx/effects/defocus.json deleted file mode 100644 index 7ba4b2cec49..00000000000 --- a/bgfx/effects/defocus.json +++ /dev/null @@ -1,31 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// defocus.json: Foucs adjustment shader for CRT simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_defocus", - "fragment": "fs_defocus", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_defocus", "type": "vec4", "values": [ 0.5, 0.5, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/distortion.json b/bgfx/effects/distortion.json deleted file mode 100644 index e8bbac16095..00000000000 --- a/bgfx/effects/distortion.json +++ /dev/null @@ -1,40 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:ImJezze -//============================================================ -// -// distortion.json: Output distortion shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_distortion", - "fragment": "fs_distortion", - "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_screen_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_rotation_type", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_prepare_vector", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_curvature", "type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, - { "name": "u_round_corner", "type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_smooth_border", "type": "vec4", "values": [ 0.05, 0.0, 0.0, 0.0 ] }, - { "name": "u_vignetting", "type": "vec4", "values": [ 0.20, 0.0, 0.0, 0.0 ] }, - { "name": "u_reflection", "type": "vec4", "values": [ 0.30, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/hlsl/LICENSE b/bgfx/effects/hlsl/LICENSE new file mode 100644 index 00000000000..e1a4f1f53d6 --- /dev/null +++ b/bgfx/effects/hlsl/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016, Ryan Holtz and MAME Development Team +All rights reserved. + +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 disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of bsd3 nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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. diff --git a/bgfx/effects/hlsl/README.md b/bgfx/effects/hlsl/README.md new file mode 100644 index 00000000000..72aad88f861 --- /dev/null +++ b/bgfx/effects/hlsl/README.md @@ -0,0 +1,5 @@ +# **BGFX shader effects** # + +Cointains definitions for BGFX shader effects + +Licensed under [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) by Ryan Holtz and MAME Development Team diff --git a/bgfx/effects/hlsl/blit.json b/bgfx/effects/hlsl/blit.json new file mode 100644 index 00000000000..bbc9fd295d4 --- /dev/null +++ b/bgfx/effects/hlsl/blit.json @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// blit.json: A simple texture-to-target copy. +// +//============================================================ +{ + // blend (required): The blend state for this effect. + "blend": { + // equation (optional): What equation to perform on the source and destination blend values. + // values: "add", "sub", "revSub", "min", "max" + // default: "add" + // + // "subtract" and "revSubtract" are provided as aliases for "sub" and "revSub" + "equation": "add", + + // blend function parameters (optional): What factors to use in the blend function when calculating the final pixel. + // values: "0", "1", "srcColor", "1-srcColor", "dstColor", "1-dstColor", "srcAlpha", "1-srcAlpha", "dstAlpha", "1-dstAlpha" + // defaults (srcColor, srcAlpha): "1" + // defaults (dstColor, dstAlpha): "0" + // + // "zero", "one", "invSrcColor", "invDstColor", "invSrcAlpha", and "invDstAlpha" are provided as aliases for "0", "1", "1-srcColor", "1-dstColor", "1-srcAlpha", and "1-dstAlpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + + // depth (required): The depth state for this effect. + "depth": { + // function (optional): The depth function to use when drawing. + // values: "never", "less", "equal", "lequal", "greater", "notequal", "gequal", "always" + // default: "always" + "function": "always", + + // writeenable (optional): Whether to store Z-buffer data. + // values: true, false + // default: false + "writeenable": false + }, + + // cull (required): The cull mode for this effect. + "cull": { + // mode (optional): What winding, if any, to cull. + // values: "none", "cw", "ccw" + // default: "ccw" + // + // "clockwise" and "counterclockwise" are provided as aliases for "cw" and "ccw" + "mode": "none" + }, + + // write (required): Write enable for color and alpha channels. + "write": { + // rgb (optional): Whether to store color data when drawing. + // values: true, false + // default: false + "rgb": true, + + // alpha (optional): Whether to store alpha data when drawing. + // values: true, false + // default: false + "alpha": true + }, + + // vertex (required): The vertex shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "vertex": "vs_blit", + + // pixel/fragment (required): The pixel or fragment shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "fragment": "fs_blit", + + // uniforms (required): The list of uniforms for this effect. Can be empty, but must exist. + "uniforms": [ + { + // name (required): The name of the uniform, as used in either the vertex or pixel/fragment shader. + // value: A string containing the name of the uniform as described above. + // + // NOTE: Some names correspond to special values that will be automatically filled by the BGFX + // code if they are used by the shader. These names are: + // "u_screen_dims" + // The dimensions of the first texture input if present, otherwise the dimensions of the output window. + // Valid values: xy + // "u_inv_screen_dims" + // The reciprocal of u_screen_dims. + // Valid values: xy + // "u_source_dims" + // The size, in pixels, of the screen texture incoming to the chain. + // Valid values: xy + // "u_rotation_type" + // This screen's rotation type. 0 if ROT0, 1 if ROT90, 2 if ROT180, 3 of ROT270. + // Valid values: x + // "u_swap_xy" + // Whether this screen is swapped on the X and Y axes. 1 if true, 0 if false. + // Valid values: x + // "u_quad_dims" + // The dimensions, in pixels, occupied by this one screen primitive itself in the output window. + // Valid values: xy + // "u_tex_sizeN" + // The dimensions, in pixels, of the texture in input pair N. Starts at 0. + // valid values: xy + "name": "s_tex", + + // type (required): The type of the uniform. + // values: "int", "vec4", "mat3", "mat4" + // + // Note: "int" should only be used for samplers. + "type": "int", + + // values (required): The array of numbers with which to initialize the uniform. + // value: A JSON array containin the correct amount of numbers to initialize a uniform of the + // above-specified type. The following size rules should be followed: + // "int": 1 float + // "vec4": 4 floats + // "mat3": 9 floats + // "mat4": 16 floats + "values": [ 1.0 ] + } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/color.json b/bgfx/effects/hlsl/color.json new file mode 100644 index 00000000000..5a033140233 --- /dev/null +++ b/bgfx/effects/hlsl/color.json @@ -0,0 +1,35 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// color.json: Color aberration shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_color", + "fragment": "fs_color", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, + { "name": "u_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scale", "type": "vec4", "values": [ 0.95, 0.95, 0.95, 0.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.5, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/deconverge.json b/bgfx/effects/hlsl/deconverge.json new file mode 100644 index 00000000000..dafd2fb630e --- /dev/null +++ b/bgfx/effects/hlsl/deconverge.json @@ -0,0 +1,37 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// deconverge.json: Electron-gun misalignment shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_deconverge", + "fragment": "fs_deconverge", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_size", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, + { "name": "u_converge_red", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.5, 0.0, 0.0 ] }, + { "name": "u_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/defocus.json b/bgfx/effects/hlsl/defocus.json new file mode 100644 index 00000000000..7ba4b2cec49 --- /dev/null +++ b/bgfx/effects/hlsl/defocus.json @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// defocus.json: Foucs adjustment shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_defocus", + "fragment": "fs_defocus", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_defocus", "type": "vec4", "values": [ 0.5, 0.5, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/distortion.json b/bgfx/effects/hlsl/distortion.json new file mode 100644 index 00000000000..e8bbac16095 --- /dev/null +++ b/bgfx/effects/hlsl/distortion.json @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:ImJezze +//============================================================ +// +// distortion.json: Output distortion shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_distortion", + "fragment": "fs_distortion", + "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_screen_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_rotation_type", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_prepare_vector", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_curvature", "type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, + { "name": "u_round_corner", "type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_smooth_border", "type": "vec4", "values": [ 0.05, 0.0, 0.0, 0.0 ] }, + { "name": "u_vignetting", "type": "vec4", "values": [ 0.20, 0.0, 0.0, 0.0 ] }, + { "name": "u_reflection", "type": "vec4", "values": [ 0.30, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/ntsc_decode.json b/bgfx/effects/hlsl/ntsc_decode.json new file mode 100644 index 00000000000..208f35b0ff3 --- /dev/null +++ b/bgfx/effects/hlsl/ntsc_decode.json @@ -0,0 +1,42 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// ntsc_decode.json: Composite NTSC decoder shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_ntsc_decode", + "fragment": "fs_ntsc_decode", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] }, + { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] }, + { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 3.5795454, 3.5795454, 3.5795454 ] }, + { "name": "u_o_value", "type": "vec4", "values": [ 1.570796325, 1.570796325, 1.570796325, 1.570796325 ] }, + { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] }, + { "name": "u_notch_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_y_freq_response", "type": "vec4", "values": [ 6.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_i_freq_response", "type": "vec4", "values": [ 1.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_q_freq_response", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/ntsc_encode.json b/bgfx/effects/hlsl/ntsc_encode.json new file mode 100644 index 00000000000..8ff193398b2 --- /dev/null +++ b/bgfx/effects/hlsl/ntsc_encode.json @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// ntsc_encode.json: Composite NTSC encoder shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_ntsc_encode", + "fragment": "fs_ntsc_encode", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_cc_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_p_value", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/phosphor.json b/bgfx/effects/hlsl/phosphor.json new file mode 100644 index 00000000000..aaa3c12f727 --- /dev/null +++ b/bgfx/effects/hlsl/phosphor.json @@ -0,0 +1,33 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// phosphor.json: Phosphor persistence shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_phosphor", + "fragment": "fs_phosphor", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_prev", "type": "int", "values": [ 1.0 ] }, + { "name": "u_passthrough", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor", "type": "vec4", "values": [ 0.7, 0.7, 0.7, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/post.json b/bgfx/effects/hlsl/post.json new file mode 100644 index 00000000000..c4a86da84e5 --- /dev/null +++ b/bgfx/effects/hlsl/post.json @@ -0,0 +1,53 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// post.json: Scanline, hum-bar, shadow-mask, and final +// color convolution shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_post", + "fragment": "fs_post", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, + { "name": "s_shadow", "type": "int", "values": [ 1.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_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_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 ] }, + { "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_power", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] }, + { "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/hlsl/prescale.json b/bgfx/effects/hlsl/prescale.json new file mode 100644 index 00000000000..a636c4316e0 --- /dev/null +++ b/bgfx/effects/hlsl/prescale.json @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:ImJezze +//============================================================ +// +// prescale.json: Unfiltered upscale shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_prescale", + "fragment": "fs_prescale", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + ] +} \ No newline at end of file diff --git a/bgfx/effects/ntsc_decode.json b/bgfx/effects/ntsc_decode.json deleted file mode 100644 index 208f35b0ff3..00000000000 --- a/bgfx/effects/ntsc_decode.json +++ /dev/null @@ -1,42 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// ntsc_decode.json: Composite NTSC decoder shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_ntsc_decode", - "fragment": "fs_ntsc_decode", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] }, - { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] }, - { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 3.5795454, 3.5795454, 3.5795454 ] }, - { "name": "u_o_value", "type": "vec4", "values": [ 1.570796325, 1.570796325, 1.570796325, 1.570796325 ] }, - { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] }, - { "name": "u_notch_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_y_freq_response", "type": "vec4", "values": [ 6.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_i_freq_response", "type": "vec4", "values": [ 1.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_q_freq_response", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, - { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/ntsc_encode.json b/bgfx/effects/ntsc_encode.json deleted file mode 100644 index 8ff193398b2..00000000000 --- a/bgfx/effects/ntsc_encode.json +++ /dev/null @@ -1,38 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// ntsc_encode.json: Composite NTSC encoder shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_ntsc_encode", - "fragment": "fs_ntsc_encode", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "u_cc_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "u_p_value", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] }, - { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/phosphor.json b/bgfx/effects/phosphor.json deleted file mode 100644 index aaa3c12f727..00000000000 --- a/bgfx/effects/phosphor.json +++ /dev/null @@ -1,33 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// phosphor.json: Phosphor persistence shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_phosphor", - "fragment": "fs_phosphor", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_prev", "type": "int", "values": [ 1.0 ] }, - { "name": "u_passthrough", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor", "type": "vec4", "values": [ 0.7, 0.7, 0.7, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/post.json b/bgfx/effects/post.json deleted file mode 100644 index 525bbfc39b8..00000000000 --- a/bgfx/effects/post.json +++ /dev/null @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz,ImJezze -//============================================================ -// -// post.json: Scanline, hum-bar, shadow-mask, and final -// color convolution shader for CRT simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_post", - "fragment": "fs_post", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, - { "name": "s_shadow", "type": "int", "values": [ 1.0 ] }, - { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_screen_dims", "type": "vec4", "values": [ 1336.0, 1002.0, 0.0, 0.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_prepare_bloom", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_prepare_vector", "type": "vec4", "values": [ 0.0, 0.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_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_back_color", "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_shadow_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.333, 0.0, 0.0 ] }, - { "name": "u_power", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] }, - { "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/prescale.json b/bgfx/effects/prescale.json deleted file mode 100644 index a636c4316e0..00000000000 --- a/bgfx/effects/prescale.json +++ /dev/null @@ -1,32 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:ImJezze -//============================================================ -// -// prescale.json: Unfiltered upscale shader for CRT -// simulation. -// -//============================================================ -{ - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, - "depth": { - "function": "always" - }, - "cull": { "mode": "none" }, - "write": { - "rgb": true, - "alpha": true - }, - "vertex": "vs_prescale", - "fragment": "fs_prescale", - "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } - ] -} \ No newline at end of file diff --git a/bgfx/effects/unfiltered/LICENSE b/bgfx/effects/unfiltered/LICENSE new file mode 100644 index 00000000000..e1a4f1f53d6 --- /dev/null +++ b/bgfx/effects/unfiltered/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016, Ryan Holtz and MAME Development Team +All rights reserved. + +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 disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of bsd3 nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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. diff --git a/bgfx/effects/unfiltered/README.md b/bgfx/effects/unfiltered/README.md new file mode 100644 index 00000000000..72aad88f861 --- /dev/null +++ b/bgfx/effects/unfiltered/README.md @@ -0,0 +1,5 @@ +# **BGFX shader effects** # + +Cointains definitions for BGFX shader effects + +Licensed under [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) by Ryan Holtz and MAME Development Team diff --git a/bgfx/effects/unfiltered/blit.json b/bgfx/effects/unfiltered/blit.json new file mode 100644 index 00000000000..bbc9fd295d4 --- /dev/null +++ b/bgfx/effects/unfiltered/blit.json @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// blit.json: A simple texture-to-target copy. +// +//============================================================ +{ + // blend (required): The blend state for this effect. + "blend": { + // equation (optional): What equation to perform on the source and destination blend values. + // values: "add", "sub", "revSub", "min", "max" + // default: "add" + // + // "subtract" and "revSubtract" are provided as aliases for "sub" and "revSub" + "equation": "add", + + // blend function parameters (optional): What factors to use in the blend function when calculating the final pixel. + // values: "0", "1", "srcColor", "1-srcColor", "dstColor", "1-dstColor", "srcAlpha", "1-srcAlpha", "dstAlpha", "1-dstAlpha" + // defaults (srcColor, srcAlpha): "1" + // defaults (dstColor, dstAlpha): "0" + // + // "zero", "one", "invSrcColor", "invDstColor", "invSrcAlpha", and "invDstAlpha" are provided as aliases for "0", "1", "1-srcColor", "1-dstColor", "1-srcAlpha", and "1-dstAlpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + + // depth (required): The depth state for this effect. + "depth": { + // function (optional): The depth function to use when drawing. + // values: "never", "less", "equal", "lequal", "greater", "notequal", "gequal", "always" + // default: "always" + "function": "always", + + // writeenable (optional): Whether to store Z-buffer data. + // values: true, false + // default: false + "writeenable": false + }, + + // cull (required): The cull mode for this effect. + "cull": { + // mode (optional): What winding, if any, to cull. + // values: "none", "cw", "ccw" + // default: "ccw" + // + // "clockwise" and "counterclockwise" are provided as aliases for "cw" and "ccw" + "mode": "none" + }, + + // write (required): Write enable for color and alpha channels. + "write": { + // rgb (optional): Whether to store color data when drawing. + // values: true, false + // default: false + "rgb": true, + + // alpha (optional): Whether to store alpha data when drawing. + // values: true, false + // default: false + "alpha": true + }, + + // vertex (required): The vertex shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "vertex": "vs_blit", + + // pixel/fragment (required): The pixel or fragment shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "fragment": "fs_blit", + + // uniforms (required): The list of uniforms for this effect. Can be empty, but must exist. + "uniforms": [ + { + // name (required): The name of the uniform, as used in either the vertex or pixel/fragment shader. + // value: A string containing the name of the uniform as described above. + // + // NOTE: Some names correspond to special values that will be automatically filled by the BGFX + // code if they are used by the shader. These names are: + // "u_screen_dims" + // The dimensions of the first texture input if present, otherwise the dimensions of the output window. + // Valid values: xy + // "u_inv_screen_dims" + // The reciprocal of u_screen_dims. + // Valid values: xy + // "u_source_dims" + // The size, in pixels, of the screen texture incoming to the chain. + // Valid values: xy + // "u_rotation_type" + // This screen's rotation type. 0 if ROT0, 1 if ROT90, 2 if ROT180, 3 of ROT270. + // Valid values: x + // "u_swap_xy" + // Whether this screen is swapped on the X and Y axes. 1 if true, 0 if false. + // Valid values: x + // "u_quad_dims" + // The dimensions, in pixels, occupied by this one screen primitive itself in the output window. + // Valid values: xy + // "u_tex_sizeN" + // The dimensions, in pixels, of the texture in input pair N. Starts at 0. + // valid values: xy + "name": "s_tex", + + // type (required): The type of the uniform. + // values: "int", "vec4", "mat3", "mat4" + // + // Note: "int" should only be used for samplers. + "type": "int", + + // values (required): The array of numbers with which to initialize the uniform. + // value: A JSON array containin the correct amount of numbers to initialize a uniform of the + // above-specified type. The following size rules should be followed: + // "int": 1 float + // "vec4": 4 floats + // "mat3": 9 floats + // "mat4": 16 floats + "values": [ 1.0 ] + } + ] +} \ No newline at end of file diff --git a/bgfx/shaders/dx11/fs_blit.bin b/bgfx/shaders/dx11/fs_blit.bin index 97c305a440d..98e6afc9871 100644 Binary files a/bgfx/shaders/dx11/fs_blit.bin and b/bgfx/shaders/dx11/fs_blit.bin differ diff --git a/bgfx/shaders/dx11/fs_color.bin b/bgfx/shaders/dx11/fs_color.bin index 145c0e72c3b..d5e420b8c0a 100644 Binary files a/bgfx/shaders/dx11/fs_color.bin and b/bgfx/shaders/dx11/fs_color.bin differ diff --git a/bgfx/shaders/dx11/fs_deconverge.bin b/bgfx/shaders/dx11/fs_deconverge.bin index 34032932b6b..2c3047ecc38 100644 Binary files a/bgfx/shaders/dx11/fs_deconverge.bin and b/bgfx/shaders/dx11/fs_deconverge.bin differ diff --git a/bgfx/shaders/dx11/fs_defocus.bin b/bgfx/shaders/dx11/fs_defocus.bin index 2b1552c0cf6..0453ced9245 100644 Binary files a/bgfx/shaders/dx11/fs_defocus.bin and b/bgfx/shaders/dx11/fs_defocus.bin differ diff --git a/bgfx/shaders/dx11/fs_distortion.bin b/bgfx/shaders/dx11/fs_distortion.bin index 19a7124084e..4399b58c49c 100644 Binary files a/bgfx/shaders/dx11/fs_distortion.bin and b/bgfx/shaders/dx11/fs_distortion.bin differ diff --git a/bgfx/shaders/dx11/fs_gui.bin b/bgfx/shaders/dx11/fs_gui.bin index de921a8ac60..1ef0ea19827 100644 Binary files a/bgfx/shaders/dx11/fs_gui.bin and b/bgfx/shaders/dx11/fs_gui.bin differ diff --git a/bgfx/shaders/dx11/fs_ntsc_decode.bin b/bgfx/shaders/dx11/fs_ntsc_decode.bin index e42dfd9ab0b..bbefb77f9d5 100644 Binary files a/bgfx/shaders/dx11/fs_ntsc_decode.bin and b/bgfx/shaders/dx11/fs_ntsc_decode.bin differ diff --git a/bgfx/shaders/dx11/fs_ntsc_encode.bin b/bgfx/shaders/dx11/fs_ntsc_encode.bin index 76ed9fc6b9d..329250b61a4 100644 Binary files a/bgfx/shaders/dx11/fs_ntsc_encode.bin and b/bgfx/shaders/dx11/fs_ntsc_encode.bin differ diff --git a/bgfx/shaders/dx11/fs_phosphor.bin b/bgfx/shaders/dx11/fs_phosphor.bin index cb4067339e1..b4279fc2c3c 100644 Binary files a/bgfx/shaders/dx11/fs_phosphor.bin and b/bgfx/shaders/dx11/fs_phosphor.bin differ diff --git a/bgfx/shaders/dx11/fs_post.bin b/bgfx/shaders/dx11/fs_post.bin index 142a5ce6296..f7de4f9d3d6 100644 Binary files a/bgfx/shaders/dx11/fs_post.bin and b/bgfx/shaders/dx11/fs_post.bin differ diff --git a/bgfx/shaders/dx11/fs_prescale.bin b/bgfx/shaders/dx11/fs_prescale.bin index 48b30509c0b..a179c13e6ec 100644 Binary files a/bgfx/shaders/dx11/fs_prescale.bin and b/bgfx/shaders/dx11/fs_prescale.bin differ diff --git a/bgfx/shaders/dx11/fs_screen.bin b/bgfx/shaders/dx11/fs_screen.bin index da6666a4c60..0e31de163b1 100644 Binary files a/bgfx/shaders/dx11/fs_screen.bin and b/bgfx/shaders/dx11/fs_screen.bin differ diff --git a/bgfx/shaders/dx11/vs_blit.bin b/bgfx/shaders/dx11/vs_blit.bin index 296cdf52be7..fc0022997bb 100644 Binary files a/bgfx/shaders/dx11/vs_blit.bin and b/bgfx/shaders/dx11/vs_blit.bin differ diff --git a/bgfx/shaders/dx11/vs_color.bin b/bgfx/shaders/dx11/vs_color.bin index a0673685469..69d40d0c3b4 100644 Binary files a/bgfx/shaders/dx11/vs_color.bin and b/bgfx/shaders/dx11/vs_color.bin differ diff --git a/bgfx/shaders/dx11/vs_deconverge.bin b/bgfx/shaders/dx11/vs_deconverge.bin index 43c6c33410e..62440de3aa7 100644 Binary files a/bgfx/shaders/dx11/vs_deconverge.bin and b/bgfx/shaders/dx11/vs_deconverge.bin differ diff --git a/bgfx/shaders/dx11/vs_defocus.bin b/bgfx/shaders/dx11/vs_defocus.bin index eb5d2fc8e4a..df493402ed8 100644 Binary files a/bgfx/shaders/dx11/vs_defocus.bin and b/bgfx/shaders/dx11/vs_defocus.bin differ diff --git a/bgfx/shaders/dx11/vs_distortion.bin b/bgfx/shaders/dx11/vs_distortion.bin index 2d5d08866b9..152756344fb 100644 Binary files a/bgfx/shaders/dx11/vs_distortion.bin and b/bgfx/shaders/dx11/vs_distortion.bin differ diff --git a/bgfx/shaders/dx11/vs_gui.bin b/bgfx/shaders/dx11/vs_gui.bin index b1640861f2b..683365b786a 100644 Binary files a/bgfx/shaders/dx11/vs_gui.bin and b/bgfx/shaders/dx11/vs_gui.bin differ diff --git a/bgfx/shaders/dx11/vs_ntsc_decode.bin b/bgfx/shaders/dx11/vs_ntsc_decode.bin index 29e62929df3..b1b720b8c48 100644 Binary files a/bgfx/shaders/dx11/vs_ntsc_decode.bin and b/bgfx/shaders/dx11/vs_ntsc_decode.bin differ diff --git a/bgfx/shaders/dx11/vs_ntsc_encode.bin b/bgfx/shaders/dx11/vs_ntsc_encode.bin index 87c60815602..2626aceeb7a 100644 Binary files a/bgfx/shaders/dx11/vs_ntsc_encode.bin and b/bgfx/shaders/dx11/vs_ntsc_encode.bin differ diff --git a/bgfx/shaders/dx11/vs_phosphor.bin b/bgfx/shaders/dx11/vs_phosphor.bin index 29f497b4a65..8cd89f18b99 100644 Binary files a/bgfx/shaders/dx11/vs_phosphor.bin and b/bgfx/shaders/dx11/vs_phosphor.bin differ diff --git a/bgfx/shaders/dx11/vs_post.bin b/bgfx/shaders/dx11/vs_post.bin index 70639fc75f7..a8827bacda2 100644 Binary files a/bgfx/shaders/dx11/vs_post.bin and b/bgfx/shaders/dx11/vs_post.bin differ diff --git a/bgfx/shaders/dx11/vs_prescale.bin b/bgfx/shaders/dx11/vs_prescale.bin index c173aff6efd..4daaf3d7532 100644 Binary files a/bgfx/shaders/dx11/vs_prescale.bin and b/bgfx/shaders/dx11/vs_prescale.bin differ diff --git a/bgfx/shaders/dx11/vs_screen.bin b/bgfx/shaders/dx11/vs_screen.bin index 766a9c4e93b..c3c17a3621c 100644 Binary files a/bgfx/shaders/dx11/vs_screen.bin and b/bgfx/shaders/dx11/vs_screen.bin differ diff --git a/bgfx/shaders/dx9/fs_post.bin b/bgfx/shaders/dx9/fs_post.bin index aad4df72ddd..b0e0edd02ac 100644 Binary files a/bgfx/shaders/dx9/fs_post.bin and b/bgfx/shaders/dx9/fs_post.bin differ diff --git a/bgfx/shaders/dx9/vs_post.bin b/bgfx/shaders/dx9/vs_post.bin index 43eec77a6f4..c006fe0c6ac 100644 Binary files a/bgfx/shaders/dx9/vs_post.bin and b/bgfx/shaders/dx9/vs_post.bin differ diff --git a/bgfx/shaders/gles/fs_post.bin b/bgfx/shaders/gles/fs_post.bin index 72279deee43..e9896427988 100644 Binary files a/bgfx/shaders/gles/fs_post.bin and b/bgfx/shaders/gles/fs_post.bin differ diff --git a/bgfx/shaders/gles/vs_post.bin b/bgfx/shaders/gles/vs_post.bin index cb059e570a4..e9803083792 100644 Binary files a/bgfx/shaders/gles/vs_post.bin and b/bgfx/shaders/gles/vs_post.bin differ diff --git a/bgfx/shaders/glsl/fs_post.bin b/bgfx/shaders/glsl/fs_post.bin index 23e7d687606..056f8728347 100644 Binary files a/bgfx/shaders/glsl/fs_post.bin and b/bgfx/shaders/glsl/fs_post.bin differ diff --git a/bgfx/shaders/glsl/vs_post.bin b/bgfx/shaders/glsl/vs_post.bin index 624be0f29f0..510526ec588 100644 Binary files a/bgfx/shaders/glsl/vs_post.bin and b/bgfx/shaders/glsl/vs_post.bin differ diff --git a/bgfx/shaders/metal/fs_post.bin b/bgfx/shaders/metal/fs_post.bin index 4da4ca2e2c1..133e08292a4 100644 Binary files a/bgfx/shaders/metal/fs_post.bin and b/bgfx/shaders/metal/fs_post.bin differ diff --git a/bgfx/shaders/metal/vs_post.bin b/bgfx/shaders/metal/vs_post.bin index 70298ecb2f8..7d355aa1df1 100644 Binary files a/bgfx/shaders/metal/vs_post.bin and b/bgfx/shaders/metal/vs_post.bin differ -- cgit v1.2.3