HLSL Color Transforms and 3D LUT (#4043)

* Remove broken scanline uniform from post_pass

* Add 3D LUT to HLSL

* Allow individual LUTs for screen and UI

* WIP: Port 3D LUT to BGFX

* Finish porting LUT to BGFX

* Add individual phosphor color conversion for HLSL
	new file:   hlsl/chroma.fx
		Shader for converting xyY3 to sRGB
	modified:   hlsl/phosphor.fx
		Minor changes to emphasize idea that phosphors are color
agnostic
	modified:   hlsl/post.fx
		Conversion from signal RGB to xyY3
	modified:   src/osd/modules/render/d3d/d3dhlsl.cpp
	modified:   src/osd/modules/render/d3d/d3dhlsl.h
	modified:   src/osd/windows/winmain.cpp
	modified:   src/osd/windows/winmain.h

* Add phosphor examples and update presets

* Port phosphor color shaders to BGFX

* Fix missing newlines at EOF
bemani_k573msu_wip
Westley M. Martinez 5 years ago committed by R. Belmont
parent 7b42e2f799
commit b5a54b761c
  1. 183
      bgfx/chains/hlsl.json
  2. 36
      bgfx/chains/lut.json
  3. 33
      bgfx/effects/hlsl/chroma.json
  4. 6
      bgfx/effects/hlsl/post.json
  5. 32
      bgfx/effects/misc/lut.json
  6. BIN
      bgfx/shaders/dx11/chains/hlsl/fs_chroma.bin
  7. BIN
      bgfx/shaders/dx11/chains/hlsl/fs_post.bin
  8. BIN
      bgfx/shaders/dx11/chains/hlsl/vs_chroma.bin
  9. BIN
      bgfx/shaders/dx11/chains/misc/fs_lut.bin
  10. BIN
      bgfx/shaders/dx11/chains/misc/vs_lut.bin
  11. BIN
      bgfx/shaders/dx9/chains/hlsl/fs_chroma.bin
  12. BIN
      bgfx/shaders/dx9/chains/hlsl/fs_post.bin
  13. BIN
      bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin
  14. BIN
      bgfx/shaders/dx9/chains/misc/fs_lut.bin
  15. BIN
      bgfx/shaders/dx9/chains/misc/vs_lut.bin
  16. BIN
      bgfx/shaders/essl/chains/hlsl/fs_chroma.bin
  17. BIN
      bgfx/shaders/essl/chains/hlsl/fs_post.bin
  18. BIN
      bgfx/shaders/essl/chains/hlsl/vs_chroma.bin
  19. BIN
      bgfx/shaders/essl/chains/misc/fs_lut.bin
  20. BIN
      bgfx/shaders/essl/chains/misc/vs_lut.bin
  21. BIN
      bgfx/shaders/glsl/chains/hlsl/fs_chroma.bin
  22. BIN
      bgfx/shaders/glsl/chains/hlsl/fs_post.bin
  23. BIN
      bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin
  24. BIN
      bgfx/shaders/glsl/chains/misc/fs_lut.bin
  25. BIN
      bgfx/shaders/glsl/chains/misc/vs_lut.bin
  26. BIN
      bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
  27. BIN
      bgfx/shaders/metal/chains/hlsl/fs_post.bin
  28. BIN
      bgfx/shaders/metal/chains/hlsl/vs_chroma.bin
  29. BIN
      bgfx/shaders/metal/chains/misc/fs_lut.bin
  30. BIN
      bgfx/shaders/metal/chains/misc/vs_lut.bin
  31. 122
      hlsl/chroma.fx
  32. 41
      hlsl/phosphor.fx
  33. 122
      hlsl/post.fx
  34. 51
      hlsl/primary.fx
  35. 21
      ini/examples/bt601-525.ini
  36. 21
      ini/examples/bt601-625.ini
  37. 16
      ini/examples/bt709.ini
  38. 16
      ini/examples/ntscj.ini
  39. 12
      ini/examples/p1.ini
  40. 15
      ini/examples/p14.ini
  41. 12
      ini/examples/p2.ini
  42. 12
      ini/examples/p3.ini
  43. 12
      ini/examples/p35.ini
  44. 19
      ini/examples/p4.ini
  45. 13
      ini/examples/p55.ini
  46. 15
      ini/examples/p7.ini
  47. 5
      ini/presets/raster.ini
  48. 4
      ini/presets/vector-mono.ini
  49. 5
      ini/presets/vector.ini
  50. 1
      src/osd/modules/lib/osdobj_common.cpp
  51. 2
      src/osd/modules/lib/osdobj_common.h
  52. 11
      src/osd/modules/render/bgfx/chainentryreader.cpp
  53. 38
      src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
  54. 31
      src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc
  55. 14
      src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc
  56. 29
      src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc
  57. 14
      src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc
  58. 177
      src/osd/modules/render/d3d/d3dhlsl.cpp
  59. 26
      src/osd/modules/render/d3d/d3dhlsl.h
  60. 11
      src/osd/windows/winmain.cpp
  61. 20
      src/osd/windows/winmain.h

@ -21,13 +21,13 @@
"sliders": [
// type (required): The sliders's conceptual type. Is it a list of string selections? Is it a single floating-point value? Does it require RGB values, or XY values?
// values: "intenum", "int", "float", "vec2", "color"
//
//
// name (required): The internal name of the slider, used to attach it to entry uniforms.
// value: Any valid ASCII string.
//
//
// text (required): The description of the slider, to which "X" or "Y" is appended for the "vec2" type, and to which "Red", "Green" or "Blue" will be appended for the "color" type.
// value: Any valid user-understandable ASCII string.
//
//
// default (required): The value that this slider should have upon creation.
// type: Either a single integer value or an array of integer values corresponding to the size of the slider type:
// "intenum": Single integer value
@ -35,23 +35,23 @@
// "float": Single integer value
// "vec2": Array of two integer values
// "color": Array of three integer values
//
//
// max (required): The upper limit to which the slider can be adjusted by a user.
// type: See type for "default"
//
//
// min (required): The lower limit to which the slider can be adjusted by a user.
// type: See type for "default"
//
//
// step (required): How much does a single left/right adjustment adjust the slider?
// type: Integer value
//
//
// format (required): A C-style formatting string to use when displaying the slider's value.
// type: Any standard C-style formatting string (%s, %d, %1.2f, and so on)
//
//
// screen (required): The type of screens for which we should populate this slider [NOT YET IMPLEMENTED]
// values: "none", "raster", "vector", "crt", "vectorraster", "lcd", "nonvector", "lcdraster", "lcdvector", "any", "all"
// "crt", "nonvector", and "all" are provided as aliases for "vectorraster", "lcdraster", and "any"
//
//
// 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.
@ -86,8 +86,6 @@
{ "type": "vec2", "name": "defocus", "text": "Defocus, ", "default": [ 0.5, 0.5 ], "max": [ 2.0, 2.0 ], "min": [ 0.0, 0.0 ], "step": 0.1, "format": "%1.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" },
{ "type": "float", "name": "scanline_alpha", "text": "Scanline Amount", "default": 0.50, "max": 1.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "scanline_scale", "text": "Overall Scanline Scale", "default": 1.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "scanline_height", "text": "Individual Scanline Scale", "default": 1.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
@ -96,7 +94,7 @@
{ "type": "float", "name": "scanline_bright_offset", "text": "Scanline Brightness Offset", "default": 1.50, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "scanline_jitter_amount", "text": "Scanline Jitter Amount", "default": 0.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "scanline_variation", "text": "Scanline Variation", "default": 1.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "intenum", "name": "shadow_tile_mode", "text": "Shadow Mask Tile Mode", "default": 0, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Screen", "Source" ] },
{ "type": "float", "name": "shadow_alpha", "text": "Shadow Mask Amount", "default": 0.50, "max": 1.00, "min": 0.00, "step": 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, "format": "%3f", "screen": "crt" },
@ -109,29 +107,40 @@
{ "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": [ 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": "intenum", "name": "chroma_mode", "text": "Color Mode", "default": 3, "max": 3, "min": 1, "step": 1, "format": "%s", "screen": "any", "strings": [ " ", "Monochrome", "Dichrome", "Trichrome" ] },
{ "type": "color", "name": "chroma_conversion_gain", "text": "Chroma Conversion Gain, ", "default": [ 0.299, 0.587, 0.114 ], "max": [ 1.0, 1.0, 1.0 ], "min": [ 0.0, 0.0, 0.0 ], "step": 0.0001, "format": "%1.4f", "screen": "any" },
{ "type": "vec2", "name": "chroma_a", "text": "Phosphor A Chromaticity ", "default": [ 0.630, 0.340 ], "max": [ 1.0, 1.0 ], "min": [ 0.0, 0.0 ], "step": 0.001, "format": "%1.3f", "screen": "any" },
{ "type": "vec2", "name": "chroma_b", "text": "Phosphor B Chromaticity ", "default": [ 0.310, 0.595 ], "max": [ 1.0, 1.0 ], "min": [ 0.0, 0.0 ], "step": 0.001, "format": "%1.3f", "screen": "any" },
{ "type": "vec2", "name": "chroma_c", "text": "Phosphor C Chromaticity ", "default": [ 0.155, 0.070 ], "max": [ 1.0, 1.0 ], "min": [ 0.0, 0.0 ], "step": 0.001, "format": "%1.3f", "screen": "any" },
{ "type": "color", "name": "chroma_y_gain", "text": "Phosphor Gain, ", "default": [ 0.2124, 0.7011, 0.0866 ], "max": [ 1.0, 1.0, 1.0 ], "min": [ 0.0, 0.0, 0.0 ], "step": 0.0001, "format": "%1.4f", "screen": "any" },
{ "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" },
{ "type": "float", "name": "distortion", "text": "Quadric Distortion Amount", "default": 0.05, "max": 2.00, "min": -2.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "float", "name": "cubic_distortion", "text": "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.05, "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.08, "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" }
{ "type": "float", "name": "reflection", "text": "Reflection Amount", "default": 0.05, "max": 2.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "intenum", "name": "lut_enable", "text": "3D LUT", "default": 0, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] }
],
// parameters (optional): A list of procedurally-generated parameters that can be bound to entry uniforms.
"parameters": [
// name (required): The internal name of the parameter that will be used when binding to an entry uniform.
// value: Any valid ASCII string.
//
//
// type (required): The type of the parameter.
// values:
// "frame": Increment by 1 for each rendered frame. Limited to a given value range. Can be use for A/B field jitter and such.
// "window": Contains the index of the window to which this screen belongs.
// "time": The current time, in milliseconds. Can be limited to a given value range.
//
//
// period (required by type "frame"): The range of frames across which to count. A value of 20 will make the value loop from 0-19.
// value: Any integer value.
//
//
// limit (required by type "time"): The range of time across which to loop. 0.0 means run indefinitely.
// value: Any numeric value.
@ -143,21 +152,21 @@
"targets": [
// name (required): The name of the target. Will be used to bind it as a texture and as an output in chain entries.
// value: Any valid ASCII string.
//
//
// mode (required): The mode of the target. Can be used for different implicit and explicit sizing options.
// values:
// "guest": Use the size of the emulated screen that is being processed (e.g. 256x256 when running "targ")
// "native": Use the size of the displayed screen inside the window that is being displayed (the same size as the window size, for single-screen games with no artwork)
// "custom": Use a custom size.
//
//
// bilinear (optional): Whether or not to apply bilinear filtering to this render target.
// values: true, false
// default: true
//
//
// doublebuffer (optional): Whether or not this render target will be needed as a source texture. If you don't know what this means, omit it or set it to true.
// values: true, false
// default: true
//
//
// scale (optional): Multiply the internal size of this render target by this amount. Certain effects benefit from operating at a higher internal resolution. If you're not sure, omit it.
// values: Any integer value
// default: 1
@ -225,19 +234,19 @@
"disablewhen": [
// type (optional): Reserved for future expansion. Currently only "slider" is supported.
// value: "slider"
//
//
// condition (optional): The disabler is active when the named slider is either equal or not equal to the reference value.
// values: "equal", "notequal"
// default: "equal"
//
//
// combine (optional): All "and" conditions are ANDed together, all "or" conditions are OR'd together, then these two
// values are OR'd together to finally determine whether this pass should run or not.
// values: "or", "and"
// default: "or"
//
//
// name (required): The name of the slider to use for this condition.
// value: Any valid ASCII string.
//
//
// value (required): The value against which we are comparing to determine whether this disabler is active.
// type: Either a single integer value or an array of integer values corresponding to the size of the slider's type:
// "intenum": Single integer value
@ -253,15 +262,15 @@
"uniforms": [
// uniform (required): The name of the uniform, as it is referenced in the shader source code itself.
// value: Any valid ASCII string.
//
//
// The remaining options can be one of either "slider", "parameter", or "value":
//
//
// slider (optional): The name of the slider to bind to this uniform.
// value: Any valid ASCII string that corresponds to the name of a slider.
//
// parameter (optional): The name of the dynamic parameter to bind to this uniform.
// value: Any valid ASCII string that corresponds to the name of a parameter.
//
//
// value (optional): An array of numeric values that should be loaded into this uniform.
// values: Should be an array containing anywhere from 1-16 numeric values, corresponding to the size of the uniform's type.
@ -278,28 +287,28 @@
"input": [
// sampler (required): The name of the sampler, as it is referenced in the shader source code itself.
// value: Any valid ASCII string.
//
//
// The remaining options can be one of either "texture", "target", or "option".
//
//
// texture (optional): Either "screen" for the texture that MAME provided for this chain's screen, or the name of a texture file in the artwork directory.
// value: Any valid ASCII string.
//
//
// target (optioanl): Any target from the "targets" list, or "previous" or "output" for two native-sized automatically-generated targets.
// value: Any valid ASCII string that names a target.
//
//
// 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.
//
//
// bilinear (optional, texture and target only): Whether to apply bilinear filtering to the sampler.
// values: true, false
// default: true
//
//
// 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", "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"
// 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": "ntsc"
@ -427,6 +436,36 @@
],
"output": "internal"
},
{ "effect": "hlsl/post",
"name": "Non-Bloom Post Pass",
"disablewhen": [
{ "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "shadow_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "humbar_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "floor", "value": [ 0, 0, 0 ] },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "power", "value": [ 0, 0, 0 ] },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "chroma_mode", "value": 3 }
],
"uniforms": [
{ "uniform": "u_shadow_tile_mode", "slider": "shadow_tile_mode" },
{ "uniform": "u_shadow_alpha", "slider": "shadow_alpha" },
{ "uniform": "u_shadow_count", "slider": "shadow_uv_count" },
{ "uniform": "u_shadow_uv", "slider": "shadow_uv_size" },
{ "uniform": "u_shadow_uv_offset", "slider": "shadow_uv_offset" },
{ "uniform": "u_humbar_alpha", "slider": "humbar_alpha" },
{ "uniform": "u_humbar_hertz_rate", "slider": "humbar_hertz_rate" },
{ "uniform": "u_floor", "slider": "floor" },
{ "uniform": "u_power", "slider": "power" },
{ "uniform": "u_chroma_mode", "slider": "chroma_mode" },
{ "uniform": "u_conversion_gain", "slider": "chroma_conversion_gain" },
{ "uniform": "u_time", "parameter": "time" }
],
"input": [
{ "sampler": "s_tex", "target": "internal" },
{ "sampler": "s_shadow", "option": "bgfx_shadow_mask", "selection": "Shadow Mask" }
],
"output": "internal"
},
{ "effect": "hlsl/phosphor",
"name": "Phosphor Decay",
"disablewhen": [
@ -459,32 +498,22 @@
],
"output": "previous"
},
{ "effect": "hlsl/post",
"name": "Non-Bloom Post Pass",
"disablewhen": [
{ "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "shadow_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "humbar_alpha", "value": 0.0 },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "floor", "value": [ 0, 0, 0 ] },
{ "type": "slider", "condition": "equal", "combine": "and", "name": "power", "value": [ 0, 0, 0 ] }
],
"uniforms": [
{ "uniform": "u_shadow_tile_mode", "slider": "shadow_tile_mode" },
{ "uniform": "u_shadow_alpha", "slider": "shadow_alpha" },
{ "uniform": "u_shadow_count", "slider": "shadow_uv_count" },
{ "uniform": "u_shadow_uv", "slider": "shadow_uv_size" },
{ "uniform": "u_shadow_uv_offset", "slider": "shadow_uv_offset" },
{ "uniform": "u_humbar_alpha", "slider": "humbar_alpha" },
{ "uniform": "u_humbar_hertz_rate", "slider": "humbar_hertz_rate" },
{ "uniform": "u_floor", "slider": "floor" },
{ "uniform": "u_power", "slider": "power" },
{ "uniform": "u_time", "parameter": "time" }
],
"input": [
{ "sampler": "s_tex", "target": "internal" },
{ "sampler": "s_shadow", "option": "bgfx_shadow_mask", "selection": "Shadow Mask" }
],
"output": "internal"
{
"effect": "hlsl/chroma",
"name": "Phosphor Chromaticity Conversion",
"disablewhen": [
{ "type": "slider", "condition": "equal", "name": "adjustments", "value": 0 }
],
"uniforms": [
{ "uniform": "u_y_gain", "slider": "chroma_y_gain" },
{ "uniform": "u_chroma_a", "slider": "chroma_a" },
{ "uniform": "u_chroma_b", "slider": "chroma_b" },
{ "uniform": "u_chroma_c", "slider": "chroma_c" }
],
"input": [
{ "sampler": "s_tex", "target": "internal" }
],
"output": "internal"
},
{ "effect": "hlsl/distortion",
"name": "Distortion Pass",
@ -512,6 +541,40 @@
],
"output": "internal"
},
{
"effect": "misc/lut",
"name": "Apply LUT",
"disablewhen": [
{
"type": "slider",
"condition": "equal",
"combine": "or",
"name": "adjustments",
"value": 0
},
{
"type": "slider",
"condition": "equal",
"combine": "or",
"name": "lut_enable",
"value": 0
}
],
"input": [
{
"sampler": "s_tex",
"target": "internal"
},
{
"sampler": "s_3dlut",
"option": "bgfx_lut",
"bilinear": false,
"clamp": true,
"selection": "LUT Texture"
}
],
"output": "internal"
},
{ "effect": "misc/blit",
"name": "Final Blit",
"input": [

@ -0,0 +1,36 @@
{
"name": "3D LUT",
"author": "W. M. Martinez",
"targets": [
{
"name": "temp",
"mode": "guest"
}
],
"passes": [
{
"effect": "misc/blit",
"name": "Copy To Filtered Texture",
"input": [
{ "sampler": "s_tex", "texture": "screen" }
],
"output": "temp"
}, {
"effect": "misc/lut",
"name": "Apply LUT",
"input": [
{
"sampler": "s_tex",
"target": "temp"
}, {
"sampler": "s_3dlut",
"option": "bgfx_lut",
"bilinear": false,
"clamp": true,
"selection": "LUT Texture"
}
],
"output": "output"
}
]
}

@ -0,0 +1,33 @@
// license:BSD-3-Clause
// copyright-holders:W. M. Martinez
//============================================================
//
// chroma.json: Phosphor chromaticity conversion
//
//============================================================
{
"blend": {
"equation": "add",
"srcColor": "srcalpha",
"dstColor": "1-srcalpha",
"srcAlpha": "srcalpha",
"dstAlpha": "1-srcalpha"
},
"depth": {
"function": "always"
},
"cull": { "mode": "none" },
"write": {
"rgb": true,
"alpha": true
},
"vertex": "chains/hlsl/vs_chroma",
"fragment": "chains/hlsl/fs_chroma",
"uniforms": [
{ "name": "s_tex", "type": "int", "values": [ 0.0 ] },
{ "name": "u_y_gain", "type": "vec4", "values": [ 0.2124, 0.7011, 0.0866, 0.0 ] },
{ "name": "u_chroma_a", "type": "vec4", "values": [ 0.630, 0.340, 0.0, 0.0 ] },
{ "name": "u_chroma_b", "type": "vec4", "values": [ 0.310, 0.595, 0.0, 0.0 ] },
{ "name": "u_chroma_c", "type": "vec4", "values": [ 0.155, 0.070, 0.0, 0.0 ] }
]
}

@ -42,6 +42,8 @@
{ "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.25, 0.0, 0.0 ] },
{ "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_power", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] },
{ "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
{ "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_chroma_mode", "type": "vec4", "values": [ 3.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_conversion_gain", "type": "vec4", "values": [ 0.299, 0.587, 0.114, 0.0 ] }
]
}
}

@ -0,0 +1,32 @@
{
"blend": {
"equation": "add",
"srcColor": "srcalpha",
"dstColor": "1-srcalpha",
"srcAlpha": "srcalpha",
"dstAlpha": "1-srcalpha"
},
"depth": {
"function": "always"
},
"cull": {
"mode": "none"
},
"write": {
"rgb": true,
"alpha": true
},
"vertex": "chains/misc/vs_lut",
"fragment": "chains/misc/fs_lut",
"uniforms": [
{
"name": "s_tex",
"type": "int",
"values": [ 1.0 ]
}, {
"name": "s_3dlut",
"type": "int",
"values": [ 1.0 ]
}
]
}

@ -0,0 +1,122 @@
// license:BSD-3-Clause
// copyright-holders:W. M. Martinez
//-----------------------------------------------------------------------------
// Phosphor Chromaticity to sRGB Transform Effect
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Sampler Definitions
//-----------------------------------------------------------------------------
texture Diffuse;
sampler DiffuseSampler = sampler_state
{
Texture = <Diffuse>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};
//-----------------------------------------------------------------------------
// Vertex Definitions
//-----------------------------------------------------------------------------
struct VS_OUTPUT
{
float4 Position : POSITION;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
float2 PrevCoord : TEXCOORD1;
};
struct VS_INPUT
{
float3 Position : POSITION;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
};
struct PS_INPUT
{
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
float2 PrevCoord : TEXCOORD1;
};
//-----------------------------------------------------------------------------
// Chroma Vertex Shader
//-----------------------------------------------------------------------------
uniform float2 ScreenDims;
uniform float2 TargetDims;
uniform bool Passthrough;
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0.0;
Output.Position = float4(Input.Position.xyz, 1.0);
Output.Position.xy /= ScreenDims;
Output.Position.y = 1.0 - Output.Position.y; // flip y
Output.Position.xy -= 0.5; // center
Output.Position.xy *= 2.0; // zoom
Output.TexCoord = Input.TexCoord;
Output.TexCoord += 0.5 / TargetDims; // half texel offset correction (DX9)
Output.PrevCoord = Output.TexCoord;
Output.Color = Input.Color;
return Output;
}
//-----------------------------------------------------------------------------
// Chroma Pixel Shader
//-----------------------------------------------------------------------------
uniform float3 YGain = float3(0.2126, 0.7152, 0.0722);
uniform float2 ChromaA = float2(0.630, 0.340);
uniform float2 ChromaB = float2(0.310, 0.595);
uniform float2 ChromaC = float2(0.155, 0.070);
static const float3x3 XYZ_TO_sRGB = {
3.2406, -1.5372, -0.4986,
-0.9689, 1.8758, 0.0415,
0.0557, -0.2040, 1.0570
};
float4 ps_main(PS_INPUT Input) : COLOR
{
const float4 cin = tex2D(DiffuseSampler, Input.TexCoord);
float4 cout = float4(0.0, 0.0, 0.0, cin.a);
const float3x2 xy = { ChromaA, ChromaB, ChromaC };
for (int i = 0; i < 3; ++i) {
const float Y = YGain[i] * cin[i];
const float X = xy[i].x * (Y / xy[i].y);
const float Z = (1.0 - xy[i].x - xy[i].y) * (Y / xy[i].y);
cout.rgb += mul(XYZ_TO_sRGB, float3(X, Y, Z));
}
return cout;
}
//-----------------------------------------------------------------------------
// Phosphor Technique
//-----------------------------------------------------------------------------
technique DefaultTechnique
{
pass Pass0
{
Lighting = FALSE;
VertexShader = compile vs_2_0 vs_main();
PixelShader = compile ps_2_0 ps_main();
}
}

@ -71,16 +71,16 @@ uniform bool Passthrough;
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
VS_OUTPUT Output = (VS_OUTPUT)0.0;
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position = float4(Input.Position.xyz, 1.0);
Output.Position.xy /= ScreenDims;
Output.Position.y = 1.0f - Output.Position.y; // flip y
Output.Position.xy -= 0.5f; // center
Output.Position.xy *= 2.0f; // zoom
Output.Position.y = 1.0 - Output.Position.y; // flip y
Output.Position.xy -= 0.5; // center
Output.Position.xy *= 2.0; // zoom
Output.TexCoord = Input.TexCoord;
Output.TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9)
Output.TexCoord += 0.5 / TargetDims; // half texel offset correction (DX9)
Output.PrevCoord = Output.TexCoord;
@ -93,24 +93,23 @@ VS_OUTPUT vs_main(VS_INPUT Input)
// Phosphor Pixel Shader
//-----------------------------------------------------------------------------
uniform float3 Phosphor = float3(0.0f, 0.0f, 0.0f);
uniform float DeltaTime = 0.0f;
static const float F = 30.0f;
uniform float DeltaTime = 0.0;
uniform float3 Phosphor = float3(0.0, 0.0, 0.0);
static const float F = 30.0;
float4 ps_main(PS_INPUT Input) : COLOR
{
float4 CurrPix = tex2D(DiffuseSampler, Input.TexCoord);
float3 PrevPix = tex2D(PreviousSampler, Input.PrevCoord).rgb;
PrevPix.r *= Phosphor.r == 0 ? 0 : pow(Phosphor.r, F * DeltaTime);
PrevPix.g *= Phosphor.g == 0 ? 0 : pow(Phosphor.g, F * DeltaTime);
PrevPix.b *= Phosphor.b == 0 ? 0 : pow(Phosphor.b, F * DeltaTime);
float RedMax = max(CurrPix.r, PrevPix.r);
float GreenMax = max(CurrPix.g, PrevPix.g);
float BlueMax = max(CurrPix.b, PrevPix.b);
return Passthrough ?
CurrPix : float4(RedMax, GreenMax, BlueMax, CurrPix.a);
float4 CurrY = tex2D(DiffuseSampler, Input.TexCoord);
float3 PrevY = tex2D(PreviousSampler, Input.PrevCoord).rgb;
PrevY[0] *= Phosphor[0] == 0.0 ? 0.0 : pow(Phosphor[0], F * DeltaTime);
PrevY[1] *= Phosphor[1] == 0.0 ? 0.0 : pow(Phosphor[1], F * DeltaTime);
PrevY[2] *= Phosphor[2] == 0.0 ? 0.0 : pow(Phosphor[2], F * DeltaTime);
float a = max(PrevY[0], CurrY[0]);
float b = max(PrevY[1], CurrY[1]);
float c = max(PrevY[2], CurrY[2]);
return Passthrough ? CurrY : float4(a, b, c, CurrY.a);
}
//-----------------------------------------------------------------------------

@ -4,6 +4,10 @@
// Shadowmask Effect
//-----------------------------------------------------------------------------
#define MONOCHROME 1
#define DICHROME 2
#define TRICHROME 3
//-----------------------------------------------------------------------------
// Sampler Definitions
//-----------------------------------------------------------------------------
@ -64,8 +68,8 @@ struct PS_INPUT
// Constants
//-----------------------------------------------------------------------------
static const float PI = 3.1415927f;
static const float HalfPI = PI * 0.5f;
static const float PI = 3.1415927;
static const float HalfPI = PI * 0.5;
//-----------------------------------------------------------------------------
// Shadowmask Vertex Shader
@ -77,8 +81,8 @@ uniform float2 TargetDims;
uniform float2 TargetScale;
uniform float2 QuadDims;
uniform float2 ShadowDims = float2(32.0f, 32.0f); // size of the shadow texture (extended to power-of-two size)
uniform float2 ShadowUVOffset = float2(0.0f, 0.0f);
uniform float2 ShadowDims = float2(32.0, 32.0); // size of the shadow texture (extended to power-of-two size)
uniform float2 ShadowUVOffset = float2(0.0, 0.0);
uniform bool SwapXY = false;
@ -89,16 +93,16 @@ VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position = float4(Input.Position.xyz, 1.0);
Output.Position.xy /= ScreenDims;
Output.Position.y = 1.0f - Output.Position.y; // flip y
Output.Position.xy -= 0.5f; // center
Output.Position.xy *= 2.0f; // zoom
Output.Position.y = 1.0 - Output.Position.y; // flip y
Output.Position.xy -= 0.5; // center
Output.Position.xy *= 2.0; // zoom
Output.TexCoord = Input.TexCoord;
Output.TexCoord += PrepareBloom
? 0.0f // use half texel offset (DX9) to do the blur for first bloom layer
: 0.5f / TargetDims; // fix half texel offset (DX9)
? 0.0 // use half texel offset (DX9) to do the blur for first bloom layer
: 0.5 / TargetDims; // fix half texel offset (DX9)
Output.ScreenCoord = Input.Position.xy / ScreenDims;
@ -111,34 +115,37 @@ VS_OUTPUT vs_main(VS_INPUT Input)
// Shadowmask Pixel Shader
//-----------------------------------------------------------------------------
uniform float HumBarDesync = 60.0f / 59.94f - 1.0f; // difference between the 59.94 Hz field rate and 60 Hz line frequency (NTSC)
uniform float HumBarAlpha = 0.0f;
uniform float HumBarDesync = 60.0 / 59.94 - 1.0; // difference between the 59.94 Hz field rate and 60 Hz line frequency (NTSC)
uniform float HumBarAlpha = 0.0;
uniform float TimeMilliseconds = 0.0f;
uniform float TimeMilliseconds = 0.0;
uniform float2 ScreenScale = float2(1.0f, 1.0f);
uniform float2 ScreenOffset = float2(0.0f, 0.0f);
uniform float2 ScreenScale = float2(1.0, 1.0);
uniform float2 ScreenOffset = float2(0.0, 0.0);
uniform float3 BackColor = float3(0.0f, 0.0f, 0.0f);
uniform float3 BackColor = float3(0.0, 0.0, 0.0);
uniform int ShadowTileMode = 0; // 0 based on screen (quad) dimension, 1 based on source dimension
uniform float ShadowAlpha = 0.0f;
uniform float2 ShadowCount = float2(6.0f, 6.0f);
uniform float2 ShadowUV = float2(0.25f, 0.25f);
uniform float ShadowAlpha = 0.0;
uniform float2 ShadowCount = float2(6.0, 6.0);
uniform float2 ShadowUV = float2(0.25, 0.25);
uniform float3 Power = float3(1.0, 1.0, 1.0);
uniform float3 Floor = float3(0.0, 0.0, 0.0);
uniform float3 Power = float3(1.0f, 1.0f, 1.0f);
uniform float3 Floor = float3(0.0f, 0.0f, 0.0f);
uniform int ChromaMode = 3;
uniform float3 ConversionGain = float3(0.0, 0.0, 0.0);
float2 GetAdjustedCoords(float2 coord)
{
// center coordinates
coord -= 0.5f;
coord -= 0.5;
// apply screen scale
coord *= ScreenScale;
// un-center coordinates
coord += 0.5f;
coord += 0.5;
// apply screen offset
coord += ScreenOffset;
@ -158,8 +165,8 @@ float2 GetShadowCoord(float2 TargetCoord, float2 SourceCoord)
? TargetCoord + ShadowUVOffset / BaseTargetDims
: SourceCoord + ShadowUVOffset / SourceDims;
float2 canvasTexelDims = ShadowTileMode == 0
? 1.0f / BaseTargetDims
: 1.0f / SourceDims;
? 1.0 / BaseTargetDims
: 1.0 / SourceDims;
float2 shadowDims = ShadowDims;
float2 shadowUV = ShadowUV;
@ -186,8 +193,8 @@ float2 GetShadowCoord(float2 TargetCoord, float2 SourceCoord)
float2 shadowCoord = (shadowFrac * shadowUV);
shadowCoord += ShadowTileMode == 0
? 0.5f / shadowDims // fix half texel offset (DX9)
: 0.0f;
? 0.5 / shadowDims // fix half texel offset (DX9)
: 0.0;
return shadowCoord;
}
@ -199,29 +206,14 @@ float4 ps_main(PS_INPUT Input) : COLOR
// Color
float4 BaseColor = tex2D(DiffuseSampler, BaseCoord);
BaseColor.a = 1.0f;
BaseColor.a = 1.0;
// clip border
if (BaseCoord.x < 0.0f || BaseCoord.y < 0.0f ||
BaseCoord.x > 1.0f || BaseCoord.y > 1.0f)
if (BaseCoord.x < 0.0 || BaseCoord.y < 0.0 ||
BaseCoord.x > 1.0 || BaseCoord.y > 1.0)
{
// we don't use the clip function, because we don't clear the render target before
return float4(0.0f, 0.0f, 0.0f, 1.0f);
}
// Mask Simulation (may not affect bloom)
if (!PrepareBloom && ShadowAlpha > 0.0f)
{
float2 ShadowCoord = GetShadowCoord(ScreenCoord, BaseCoord);
float4 ShadowColor = tex2D(ShadowSampler, ShadowCoord);
float3 ShadowMaskColor = lerp(1.0f, ShadowColor.rgb, ShadowAlpha);
float ShadowMaskClear = (1.0f - ShadowColor.a) * ShadowAlpha;
// apply shadow mask color
BaseColor.rgb *= ShadowMaskColor;
// clear shadow mask by background color
BaseColor.rgb = lerp(BaseColor.rgb, BackColor, ShadowMaskClear);
return float4(0.0, 0.0, 0.0, 1.0);
}
// Color Compression (may not affect bloom)
@ -236,16 +228,36 @@ float4 ps_main(PS_INPUT Input) : COLOR
BaseColor.g = pow(BaseColor.g, Power.g);
BaseColor.b = pow(BaseColor.b, Power.b);
// Scanline Simulation (may not affect bloom)
if (!PrepareBloom)
// Hum Bar Simulation (may not affect vector screen)
if (!PrepareBloom && !VectorScreen && HumBarAlpha > 0.0)
{
// Hum Bar Simulation (may not affect vector screen)
if (!VectorScreen && HumBarAlpha > 0.0f)
{
float HumBarStep = frac(TimeMilliseconds * HumBarDesync);
float HumBarBrightness = 1.0 - frac(BaseCoord.y + HumBarStep) * HumBarAlpha;
BaseColor.rgb *= HumBarBrightness;
}
float HumBarStep = frac(TimeMilliseconds * HumBarDesync);
float HumBarBrightness = 1.0 - frac(BaseCoord.y + HumBarStep) * HumBarAlpha;
BaseColor.rgb *= HumBarBrightness;
}
// Mask Simulation (may not affect bloom)
if (!PrepareBloom && ShadowAlpha > 0.0)
{
float2 ShadowCoord = GetShadowCoord(ScreenCoord, BaseCoord);
float4 ShadowColor = tex2D(ShadowSampler, ShadowCoord);
float3 ShadowMaskColor = lerp(1.0, ShadowColor.rgb, ShadowAlpha);
float ShadowMaskClear = (1.0 - ShadowColor.a) * ShadowAlpha;
// apply shadow mask color
BaseColor.rgb *= ShadowMaskColor;
// clear shadow mask by background color
BaseColor.rgb = lerp(BaseColor.rgb, BackColor, ShadowMaskClear);
}
// Preparation for phosphor color conversion
if (ChromaMode == MONOCHROME) {
BaseColor.r = dot(ConversionGain, BaseColor.rgb);
BaseColor.gb = float2(BaseColor.r, BaseColor.r);
} else if (ChromaMode == DICHROME) {
BaseColor.r = dot(ConversionGain.rg, BaseColor.rg);
BaseColor.g = BaseColor.r;
}
return BaseColor;

@ -1,14 +1,23 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
// copyright-holders:Ryan Holtz, W. M. Martinez
//-----------------------------------------------------------------------------
// Primary Effect
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Macros
//-----------------------------------------------------------------------------
#define LUT_TEXTURE_WIDTH 4096.0f
#define LUT_SIZE 64.0f
#define LUT_SCALE float2(1.0f / LUT_TEXTURE_WIDTH, 1.0f / LUT_SIZE)
//-----------------------------------------------------------------------------
// Sampler Definitions
//-----------------------------------------------------------------------------
texture Diffuse;
texture LutTexture;
sampler DiffuseSampler = sampler_state
{
@ -21,6 +30,35 @@ sampler DiffuseSampler = sampler_state
AddressW = CLAMP;
};
sampler2D LutSampler = sampler_state
{
Texture = <LutTexture>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};
//-----------------------------------------------------------------------------
// Utilities
//-----------------------------------------------------------------------------
float3 apply_lut(float3 color)
{
// NOTE: Do not change the order of parameters here.
float3 lutcoord = float3((color.rg * (LUT_SIZE - 1.0f) + 0.5f) *
LUT_SCALE, color.b * (LUT_SIZE - 1.0f));
float shift = floor(lutcoord.z);
lutcoord.x += shift * LUT_SCALE.y;
color.rgb = lerp(tex2D(LutSampler, lutcoord.xy).rgb, tex2D(LutSampler,
float2(lutcoord.x + LUT_SCALE.y, lutcoord.y)).rgb,
lutcoord.z - shift);
return color;
}
//-----------------------------------------------------------------------------
// Vertex Definitions
//-----------------------------------------------------------------------------
@ -49,7 +87,7 @@ struct PS_INPUT
// Primary Vertex Shaders
//-----------------------------------------------------------------------------
static const float Epsilon = 1.0e-7f;
//static const float Epsilon = 1.0e-7f;
uniform float2 ScreenDims;
uniform float2 TargetDims;
@ -112,10 +150,15 @@ VS_OUTPUT vs_ui_main(VS_INPUT Input)
// Primary Pixel Shaders
//-----------------------------------------------------------------------------
uniform bool LutEnable;
uniform bool UiLutEnable;
float4 ps_screen_main(PS_INPUT Input) : COLOR
{
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
if (LutEnable)
BaseTexel.rgb = apply_lut(BaseTexel.rgb);
return BaseTexel;
}
@ -123,6 +166,8 @@ float4 ps_vector_buffer_main(PS_INPUT Input) : COLOR
{
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
if (LutEnable)
BaseTexel.rgb = apply_lut(BaseTexel.rgb);
return BaseTexel;
}
@ -131,6 +176,8 @@ float4 ps_ui_main(PS_INPUT Input) : COLOR
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
BaseTexel *= Input.Color;
if (UiLutEnable)
BaseTexel.rgb = apply_lut(BaseTexel.rgb);
return BaseTexel;
}

@ -0,0 +1,21 @@
# Example for BT.601 525-line Color Space
#
# BT.601 is a standard for converting analog video into the digital domain,
# and serves as a reference for the color space of analog video, but the color
# spaces defined existed before the standard.
#
# Due to historical differences, there are two color spaces in BT.601: one for
# 525-line television (developed in the U.S.), and one for 625-line television
# (developed in Europe). The color spaces, along with NTSC-J, converged upon
# the development of HD television with the BT.709 standard.
#
# This color space should be used for most 60 Hz arcade systems, consoles, and
# computer systems.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 3
chroma_a 0.630,0.340
chroma_b 0.310,0.595
chroma_c 0.155,0.070
chroma_y_gain 0.2124,0.7011,0.0866

@ -0,0 +1,21 @@
# Example for BT.601 625-line Color Space
#
# BT.601 is a standard for converting analog video into the digital domain,
# and serves as a reference for the color space of analog video, but the color
# spaces defined existed before the standard.
#
# Due to historical differences, there are two color spaces in BT.601: one for
# 525-line television (developed in the U.S.), and one for 625-line television
# (developed in Europe). The color spaces, along with NTSC-J, converged upon
# the development of HD television with the BT.709 standard.
#
# This color space should be used for most 50 Hz arcade systems, consoles, and
# computer systems.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 3
chroma_a 0.64,0.33
chroma_b 0.29,0.60
chroma_c 0.15,0.06
chroma_y_gain 0.2220,0.7067,0.0713

@ -0,0 +1,16 @@
# Example for BT.709 Color Space
#
# BT.709 was standardized in 1990 for HD television. The color space for
# BT.709 would later be used for sRGB, the color space used for modern
# operating systems.
#
# This color space should be used for post-1995 computer systems and HD game
# systems.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 3
chroma_a 0.64,0.33
chroma_b 0.30,0.60
chroma_c 0.15,0.06
chroma_y_gain 0.2126,0.7152,0.0722

@ -0,0 +1,16 @@
# Example for NTSC-J Color Space
#
# NTSC-J has identical colorimetry to the BT.601 525-line standard, but uses a
# 9300K white-point 'D93'. Note that this white point is not necessarily
# definitive for all Japanese works.
#
# This color space may be used for 60 Hz arcade systems and consoles as an
# alternative to BT.601 525-line.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 3
chroma_a 0.630,0.340
chroma_b 0.310,0.595
chroma_c 0.155,0.070
chroma_gain 0.1875,0.6940,0.1185

@ -0,0 +1,12 @@
# P1 Phosphor
#
# Multipurpose green phosphor
#
# Perhaps the most well-known phosphor, it has medium persistence.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 1
chroma_a 0.218,0.712
chroma_conversion_gain 0.30,0.59,0.11
chroma_y_gain 1.0,0.0,0.0

@ -0,0 +1,15 @@
# P14 Phosphor
#
# Dual-color phosphor for military RADAR
#
# Red channel should be set to medium-short persistence. Green
# channel should be set to medium.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
phosphor_life 0.2,0.6,0.0
chroma_mode 1
chroma_a 0.150,0.093
chroma_b 0.504,0.443
chroma_conversion_gain 0.30,0.59,0.11
chroma_y_gain 0.50,0.50,0.0

@ -0,0 +1,12 @@
# P2 Phosphor
#
# Green phosphor for oscilloscopes
#
# This phosphor was developed as a fast response alternative to P1.
#
# DIRECT3D POST-PROCESSING OPTIONS
#
chroma_mode 1
chroma_a 0.279,0.534
chroma_conversion_gain 0.30,0.59,0.11
chroma_y_gain 1.0,0.0,0.0

@ -0,0 +1,12 @@
# P3 Phosphor
#
# Amber phosphor for monochrome monitors
#
# Medium persistence
#
# DIRECT3D POST-PROCESSING OPTIONS<