Permalink
Browse files

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.
  • Loading branch information...
1 parent f487ca3 commit 3697bd8cdc9a7fa52759f67cdef0629e1e7876dc @cgwg cgwg committed Jul 3, 2016
Showing with 1,306 additions and 0 deletions.
  1. BIN artwork/bgfx/chains/crt-geom/aperture_1_2_bgr.png
  2. BIN artwork/bgfx/chains/crt-geom/aperture_1_4_rgb.png
  3. BIN artwork/bgfx/chains/crt-geom/aperture_2_4_rgb.png
  4. BIN artwork/bgfx/chains/crt-geom/aperture_2_5_bgr.png
  5. BIN artwork/bgfx/chains/crt-geom/aperture_3_6_rgb.png
  6. BIN artwork/bgfx/chains/crt-geom/delta_1_2x1_bgr.png
  7. BIN artwork/bgfx/chains/crt-geom/delta_1_4x1_rgb.png
  8. BIN artwork/bgfx/chains/crt-geom/delta_2_4x1_rgb.png
  9. BIN artwork/bgfx/chains/crt-geom/delta_2_4x2_rgb.png
  10. BIN artwork/bgfx/chains/crt-geom/none.png
  11. BIN artwork/bgfx/chains/crt-geom/slot_2_4x4_rgb.png
  12. BIN artwork/bgfx/chains/crt-geom/slot_2_5x4_bgr.png
  13. BIN artwork/bgfx/chains/crt-geom/slot_3_7x6_rgb.png
  14. +238 −0 bgfx/chains/crt-geom-deluxe.json
  15. +134 −0 bgfx/chains/crt-geom.json
  16. +43 −0 bgfx/effects/crt-geom/crt-geom-deluxe.json
  17. +41 −0 bgfx/effects/crt-geom/crt-geom.json
  18. +29 −0 bgfx/effects/crt-geom/gaussx.json
  19. +29 −0 bgfx/effects/crt-geom/gaussy.json
  20. +29 −0 bgfx/effects/crt-geom/phosphor_apply.json
  21. +29 −0 bgfx/effects/crt-geom/phosphor_update.json
  22. BIN bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom-deluxe.bin
  23. BIN bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom.bin
  24. BIN bgfx/shaders/dx11/chains/crt-geom/fs_gaussx.bin
  25. BIN bgfx/shaders/dx11/chains/crt-geom/fs_gaussy.bin
  26. BIN bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_apply.bin
  27. BIN bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_update.bin
  28. BIN bgfx/shaders/dx11/chains/crt-geom/vs_crt-geom.bin
  29. BIN bgfx/shaders/dx11/chains/crt-geom/vs_gaussx.bin
  30. BIN bgfx/shaders/dx11/chains/crt-geom/vs_gaussy.bin
  31. BIN bgfx/shaders/dx11/chains/crt-geom/vs_phosphor_apply.bin
  32. BIN bgfx/shaders/dx11/chains/crt-geom/vs_phosphor_update.bin
  33. BIN bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom-deluxe.bin
  34. BIN bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom.bin
  35. BIN bgfx/shaders/dx9/chains/crt-geom/fs_gaussx.bin
  36. BIN bgfx/shaders/dx9/chains/crt-geom/fs_gaussy.bin
  37. BIN bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_apply.bin
  38. BIN bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_update.bin
  39. BIN bgfx/shaders/dx9/chains/crt-geom/vs_crt-geom.bin
  40. BIN bgfx/shaders/dx9/chains/crt-geom/vs_gaussx.bin
  41. BIN bgfx/shaders/dx9/chains/crt-geom/vs_gaussy.bin
  42. BIN bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_apply.bin
  43. BIN bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_update.bin
  44. BIN bgfx/shaders/gles/chains/crt-geom/fs_crt-geom-deluxe.bin
  45. BIN bgfx/shaders/gles/chains/crt-geom/fs_crt-geom.bin
  46. BIN bgfx/shaders/gles/chains/crt-geom/fs_gaussx.bin
  47. BIN bgfx/shaders/gles/chains/crt-geom/fs_gaussy.bin
  48. BIN bgfx/shaders/gles/chains/crt-geom/fs_phosphor_apply.bin
  49. BIN bgfx/shaders/gles/chains/crt-geom/fs_phosphor_update.bin
  50. BIN bgfx/shaders/gles/chains/crt-geom/vs_crt-geom.bin
  51. BIN bgfx/shaders/gles/chains/crt-geom/vs_gaussx.bin
  52. BIN bgfx/shaders/gles/chains/crt-geom/vs_gaussy.bin
  53. BIN bgfx/shaders/gles/chains/crt-geom/vs_phosphor_apply.bin
  54. BIN bgfx/shaders/gles/chains/crt-geom/vs_phosphor_update.bin
  55. BIN bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin
  56. BIN bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin
  57. BIN bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin
  58. BIN bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin
  59. BIN bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin
  60. BIN bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_update.bin
  61. BIN bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin
  62. BIN bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin
  63. BIN bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin
  64. BIN bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin
  65. BIN bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin
  66. BIN bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin
  67. BIN bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin
  68. BIN bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin
  69. BIN bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin
  70. BIN bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin
  71. BIN bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.bin
  72. BIN bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin
  73. BIN bgfx/shaders/metal/chains/crt-geom/vs_gaussx.bin
  74. BIN bgfx/shaders/metal/chains/crt-geom/vs_gaussy.bin
  75. BIN bgfx/shaders/metal/chains/crt-geom/vs_phosphor_apply.bin
  76. BIN bgfx/shaders/metal/chains/crt-geom/vs_phosphor_update.bin
  77. +235 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc
  78. +227 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc
  79. +29 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc
  80. +29 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc
  81. +25 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc
  82. +24 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc
  83. +11 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc
  84. +96 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc
  85. +18 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc
  86. +18 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc
  87. +11 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc
  88. +11 −0 src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,238 @@
+{
+ "name": "CRT-geom",
+ "author": "cgwg",
+ "sliders": [
+ { "type": "float",
+ "name": "aperture_strength",
+ "text": "Shadow mask strength",
+ "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,
+ "max" : 3.0,
+ "min" : 0.5,
+ "step" : 0.05,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "phosphor_amplitude",
+ "text": "Phosphor persistence amplitude",
+ "default": 0.04,
+ "max" : 0.2,
+ "min" : 0.0,
+ "step" : 0.01,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "halation",
+ "text": "Halation amplitude",
+ "default": 0.1,
+ "max" : 0.3,
+ "min" : 0.0,
+ "step" : 0.01,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "blurwidth",
+ "text": "Halation blur width",
+ "default": 2.0,
+ "max" : 4.0,
+ "min" : 0.1,
+ "step" : 0.1,
+ "format": "%1.1f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "curvature",
+ "text": "Enable curvature",
+ "default": 1.0,
+ "max" : 1.0,
+ "min" : 0.0,
+ "step" : 1.0,
+ "format": "%1.0f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "R",
+ "text": "Radius of curvature",
+ "default": 3.5,
+ "max" : 10.0,
+ "min" : 0.5,
+ "step" : 0.1,
+ "format": "%1.1f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "d",
+ "text": "Distance to screen",
+ "default": 2.0,
+ "max" : 10.0,
+ "min" : 0.1,
+ "step" : 0.1,
+ "format": "%1.1f",
+ "screen": "raster" },
+ { "type": "vec2",
+ "name": "angle",
+ "text": "Tilt ",
+ "default": [ 0.0,-0.05 ],
+ "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",
+ "default": 0.01,
+ "max" : 0.10,
+ "min" : 0.00,
+ "step" : 0.01,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "cornersmooth",
+ "text": "Border smoothness",
+ "default": 1000,
+ "max" : 2000,
+ "min" : 100,
+ "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": "float",
+ "name": "CRTgamma",
+ "text": "Gamma of simulated CRT",
+ "default": 2.4,
+ "max" : 4.0,
+ "min" : 0.7,
+ "step" : 0.05,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "monitorgamma",
+ "text": "Gamma of output display",
+ "default": 2.2,
+ "max" : 4.0,
+ "min" : 0.7,
+ "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" }
+ ],
+ "targets": [
+ { "name": "internal1",
+ "mode": "guest"
+ },
+ { "name": "internal2",
+ "mode": "guest"
+ },
+ { "name": "blur",
+ "mode": "guest"
+ },
+ { "name": "phosphor",
+ "mode": "guest"
+ }
+
+ ],
+ "passes": [
+ {
+ "effect": "crt-geom/phosphor_apply",
+ "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"
+ }
+ ]
+}
@@ -0,0 +1,134 @@
+{
+ "name": "CRT-geom",
+ "author": "cgwg",
+ "sliders": [
+ { "type": "float",
+ "name": "aperture_strength",
+ "text": "Shadow mask strength",
+ "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,
+ "max" : 1.0,
+ "min" : 0.0,
+ "step" : 1.0,
+ "format": "%1.0f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "R",
+ "text": "Radius of curvature",
+ "default": 3.5,
+ "max" : 10.0,
+ "min" : 0.5,
+ "step" : 0.1,
+ "format": "%1.1f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "d",
+ "text": "Distance to screen",
+ "default": 2.0,
+ "max" : 10.0,
+ "min" : 0.1,
+ "step" : 0.1,
+ "format": "%1.1f",
+ "screen": "raster" },
+ { "type": "vec2",
+ "name": "angle",
+ "text": "Tilt ",
+ "default": [ 0.0,-0.05 ],
+ "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",
+ "default": 0.01,
+ "max" : 0.10,
+ "min" : 0.00,
+ "step" : 0.01,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "cornersmooth",
+ "text": "Border smoothness",
+ "default": 1000,
+ "max" : 2000,
+ "min" : 100,
+ "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": "float",
+ "name": "CRTgamma",
+ "text": "Gamma of simulated CRT",
+ "default": 2.4,
+ "max" : 4.0,
+ "min" : 0.7,
+ "step" : 0.05,
+ "format": "%1.2f",
+ "screen": "raster" },
+ { "type": "float",
+ "name": "monitorgamma",
+ "text": "Gamma of output display",
+ "default": 2.2,
+ "max" : 4.0,
+ "min" : 0.7,
+ "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" }
+ ],
+ "targets": [
+
+ ],
+ "passes": [
+ {
+ "effect": "crt-geom/crt-geom",
+ "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"
+ }
+ ]
+}
Oops, something went wrong.

0 comments on commit 3697bd8

Please sign in to comment.