diff options
| author | 2016-03-29 01:56:19 +0200 | |
|---|---|---|
| committer | 2016-03-29 01:56:37 +0200 | |
| commit | a4f615a14de8844ba996cf89d26639be9fb7c33b (patch) | |
| tree | adf4945839aede2ff7249e5a658ed095795d131f /bgfx | |
| parent | 0528efa10f68577a83c34fca308c1cc4ce3991ac (diff) | |
Get NTSC working in both bgfx and d3d, nw
Diffstat (limited to 'bgfx')
31 files changed, 37 insertions, 21 deletions
diff --git a/bgfx/chains/default.json b/bgfx/chains/default.json index 1142275e528..1012d6eacd5 100644 --- a/bgfx/chains/default.json +++ b/bgfx/chains/default.json @@ -7,14 +7,14 @@ } ], "passes": [ - { "effect": "default\blit", + { "effect": "default/blit", "name": "Copy To Unstretched Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } ], "output": "temp" }, - { "effect": "default\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 3353f92018a..eabf0664857 100644 --- a/bgfx/chains/hlsl.json +++ b/bgfx/chains/hlsl.json @@ -57,17 +57,18 @@ { "type": "intenum", "name": "adjustments", "text": "Enable Adjustments", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] }, - { "type": "intenum", "name": "ntsc", "text": "Enable NTSC", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] }, - { "type": "float", "name": "a_value", "text": "NTSC A Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, - { "type": "float", "name": "b_value", "text": "NTSC B Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, - { "type": "float", "name": "cc_value", "text": "NTSC Color Carrier (Hz)", "default": 35795454, "max": 36795454, "min": 34795454, "step": 100, "scale": 0.0000001, "format": "%1.7f", "screen": "raster" }, - { "type": "float", "name": "p_value", "text": "NTSC Phase Offset", "default": 100, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, - { "type": "float", "name": "scan_time", "text": "NTSC Scanline Duration (uSec)", "default": 526, "max": 1500, "min": 1, "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" }, - { "type": "float", "name": "notch_width", "text": "NTSC Color Notch Filter Width", "default": 100, "max": 400, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, - { "type": "float", "name": "y_freq_response", "text": "NTSC Y Signal Bandwidth (Hz)", "default": 600, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, - { "type": "float", "name": "i_freq_response", "text": "NTSC I Signal Bandwidth (Hz)", "default": 120, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, - { "type": "float", "name": "q_freq_response", "text": "NTSC Q Signal Bandwidth (Hz)", "default": 60, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, - { "type": "float", "name": "jitter_offset", "text": "NTSC Frame Jitter Offset", "default": 0, "max": 200, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "intenum", "name": "ntsc", "text": "Enable NTSC", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] }, + { "type": "float", "name": "a_value", "text": "NTSC A Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "float", "name": "b_value", "text": "NTSC B Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "float", "name": "cc_value", "text": "NTSC Color Carrier (Hz)", "default": 35795454, "max": 36795454, "min": 34795454, "step": 100, "scale": 0.0000001, "format": "%1.7f", "screen": "raster" }, + { "type": "float", "name": "o_value", "text": "NTSC Outgoing Phase Offset", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "float", "name": "p_value", "text": "NTSC Incoming Phase Pixel Clock Scale", "default": 100, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "float", "name": "scan_time", "text": "NTSC Scanline Duration (uSec)", "default": 526, "max": 1500, "min": 1, "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" }, + { "type": "float", "name": "notch_width", "text": "NTSC Color Notch Filter Width", "default": 200, "max": 400, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, + { "type": "float", "name": "y_freq_response", "text": "NTSC Y Signal Bandwidth (Hz)", "default": 600, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, + { "type": "float", "name": "i_freq_response", "text": "NTSC I Signal Bandwidth (Hz)", "default": 120, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, + { "type": "float", "name": "q_freq_response", "text": "NTSC Q Signal Bandwidth (Hz)", "default": 60, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" }, + { "type": "float", "name": "jitter_offset", "text": "NTSC Frame Jitter Offset", "default": 0, "max": 200, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, { "type": "color", "name": "red_ratios", "text": "Red Output from ", "default": [ 100, 0, 0 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, { "type": "color", "name": "grn_ratios", "text": "Green Output from ", "default": [ 0, 100, 0 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" }, @@ -88,18 +89,18 @@ { "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": 40, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, + { "type": "float", "name": "scanline_alpha", "text": "Scanline Amount", "default": 6, "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": "float", "name": "shadow_alpha", "text": "Shadow Mask Amount", "default": 40, "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_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": [ 80, 80, 80 ], "max": [ 400, 400, 400 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" }, @@ -155,6 +156,11 @@ // values: true, false // default: false { + "name": "ntsc", + "mode": "guest", + "doublebuffer": true + }, + { "name": "guest", "mode": "guest", "bilinear": false, @@ -170,6 +176,15 @@ // passes (required): The list of individual shaders to invoke, and any dynamic input parameters they need. "passes": [ { + // See the pass after this one for a verbose explanation of each parameter. + "effect": "hlsl/blit", + "name": "NTSC Blit to bilinear-able target", + "input": [ + { "sampler": "s_tex", "texture": "screen" } + ], + "output": "ntsc" + }, + { // 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": "hlsl/ntsc_encode", @@ -246,13 +261,13 @@ // // option (optional): The name of any MAME option, which will have its value fetched and used as the name of a PNG to load from the artwork directory. // value: Any valid MAME INI option name. - { "sampler": "s_tex", "texture": "screen" } + { "sampler": "s_tex", "target": "ntsc" } ], // output (required): The target to use as the output for this pass. Can be one of the named targets in "targets", or "output" // or "previous" for one of two automatically-generated targets. // value: Any valid ASCII string that names a target. - "output": "guest" + "output": "ntsc" }, { "effect": "hlsl/ntsc_decode", "name": "NTSC Decode", @@ -264,6 +279,7 @@ { "uniform": "u_a_value", "slider": "a_value" }, { "uniform": "u_b_value", "slider": "b_value" }, { "uniform": "u_cc_value", "slider": "cc_value" }, + { "uniform": "u_o_value", "slider": "o_value" }, { "uniform": "u_scan_time", "slider": "scan_time" }, { "uniform": "u_notch_width", "slider": "notch_width" }, { "uniform": "u_y_freq_response", "slider": "y_freq_response" }, @@ -274,7 +290,7 @@ { "uniform": "u_jitter_amount", "parameter": "jitter" } ], "input": [ - { "sampler": "s_tex", "target": "guest" } + { "sampler": "s_tex", "target": "ntsc" } ], "output": "guest" }, diff --git a/bgfx/chains/unfiltered.json b/bgfx/chains/unfiltered.json index 19d74cd5eec..a644f9af370 100644 --- a/bgfx/chains/unfiltered.json +++ b/bgfx/chains/unfiltered.json @@ -7,14 +7,14 @@ } ], "passes": [ - { "effect": "unfiltered\blit", + { "effect": "unfiltered/blit", "name": "Copy To Unstretched Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } ], "output": "temp" }, - { "effect": "unfiltered\blit", + { "effect": "unfiltered/blit", "name": "Final Upscale", "input": [ { "sampler": "s_tex", "target": "temp" } diff --git a/bgfx/shaders/dx11/fs_blit.bin b/bgfx/shaders/dx11/fs_blit.bin Binary files differindex 98e6afc9871..cc7afc788ab 100644 --- a/bgfx/shaders/dx11/fs_blit.bin +++ b/bgfx/shaders/dx11/fs_blit.bin diff --git a/bgfx/shaders/dx11/fs_color.bin b/bgfx/shaders/dx11/fs_color.bin Binary files differindex d5e420b8c0a..5acea195472 100644 --- a/bgfx/shaders/dx11/fs_color.bin +++ b/bgfx/shaders/dx11/fs_color.bin diff --git a/bgfx/shaders/dx11/fs_deconverge.bin b/bgfx/shaders/dx11/fs_deconverge.bin Binary files differindex 2c3047ecc38..f8954f8ee4b 100644 --- a/bgfx/shaders/dx11/fs_deconverge.bin +++ b/bgfx/shaders/dx11/fs_deconverge.bin diff --git a/bgfx/shaders/dx11/fs_defocus.bin b/bgfx/shaders/dx11/fs_defocus.bin Binary files differindex 0453ced9245..f342c80f26b 100644 --- a/bgfx/shaders/dx11/fs_defocus.bin +++ b/bgfx/shaders/dx11/fs_defocus.bin diff --git a/bgfx/shaders/dx11/fs_distortion.bin b/bgfx/shaders/dx11/fs_distortion.bin Binary files differindex 4399b58c49c..0ee1150c722 100644 --- a/bgfx/shaders/dx11/fs_distortion.bin +++ b/bgfx/shaders/dx11/fs_distortion.bin diff --git a/bgfx/shaders/dx11/fs_gui.bin b/bgfx/shaders/dx11/fs_gui.bin Binary files differindex 1ef0ea19827..54a4ed300e3 100644 --- a/bgfx/shaders/dx11/fs_gui.bin +++ b/bgfx/shaders/dx11/fs_gui.bin diff --git a/bgfx/shaders/dx11/fs_ntsc_decode.bin b/bgfx/shaders/dx11/fs_ntsc_decode.bin Binary files differindex bbefb77f9d5..7f6d8167939 100644 --- a/bgfx/shaders/dx11/fs_ntsc_decode.bin +++ b/bgfx/shaders/dx11/fs_ntsc_decode.bin diff --git a/bgfx/shaders/dx11/fs_ntsc_encode.bin b/bgfx/shaders/dx11/fs_ntsc_encode.bin Binary files differindex 329250b61a4..a6700b833e1 100644 --- a/bgfx/shaders/dx11/fs_ntsc_encode.bin +++ b/bgfx/shaders/dx11/fs_ntsc_encode.bin diff --git a/bgfx/shaders/dx11/fs_phosphor.bin b/bgfx/shaders/dx11/fs_phosphor.bin Binary files differindex b4279fc2c3c..eb9b15d3274 100644 --- a/bgfx/shaders/dx11/fs_phosphor.bin +++ b/bgfx/shaders/dx11/fs_phosphor.bin diff --git a/bgfx/shaders/dx11/fs_post.bin b/bgfx/shaders/dx11/fs_post.bin Binary files differindex f7de4f9d3d6..6cb61306fe2 100644 --- a/bgfx/shaders/dx11/fs_post.bin +++ b/bgfx/shaders/dx11/fs_post.bin diff --git a/bgfx/shaders/dx11/fs_prescale.bin b/bgfx/shaders/dx11/fs_prescale.bin Binary files differindex a179c13e6ec..7e5fadd5805 100644 --- a/bgfx/shaders/dx11/fs_prescale.bin +++ b/bgfx/shaders/dx11/fs_prescale.bin diff --git a/bgfx/shaders/dx11/fs_screen.bin b/bgfx/shaders/dx11/fs_screen.bin Binary files differindex 0e31de163b1..83828d145f7 100644 --- a/bgfx/shaders/dx11/fs_screen.bin +++ b/bgfx/shaders/dx11/fs_screen.bin diff --git a/bgfx/shaders/dx11/vs_blit.bin b/bgfx/shaders/dx11/vs_blit.bin Binary files differindex fc0022997bb..346eae89602 100644 --- a/bgfx/shaders/dx11/vs_blit.bin +++ b/bgfx/shaders/dx11/vs_blit.bin diff --git a/bgfx/shaders/dx11/vs_color.bin b/bgfx/shaders/dx11/vs_color.bin Binary files differindex 69d40d0c3b4..5f21c9be763 100644 --- a/bgfx/shaders/dx11/vs_color.bin +++ b/bgfx/shaders/dx11/vs_color.bin diff --git a/bgfx/shaders/dx11/vs_deconverge.bin b/bgfx/shaders/dx11/vs_deconverge.bin Binary files differindex 62440de3aa7..59e0c530392 100644 --- a/bgfx/shaders/dx11/vs_deconverge.bin +++ b/bgfx/shaders/dx11/vs_deconverge.bin diff --git a/bgfx/shaders/dx11/vs_defocus.bin b/bgfx/shaders/dx11/vs_defocus.bin Binary files differindex df493402ed8..f75c794c2c2 100644 --- a/bgfx/shaders/dx11/vs_defocus.bin +++ b/bgfx/shaders/dx11/vs_defocus.bin diff --git a/bgfx/shaders/dx11/vs_distortion.bin b/bgfx/shaders/dx11/vs_distortion.bin Binary files differindex 152756344fb..73b8e5190e1 100644 --- a/bgfx/shaders/dx11/vs_distortion.bin +++ b/bgfx/shaders/dx11/vs_distortion.bin diff --git a/bgfx/shaders/dx11/vs_gui.bin b/bgfx/shaders/dx11/vs_gui.bin Binary files differindex 683365b786a..7b387679737 100644 --- a/bgfx/shaders/dx11/vs_gui.bin +++ b/bgfx/shaders/dx11/vs_gui.bin diff --git a/bgfx/shaders/dx11/vs_ntsc_decode.bin b/bgfx/shaders/dx11/vs_ntsc_decode.bin Binary files differindex b1b720b8c48..29cc7d9290a 100644 --- a/bgfx/shaders/dx11/vs_ntsc_decode.bin +++ b/bgfx/shaders/dx11/vs_ntsc_decode.bin diff --git a/bgfx/shaders/dx11/vs_ntsc_encode.bin b/bgfx/shaders/dx11/vs_ntsc_encode.bin Binary files differindex 2626aceeb7a..bbcbf4ede89 100644 --- a/bgfx/shaders/dx11/vs_ntsc_encode.bin +++ b/bgfx/shaders/dx11/vs_ntsc_encode.bin diff --git a/bgfx/shaders/dx11/vs_phosphor.bin b/bgfx/shaders/dx11/vs_phosphor.bin Binary files differindex 8cd89f18b99..07edbef7bad 100644 --- a/bgfx/shaders/dx11/vs_phosphor.bin +++ b/bgfx/shaders/dx11/vs_phosphor.bin diff --git a/bgfx/shaders/dx11/vs_post.bin b/bgfx/shaders/dx11/vs_post.bin Binary files differindex a8827bacda2..5362d6c50eb 100644 --- a/bgfx/shaders/dx11/vs_post.bin +++ b/bgfx/shaders/dx11/vs_post.bin diff --git a/bgfx/shaders/dx11/vs_prescale.bin b/bgfx/shaders/dx11/vs_prescale.bin Binary files differindex 4daaf3d7532..dee008391ae 100644 --- a/bgfx/shaders/dx11/vs_prescale.bin +++ b/bgfx/shaders/dx11/vs_prescale.bin diff --git a/bgfx/shaders/dx11/vs_screen.bin b/bgfx/shaders/dx11/vs_screen.bin Binary files differindex c3c17a3621c..9d5426f76be 100644 --- a/bgfx/shaders/dx11/vs_screen.bin +++ b/bgfx/shaders/dx11/vs_screen.bin diff --git a/bgfx/shaders/dx9/fs_ntsc_decode.bin b/bgfx/shaders/dx9/fs_ntsc_decode.bin Binary files differindex 1ebb9526280..e31c3548b83 100644 --- a/bgfx/shaders/dx9/fs_ntsc_decode.bin +++ b/bgfx/shaders/dx9/fs_ntsc_decode.bin diff --git a/bgfx/shaders/gles/fs_ntsc_decode.bin b/bgfx/shaders/gles/fs_ntsc_decode.bin Binary files differindex 42be06119d1..cb4ddcdb7b4 100644 --- a/bgfx/shaders/gles/fs_ntsc_decode.bin +++ b/bgfx/shaders/gles/fs_ntsc_decode.bin diff --git a/bgfx/shaders/glsl/fs_ntsc_decode.bin b/bgfx/shaders/glsl/fs_ntsc_decode.bin Binary files differindex 768cfe694da..2ba4513f445 100644 --- a/bgfx/shaders/glsl/fs_ntsc_decode.bin +++ b/bgfx/shaders/glsl/fs_ntsc_decode.bin diff --git a/bgfx/shaders/metal/fs_ntsc_decode.bin b/bgfx/shaders/metal/fs_ntsc_decode.bin Binary files differindex a3ad6554fe6..5450ff39a71 100644 --- a/bgfx/shaders/metal/fs_ntsc_decode.bin +++ b/bgfx/shaders/metal/fs_ntsc_decode.bin |
