summaryrefslogtreecommitdiffstatshomepage
path: root/bgfx/effects
diff options
context:
space:
mode:
author Jeremy Green <cgwg@users.noreply.github.com>2016-07-03 22:43:16 +0200
committer Jeremy Green <cgwg@users.noreply.github.com>2016-07-03 22:43:16 +0200
commit3697bd8cdc9a7fa52759f67cdef0629e1e7876dc (patch)
tree588689c49cc180eeadace7e9e85993028dd11c75 /bgfx/effects
parentf487ca3bcc17fd51d39ef83457da2784af9c9473 (diff)
Added crt-geom and crt-geom-deluxe shaders for bgfx.
This includes several aperture grille / shadow mask patterns. Note that these are all designed to be used on a display with RGB subpixel order, and may thus suffer if rotated or used with a BGR display.
Diffstat (limited to 'bgfx/effects')
-rw-r--r--bgfx/effects/crt-geom/crt-geom-deluxe.json43
-rw-r--r--bgfx/effects/crt-geom/crt-geom.json41
-rw-r--r--bgfx/effects/crt-geom/gaussx.json29
-rw-r--r--bgfx/effects/crt-geom/gaussy.json29
-rw-r--r--bgfx/effects/crt-geom/phosphor_apply.json29
-rw-r--r--bgfx/effects/crt-geom/phosphor_update.json29
6 files changed, 200 insertions, 0 deletions
diff --git a/bgfx/effects/crt-geom/crt-geom-deluxe.json b/bgfx/effects/crt-geom/crt-geom-deluxe.json
new file mode 100644
index 00000000000..f3168d5ff1d
--- /dev/null
+++ b/bgfx/effects/crt-geom/crt-geom-deluxe.json
@@ -0,0 +1,43 @@
+{
+ "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_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 ] }
+ ]
+}
diff --git a/bgfx/effects/crt-geom/crt-geom.json b/bgfx/effects/crt-geom/crt-geom.json
new file mode 100644
index 00000000000..fe8e184a4ec
--- /dev/null
+++ b/bgfx/effects/crt-geom/crt-geom.json
@@ -0,0 +1,41 @@
+{
+ "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_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 ] }
+ ]
+}
diff --git a/bgfx/effects/crt-geom/gaussx.json b/bgfx/effects/crt-geom/gaussx.json
new file mode 100644
index 00000000000..28e9cff1b87
--- /dev/null
+++ b/bgfx/effects/crt-geom/gaussx.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_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 ] }
+ ]
+}
diff --git a/bgfx/effects/crt-geom/gaussy.json b/bgfx/effects/crt-geom/gaussy.json
new file mode 100644
index 00000000000..65e324f0930
--- /dev/null
+++ b/bgfx/effects/crt-geom/gaussy.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_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 ] }
+ ]
+}
diff --git a/bgfx/effects/crt-geom/phosphor_apply.json b/bgfx/effects/crt-geom/phosphor_apply.json
new file mode 100644
index 00000000000..4353d0d9765
--- /dev/null
+++ b/bgfx/effects/crt-geom/phosphor_apply.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_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 ] }
+ ]
+}
diff --git a/bgfx/effects/crt-geom/phosphor_update.json b/bgfx/effects/crt-geom/phosphor_update.json
new file mode 100644
index 00000000000..c1808c8fb81
--- /dev/null
+++ b/bgfx/effects/crt-geom/phosphor_update.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_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 ] }
+ ]
+}