summaryrefslogtreecommitdiffstatshomepage
path: root/bgfx
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-04-29 06:58:09 +0200
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-04-29 06:58:20 +0200
commit223a955d0b045729edab22c6f9f69d2324918ef4 (patch)
tree2ed2ed7596cdeecf2ff75adcf9fda9bea4147720 /bgfx
parent41a489a94769b19e10c91b27934bf9351d53b4f1 (diff)
Fix up bgfx NTSC shader, nw
Diffstat (limited to 'bgfx')
-rw-r--r--bgfx/chains/hlsl.json35
-rw-r--r--bgfx/effects/hlsl/ntsc_encode.json8
2 files changed, 27 insertions, 16 deletions
diff --git a/bgfx/chains/hlsl.json b/bgfx/chains/hlsl.json
index e99c7195b76..50d5e8517a4 100644
--- a/bgfx/chains/hlsl.json
+++ b/bgfx/chains/hlsl.json
@@ -55,9 +55,9 @@
// strings (optional): A list of strings to use with the "intenum" type, to select from a list of text options instead of simply numbers.
// value: An array of 2 or more entries, with one entry per possible slider setting from "min" to "max" inclusive.
- { "type": "intenum", "name": "adjustments", "text": "Enable Adjustments", "default": 0, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
+ { "type": "intenum", "name": "adjustments", "text": "Enable Adjustments", "default": 1, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
- { "type": "intenum", "name": "ntsc", "text": "Enable NTSC", "default": 0, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
+ { "type": "intenum", "name": "ntsc", "text": "Enable NTSC", "default": 1, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
{ "type": "float", "name": "a_value", "text": "NTSC A Value", "default": 0.50, "max": 1.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "b_value", "text": "NTSC B Value", "default": 0.50, "max": 1.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "cc_value", "text": "NTSC Color Carrier (Hz)", "default": 3.57954, "max": 3.67954, "min": 3.47954, "step": 0.00001, "format": "%1.5f", "screen": "raster" },
@@ -84,7 +84,7 @@
{ "type": "vec2", "name": "radial_converge_green", "text": "Green Radial Convergence, ", "default": [ 0.0, 0.0 ], "max": [ 10.0, 10.0 ], "min": [ -10.0, -10.0 ], "step": 0.1, "format": "%2.1f", "screen": "raster" },
{ "type": "vec2", "name": "radial_converge_blue", "text": "Blue Radial Convergence, ", "default": [ 0.0, 0.0 ], "max": [ 10.0, 10.0 ], "min": [ -10.0, -10.0 ], "step": 0.1, "format": "%2.1f", "screen": "raster" },
- { "type": "vec2", "name": "defocus", "text": "Defocus, ", "default": [ 1.5, 1.5 ], "max": [ 10.0, 10.0 ], "min": [ 0.0, 0.0 ], "step": 0.1, "format": "%2.1f", "screen": "crt" },
+ { "type": "vec2", "name": "defocus", "text": "Defocus, ", "default": [ 0.5, 0.5 ], "max": [ 10.0, 10.0 ], "min": [ 0.0, 0.0 ], "step": 0.1, "format": "%2.1f", "screen": "crt" },
{ "type": "color", "name": "phosphor", "text": "Phosphor Persistence, ", "default": [ 0.45, 0.45, 0.45 ], "max": [ 1.00, 1.00, 1.00 ], "min": [ 0.00, 0.00, 0.00 ], "step": 0.01, "format": "%1.2f", "screen": "crt" },
@@ -102,19 +102,19 @@
{ "type": "vec2", "name": "shadow_uv_size", "text": "Shadow Mask UV Size ", "default": [ 0.500, 0.500 ], "max": [ 1.000, 1.000 ], "min": [ 0.000, 0.000 ], "step": 0.001, "format": "%1.3f", "screen": "crt" },
{ "type": "vec2", "name": "shadow_uv_offset", "text": "Shadow Mask UV Offset ", "default": [ 0.000, 0.000 ], "max": [ 1.000, 1.000 ], "min": [ 0.000, 0.000 ], "step": 0.001, "format": "%1.3f", "screen": "crt" },
- { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 0.05, "max": 1.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 0.0, "max": 1.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "humbar_hertz_rate", "text": "Hum Bar Frequency", "default": 0.001, "max": 1.000, "min": 0.000, "step": 0.00001, "format": "%1.5f", "screen": "crt" },
{ "type": "color", "name": "floor", "text": "Signal Floor, ", "default": [ 0.05, 0.05, 0.05 ], "max": [ 1.00, 1.00, 1.00 ], "min": [ 0.00, 0.00, 0.00 ], "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "color", "name": "power", "text": "Signal Exponent, ", "default": [ 0.80, 0.80, 0.80 ], "max": [ 4.00, 4.00, 4.00 ], "min": [ 0.00, 0.00, 0.00 ], "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "color", "name": "power", "text": "Signal Exponent, ", "default": [ 1.00, 1.00, 1.00 ], "max": [ 4.00, 4.00, 4.00 ], "min": [ 0.00, 0.00, 0.00 ], "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "distortion", "text": "Screen Distortion Amount", "default": 0.20, "max": 2.00, "min": -2.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "distortion", "text": "Screen Distortion Amount", "default": 0.10, "max": 2.00, "min": -2.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "cubic_distortion", "text": "Screen Cubic Distortion Amount", "default": 0.00, "max": 2.00, "min": -2.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "distort_corner", "text": "Distorted Corner Amount", "default": 0.20, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "round_corner", "text": "Rounded Corner Amount", "default": 0.15, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "smooth_border", "text": "Smooth Border Amount", "default": 0.05, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "vignetting", "text": "Vignetting Amount", "default": 0.20, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
- { "type": "float", "name": "reflection", "text": "Reflection Amount", "default": 0.15, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" }
+ { "type": "float", "name": "distort_corner", "text": "Distorted Corner Amount", "default": 0.10, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "round_corner", "text": "Rounded Corner Amount", "default": 0.05, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "smooth_border", "text": "Smooth Border Amount", "default": 0.03, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "vignetting", "text": "Vignetting Amount", "default": 0.10, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "reflection", "text": "Reflection Amount", "default": 0.05, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" }
],
// parameters (optional): A list of procedurally-generated parameters that can be bound to entry uniforms.
@@ -185,6 +185,17 @@
// passes (required): The list of individual shaders to invoke, and any dynamic input parameters they need.
"passes": [
+ { "effect": "misc/blit",
+ "name": "Blit to filterable surface for NTSC",
+ "disablewhen": [
+ { "type": "slider", "condition": "equal", "combine": "and", "name": "adjustments", "value": 0 },
+ { "type": "slider", "condition": "equal", "combine": "and", "name": "ntsc", "value": 0 }
+ ],
+ "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.
@@ -284,7 +295,7 @@
//
// selection (optional, option and texture only): Determines the name of the selection and alowes to select other textures in the same directory as the specified texture file.
// values: Any valid ASCII string.
- { "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"
diff --git a/bgfx/effects/hlsl/ntsc_encode.json b/bgfx/effects/hlsl/ntsc_encode.json
index 680c14c5931..694dce91fd9 100644
--- a/bgfx/effects/hlsl/ntsc_encode.json
+++ b/bgfx/effects/hlsl/ntsc_encode.json
@@ -9,10 +9,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcalpha",
- "dstColor": "1-srcalpha",
- "srcAlpha": "srcalpha",
- "dstAlpha": "1-srcalpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"