diff options
author | cgwg <cgwg@users.noreply.github.com> | 2021-02-21 04:47:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-21 14:47:28 +1100 |
commit | 92b292175429c88a0c993636575e662f5844855d (patch) | |
tree | ad6de6d98a57582bea1a7e50ab43a711548a9e7f /bgfx | |
parent | 0c20cabef6952635219244793167a3d227e3a1b2 (diff) |
bgfx: crt-geom and crt-geom-deluxe enhancements (#7766)
Added a "brightness boost" feature for the shadow mask that works by making the brightness ratio between bright and dark mask pixels closer to 1 for the brighter parts of the image.
Added clamping to zero so that underscanning produces a black border.
Added a "raster bloom" effect to crt-geom-deluxe that makes the image grow slightly when the average brightness of the screen is high, mimicking a common defect in CRTs.
Diffstat (limited to 'bgfx')
-rw-r--r-- | bgfx/chains/crt-geom-deluxe.json | 293 | ||||
-rw-r--r-- | bgfx/chains/crt-geom.json | 121 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/crt-geom-deluxe.json | 62 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/crt-geom.json | 55 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/gaussx.json | 30 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/gaussy.json | 30 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/mipmap8.json | 29 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/phosphor_apply.json | 30 | ||||
-rw-r--r-- | bgfx/effects/crt-geom/phosphor_update.json | 30 | ||||
-rw-r--r-- | bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin | bin | 7142 -> 10255 bytes | |||
-rw-r--r-- | bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin | bin | 6832 -> 9221 bytes | |||
-rw-r--r-- | bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin | bin | 0 -> 19483 bytes | |||
-rw-r--r-- | bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin | bin | 0 -> 308 bytes |
13 files changed, 382 insertions, 298 deletions
diff --git a/bgfx/chains/crt-geom-deluxe.json b/bgfx/chains/crt-geom-deluxe.json index d71df646d7b..0eabc4ac399 100644 --- a/bgfx/chains/crt-geom-deluxe.json +++ b/bgfx/chains/crt-geom-deluxe.json @@ -12,6 +12,15 @@ "format": "%1.2f", "screen": "raster" }, { "type": "float", + "name": "aperture_brightboost", + "text": "Shadow mask brightness boost", + "default": 0.4, + "max" : 1.0, + "min" : 0.0, + "step" : 0.05, + "format": "%1.2f", + "screen": "raster" }, + { "type": "float", "name": "phosphor_power", "text": "Phosphor decay power", "default": 1.2, @@ -30,6 +39,24 @@ "format": "%1.2f", "screen": "raster" }, { "type": "float", + "name": "rasterbloom_smooth", + "text": "Raster bloom temporal smoothing", + "default": 0.5, + "max" : 0.99, + "min" : 0.0, + "step" : 0.01, + "format": "%1.2f", + "screen": "raster" }, + { "type": "float", + "name": "rasterbloom", + "text": "Raster bloom amplitude", + "default": 0.01, + "max" : 0.1, + "min" : 0.0, + "step" : 0.001, + "format": "%1.3f", + "screen": "raster" }, + { "type": "float", "name": "halation", "text": "Halation amplitude", "default": 0.1, @@ -74,15 +101,15 @@ "step" : 0.1, "format": "%1.1f", "screen": "raster" }, - { "type": "vec2", - "name": "angle", - "text": "Tilt ", - "default": [ 0.0, 0.0 ], - "max" : [ 1.0, 1.0 ], - "min" : [-1.0,-1.0 ], - "step" : 0.01, - "format": "%1.2f", - "screen": "raster" }, + { "type": "vec2", + "name": "angle", + "text": "Tilt ", + "default": [ 0.0, 0.0 ], + "max" : [ 1.0, 1.0 ], + "min" : [-1.0,-1.0 ], + "step" : 0.01, + "format": "%1.2f", + "screen": "raster" }, { "type": "float", "name": "cornersize", "text": "Rounded corner size", @@ -101,15 +128,15 @@ "step" : 100, "format": "%1.0f", "screen": "raster" }, - { "type": "vec2", - "name": "overscan", - "text": "Overscan ", - "default": [ 1.0, 1.0 ], - "max" : [ 1.2, 1.2 ], - "min" : [ 0.8, 0.8 ], - "step" : 0.02, - "format": "%1.2f", - "screen": "raster" }, + { "type": "vec2", + "name": "overscan", + "text": "Overscan ", + "default": [ 1.0, 1.0 ], + "max" : [ 1.2, 1.2 ], + "min" : [ 0.8, 0.8 ], + "step" : 0.02, + "format": "%1.2f", + "screen": "raster" }, { "type": "float", "name": "CRTgamma", "text": "Gamma of simulated CRT", @@ -128,112 +155,128 @@ "step" : 0.05, "format": "%1.2f", "screen": "raster" }, - { "type": "vec2", - "name": "aspect", - "text": "Aspect ratio ", - "default": [ 1.0, 0.75 ], - "max" : [ 1.0, 1.0 ], - "min" : [ 0.3, 0.3 ], - "step" : 0.01, - "format": "%1.2f", - "screen": "raster" } + { "type": "vec2", + "name": "aspect", + "text": "Aspect ratio ", + "default": [ 1.0, 0.75 ], + "max" : [ 1.0, 1.0 ], + "min" : [ 0.3, 0.3 ], + "step" : 0.01, + "format": "%1.2f", + "screen": "raster" } + ], + "targets": [ + { "name": "internal1", + "mode": "guest" + }, + { "name": "internal2", + "mode": "guest" + }, + { "name": "mipmap", + "mode": "guest" + }, + { "name": "blur", + "mode": "guest" + }, + { "name": "phosphor", + "mode": "guest" + } ], - "targets": [ - { "name": "internal1", - "mode": "guest" - }, - { "name": "internal2", - "mode": "guest" - }, - { "name": "blur", - "mode": "guest" - }, - { "name": "phosphor", - "mode": "guest" - } - - ], - "passes": [ - { - "effect": "crt-geom/phosphor_apply", - "applytint": true, - "name": "phosphor apply", - "uniforms": [ - { "uniform": "u_phosphor_power", "slider": "phosphor_power" }, - { "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" }, - { "uniform": "u_gamma", "slider": "CRTgamma" } - ], - "input": [ - { "sampler": "s_screen", "target": "screen" }, - { "sampler": "s_phosphor", "target": "phosphor" } - ], - "output": "internal1" - }, - { - "effect": "crt-geom/phosphor_update", - "name": "phosphor update", - "uniforms": [ - { "uniform": "u_phosphor_power", "slider": "phosphor_power" }, - { "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" }, - { "uniform": "u_gamma", "slider": "CRTgamma" } - ], - "input": [ - { "sampler": "s_screen", "target": "screen" }, - { "sampler": "s_phosphor", "target": "phosphor" } - ], - "output": "phosphor" - }, - { - "effect": "crt-geom/gaussx", - "name": "Gaussian blur x", - "uniforms": [ - { "uniform": "u_width", "slider": "blurwidth" }, - { "uniform": "u_aspect","slider": "aspect" }, - { "uniform": "u_gamma", "slider": "CRTgamma" } - ], - "input": [ - { "sampler": "s_tex", "target": "internal1" } - ], - "output": "internal2" - }, - { - "effect": "crt-geom/gaussy", - "name": "Gaussian blur y", - "uniforms": [ - { "uniform": "u_width", "slider": "blurwidth" }, - { "uniform": "u_aspect","slider": "aspect" }, - { "uniform": "u_gamma", "slider": "CRTgamma" } - ], - "input": [ - { "sampler": "s_tex", "target": "internal2" } - ], - "output": "blur" - }, - { - "effect": "crt-geom/crt-geom-deluxe", - "name": "CRT", - "uniforms": [ - { "uniform": "curvature", "slider": "curvature" }, - { "uniform": "R", "slider": "R" }, - { "uniform": "d", "slider": "d" }, - { "uniform": "angle", "slider": "angle" }, - { "uniform": "cornersize", "slider": "cornersize" }, - { "uniform": "cornersmooth","slider": "cornersmooth" }, - { "uniform": "overscan", "slider": "overscan" }, - { "uniform": "aspect", "slider": "aspect" }, - { "uniform": "CRTgamma", "slider": "CRTgamma" }, - { "uniform": "monitorgamma","slider": "monitorgamma" }, - { "uniform": "aperture_strength","slider": "aperture_strength" }, - { "uniform": "halation", "slider": "halation" } - ], - - "input": [ - { "sampler": "mpass_texture", "target": "internal1" }, - { "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" }, - { "sampler": "blur_texture", "target": "blur" } - ], - - "output": "output" - } - ] + "passes": [ + { + "effect": "crt-geom/phosphor_apply", + "applytint": true, + "name": "phosphor apply", + "uniforms": [ + { "uniform": "u_phosphor_power", "slider": "phosphor_power" }, + { "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" }, + { "uniform": "u_gamma", "slider": "CRTgamma" } + ], + "input": [ + { "sampler": "s_screen", "target": "screen" }, + { "sampler": "s_phosphor", "target": "phosphor" } + ], + "output": "internal1" + }, + { + "effect": "crt-geom/mipmap8", + "name": "mipmap", + "uniforms": [ + { "uniform": "u_smooth", "slider": "rasterbloom_smooth" } + ], + "input": [ + { "sampler": "s_screen", "target": "internal1" }, + { "sampler": "s_mipmap", "target": "mipmap" } + ], + "output": "mipmap" + }, + { + "effect": "crt-geom/phosphor_update", + "name": "phosphor update", + "uniforms": [ + { "uniform": "u_phosphor_power", "slider": "phosphor_power" }, + { "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" }, + { "uniform": "u_gamma", "slider": "CRTgamma" } + ], + "input": [ + { "sampler": "s_screen", "target": "screen" }, + { "sampler": "s_phosphor", "target": "phosphor" } + ], + "output": "phosphor" + }, + { + "effect": "crt-geom/gaussx", + "name": "Gaussian blur x", + "uniforms": [ + { "uniform": "u_width", "slider": "blurwidth" }, + { "uniform": "u_aspect","slider": "aspect" }, + { "uniform": "u_gamma", "slider": "CRTgamma" } + ], + "input": [ + { "sampler": "s_tex", "target": "internal1" } + ], + "output": "internal2" + }, + { + "effect": "crt-geom/gaussy", + "name": "Gaussian blur y", + "uniforms": [ + { "uniform": "u_width", "slider": "blurwidth" }, + { "uniform": "u_aspect","slider": "aspect" }, + { "uniform": "u_gamma", "slider": "CRTgamma" } + ], + "input": [ + { "sampler": "s_tex", "target": "internal2" } + ], + "output": "blur" + }, + { + "effect": "crt-geom/crt-geom-deluxe", + "name": "CRT", + "uniforms": [ + { "uniform": "curvature", "slider": "curvature" }, + { "uniform": "R", "slider": "R" }, + { "uniform": "d", "slider": "d" }, + { "uniform": "angle", "slider": "angle" }, + { "uniform": "cornersize", "slider": "cornersize" }, + { "uniform": "cornersmooth","slider": "cornersmooth" }, + { "uniform": "overscan", "slider": "overscan" }, + { "uniform": "aspect", "slider": "aspect" }, + { "uniform": "CRTgamma", "slider": "CRTgamma" }, + { "uniform": "monitorgamma","slider": "monitorgamma" }, + { "uniform": "aperture_strength","slider": "aperture_strength" }, + { "uniform": "aperture_brightboost","slider": "aperture_brightboost" }, + { "uniform": "halation", "slider": "halation" }, + { "uniform": "blurwidth", "slider": "blurwidth" }, + { "uniform": "rasterbloom", "slider": "rasterbloom" } + ], + "input": [ + { "sampler": "mpass_texture", "target": "internal1" }, + { "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" }, + { "sampler": "blur_texture", "target": "blur" }, + { "sampler": "mipmap_texture", "target": "mipmap" } + ], + "output": "output" + } + ] } diff --git a/bgfx/chains/crt-geom.json b/bgfx/chains/crt-geom.json index 56e2210cbdb..c8d852e1b9a 100644 --- a/bgfx/chains/crt-geom.json +++ b/bgfx/chains/crt-geom.json @@ -12,6 +12,15 @@ "format": "%1.2f", "screen": "raster" }, { "type": "float", + "name": "aperture_brightboost", + "text": "Shadow mask brightness boost", + "default": 0.4, + "max" : 1.0, + "min" : 0.0, + "step" : 0.05, + "format": "%1.2f", + "screen": "raster" }, + { "type": "float", "name": "curvature", "text": "Enable curvature", "default": 1.0, @@ -38,15 +47,15 @@ "step" : 0.1, "format": "%1.1f", "screen": "raster" }, - { "type": "vec2", - "name": "angle", - "text": "Tilt ", - "default": [ 0.0, 0.0 ], - "max" : [ 1.0, 1.0 ], - "min" : [-1.0,-1.0 ], - "step" : 0.01, - "format": "%1.2f", - "screen": "raster" }, + { "type": "vec2", + "name": "angle", + "text": "Tilt ", + "default": [ 0.0, 0.0 ], + "max" : [ 1.0, 1.0 ], + "min" : [-1.0,-1.0 ], + "step" : 0.01, + "format": "%1.2f", + "screen": "raster" }, { "type": "float", "name": "cornersize", "text": "Rounded corner size", @@ -65,15 +74,15 @@ "step" : 100, "format": "%1.0f", "screen": "raster" }, - { "type": "vec2", - "name": "overscan", - "text": "Overscan ", - "default": [ 1.0, 1.0 ], - "max" : [ 1.2, 1.2 ], - "min" : [ 0.8, 0.8 ], - "step" : 0.02, - "format": "%1.2f", - "screen": "raster" }, + { "type": "vec2", + "name": "overscan", + "text": "Overscan ", + "default": [ 1.0, 1.0 ], + "max" : [ 1.2, 1.2 ], + "min" : [ 0.8, 0.8 ], + "step" : 0.02, + "format": "%1.2f", + "screen": "raster" }, { "type": "float", "name": "CRTgamma", "text": "Gamma of simulated CRT", @@ -92,44 +101,42 @@ "step" : 0.05, "format": "%1.2f", "screen": "raster" }, - { "type": "vec2", - "name": "aspect", - "text": "Aspect ratio ", - "default": [ 1.0, 0.75 ], - "max" : [ 1.0, 1.0 ], - "min" : [ 0.3, 0.3 ], - "step" : 0.01, - "format": "%1.2f", - "screen": "raster" } + { "type": "vec2", + "name": "aspect", + "text": "Aspect ratio ", + "default": [ 1.0, 0.75 ], + "max" : [ 1.0, 1.0 ], + "min" : [ 0.3, 0.3 ], + "step" : 0.01, + "format": "%1.2f", + "screen": "raster" } + ], + "targets": [ ], - "targets": [ - - ], - "passes": [ - { - "effect": "crt-geom/crt-geom", - "applytint": true, - "name": "CRT", - "uniforms": [ - { "uniform": "curvature", "slider": "curvature" }, - { "uniform": "R", "slider": "R" }, - { "uniform": "d", "slider": "d" }, - { "uniform": "angle", "slider": "angle" }, - { "uniform": "cornersize", "slider": "cornersize" }, - { "uniform": "cornersmooth","slider": "cornersmooth" }, - { "uniform": "overscan", "slider": "overscan" }, - { "uniform": "aspect", "slider": "aspect" }, - { "uniform": "CRTgamma", "slider": "CRTgamma" }, - { "uniform": "monitorgamma","slider": "monitorgamma" }, - { "uniform": "aperture_strength", "slider": "aperture_strength" } - ], - - "input": [ - { "sampler": "mpass_texture", "target": "screen" }, - { "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" } - ], - - "output": "output" - } - ] + "passes": [ + { + "effect": "crt-geom/crt-geom", + "applytint": true, + "name": "CRT", + "uniforms": [ + { "uniform": "curvature", "slider": "curvature" }, + { "uniform": "R", "slider": "R" }, + { "uniform": "d", "slider": "d" }, + { "uniform": "angle", "slider": "angle" }, + { "uniform": "cornersize", "slider": "cornersize" }, + { "uniform": "cornersmooth","slider": "cornersmooth" }, + { "uniform": "overscan", "slider": "overscan" }, + { "uniform": "aspect", "slider": "aspect" }, + { "uniform": "CRTgamma", "slider": "CRTgamma" }, + { "uniform": "monitorgamma","slider": "monitorgamma" }, + { "uniform": "aperture_strength", "slider": "aperture_strength" }, + { "uniform": "aperture_brightboost","slider": "aperture_brightboost" } + ], + "input": [ + { "sampler": "mpass_texture", "target": "screen" }, + { "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" } + ], + "output": "output" + } + ] } diff --git a/bgfx/effects/crt-geom/crt-geom-deluxe.json b/bgfx/effects/crt-geom/crt-geom-deluxe.json index f3168d5ff1d..c561db7a9c5 100644 --- a/bgfx/effects/crt-geom/crt-geom-deluxe.json +++ b/bgfx/effects/crt-geom/crt-geom-deluxe.json @@ -1,43 +1,47 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_crt-geom", "fragment": "chains/crt-geom/fs_crt-geom-deluxe", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "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": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, - { "name": "mask_texture", "type": "int", "values": [ 1 ] }, - { "name": "blur_texture", "type": "int", "values": [ 1 ] }, - { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, - { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, - { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, - { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, - { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, - { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, - { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, - { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, - { "name": "halation", "type": "vec4", "values": [ 0.1,0.0,0.0,0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "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": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, + { "name": "mask_texture", "type": "int", "values": [ 1 ] }, + { "name": "blur_texture", "type": "int", "values": [ 2 ] }, + { "name": "mipmap_texture", "type": "int", "values": [ 3 ] }, + { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, + { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, + { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, + { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, + { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, + { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, + { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, + { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, + { "name": "halation", "type": "vec4", "values": [ 0.1,0.0,0.0,0.0 ] }, + { "name": "blurwidth", "type": "vec4", "values": [ 2.0,0.0,0.0,0.0 ] }, + { "name": "rasterbloom","type": "vec4", "values": [ 0.01,0.0,0.0,0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/crt-geom.json b/bgfx/effects/crt-geom/crt-geom.json index fe8e184a4ec..12624942fe7 100644 --- a/bgfx/effects/crt-geom/crt-geom.json +++ b/bgfx/effects/crt-geom/crt-geom.json @@ -1,41 +1,42 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_crt-geom", "fragment": "chains/crt-geom/fs_crt-geom", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "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": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, - { "name": "mask_texture", "type": "int", "values": [ 1 ] }, - { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, - { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, - { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, - { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, - { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, - { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, - { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, - { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "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": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, + { "name": "mask_texture", "type": "int", "values": [ 1 ] }, + { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, + { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, + { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, + { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, + { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, + { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, + { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, + { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/gaussx.json b/bgfx/effects/crt-geom/gaussx.json index 28e9cff1b87..4fc008f7954 100644 --- a/bgfx/effects/crt-geom/gaussx.json +++ b/bgfx/effects/crt-geom/gaussx.json @@ -1,29 +1,29 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_gaussx", "fragment": "chains/crt-geom/fs_gaussx", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/gaussy.json b/bgfx/effects/crt-geom/gaussy.json index 65e324f0930..5f585c85688 100644 --- a/bgfx/effects/crt-geom/gaussy.json +++ b/bgfx/effects/crt-geom/gaussy.json @@ -1,29 +1,29 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_gaussy", "fragment": "chains/crt-geom/fs_gaussy", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/mipmap8.json b/bgfx/effects/crt-geom/mipmap8.json new file mode 100644 index 00000000000..8ae25aa7c1e --- /dev/null +++ b/bgfx/effects/crt-geom/mipmap8.json @@ -0,0 +1,29 @@ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always", + "writeenable": false + }, + "cull": { + "mode": "none" + }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "chains/crt-geom/vs_mipmap8", + "fragment": "chains/crt-geom/fs_mipmap8", + "uniforms": [ + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_smooth", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_mipmap", "type": "int", "values": [ 1 ] } + ] +} diff --git a/bgfx/effects/crt-geom/phosphor_apply.json b/bgfx/effects/crt-geom/phosphor_apply.json index 4353d0d9765..6b073d53a44 100644 --- a/bgfx/effects/crt-geom/phosphor_apply.json +++ b/bgfx/effects/crt-geom/phosphor_apply.json @@ -1,29 +1,29 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_phosphor_apply", "fragment": "chains/crt-geom/fs_phosphor_apply", "uniforms": [ - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, - { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, + { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/phosphor_update.json b/bgfx/effects/crt-geom/phosphor_update.json index c1808c8fb81..8895fef7656 100644 --- a/bgfx/effects/crt-geom/phosphor_update.json +++ b/bgfx/effects/crt-geom/phosphor_update.json @@ -1,29 +1,29 @@ { "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { - "function": "always", - "writeenable": false + "function": "always", + "writeenable": false }, "cull": { - "mode": "none" + "mode": "none" }, "write": { - "rgb": true, - "alpha": true + "rgb": true, + "alpha": true }, "vertex": "chains/crt-geom/vs_phosphor_update", "fragment": "chains/crt-geom/fs_phosphor_update", "uniforms": [ - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, - { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, + { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin Binary files differindex c2beaf0a0bb..0f7b8478413 100644 --- a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin +++ b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin Binary files differindex d9bc7650ad0..b10938c0365 100644 --- a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin +++ b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin Binary files differnew file mode 100644 index 00000000000..be943521f64 --- /dev/null +++ b/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin Binary files differnew file mode 100644 index 00000000000..7e83a3fefbb --- /dev/null +++ b/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin |