diff options
Diffstat (limited to 'bgfx')
-rw-r--r-- | bgfx/chains/test.json | 30 | ||||
-rw-r--r-- | bgfx/effects/blit.json | 22 | ||||
-rw-r--r-- | bgfx/effects/phosphor.json | 25 | ||||
-rw-r--r-- | bgfx/effects/ratios.json | 26 | ||||
-rw-r--r-- | bgfx/effects/tint.json | 24 |
5 files changed, 112 insertions, 15 deletions
diff --git a/bgfx/chains/test.json b/bgfx/chains/test.json index d5b815ca3fc..bc5603a18f2 100644 --- a/bgfx/chains/test.json +++ b/bgfx/chains/test.json @@ -1,5 +1,5 @@ -{ "name": "Test Shader Chain" - "author": "Ryan Holtz" +{ "name": "Test Shader Chain", + "author": "Ryan Holtz", "sliders": [ { "type": "bool", "name": "adjustments", "text": "Enable Adjustments", "default": false }, { "type": "float", "name": "ratio_amount", "text": "Ratio Amount", "default": 0, "max": 1, "min": 0 }, @@ -7,25 +7,25 @@ { "type": "color", "name": "red_ratios", "text": "Red Amount", "default": [ 1, 0, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }, { "type": "color", "name": "grn_ratios", "text": "Green Amount", "default": [ 0, 1, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }, { "type": "color", "name": "blu_ratios", "text": "Blue Amount", "default": [ 0, 0, 1 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }, - { "type": "color", "name": "tint": "text": "Tint", "default": [ 1, 1, 1 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] } - { "type": "color", "name": "phosphor", "text": "Phosphor Amount", "default": [ 0, 0, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0 ,0 ] }, + { "type": "color", "name": "tint", "text": "Tint", "default": [ 1, 1, 1 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }, + { "type": "color", "name": "phosphor", "text": "Phosphor Amount", "default": [ 0, 0, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }, { "type": "vec2", "name": "shift", "text": "Frame Shift", "default": [ 0, 0 ], "max": [ 25, 25 ], "min": [ -25, -25 ] } - ] + ], "parameters": [ { "name": "alternating", "type": "frame_mask", "period": 2 } - ] + ], "targets": [ { "name": "native", - "screen": true, + "screen": true }, { "name": "previous", "screen": true, "prescale": true } - ] + ], "passes": [ { "effect": "ratios", - "name": "Matrix Pass" + "name": "Matrix Pass", "disable_conditions": [ { "type": "slider", "name": "adjustments", "value": false }, { "type": "slider", "name": "ratio_amount", "value": 0 } @@ -42,7 +42,7 @@ "output": "native" }, { "effect": "tint", - "name": "Tint Pass" + "name": "Tint Pass", "disable_conditions": [ { "type": "slider", "name": "adjustments", "value": false } ], @@ -55,14 +55,14 @@ ], "output": "native" }, - { "effect": "phosphor" + { "effect": "phosphor", "name": "Phosphor Decay", "disable_conditions": [ { "type": "slider", "name": "adjustments", "value": false }, { "type": "slider", "name": "phosphor", "value": [ 0, 0, 0 ] } ], "uniforms": [ - { "name": "u_passthrough", "value": [ 0.0f ] }, + { "name": "u_passthrough", "value": [ 0 ] }, { "name": "u_phosphor", "slider": "phosphor" } ], "input": [ @@ -71,14 +71,14 @@ ], "output": "native" }, - { "effect": "phosphor" + { "effect": "phosphor", "name": "Phosphor Store", "disable_conditions": [ { "type": "slider", "name": "adjustments", "value": false }, { "type": "slider", "name": "phosphor", "value": [ 0, 0, 0 ] } ], "uniforms": [ - { "name": "u_passthrough", "value": [ 1.0f ] }, + { "name": "u_passthrough", "value": [ 1 ] }, { "name": "u_phosphor", "slider": "phosphor" } ], "input": [ @@ -87,7 +87,7 @@ ], "output": "previous" }, - { "effect": "blit" + { "effect": "blit", "name": "Final Blit", "input": [ { "sampler": "s_tex", "texture": "native" } diff --git a/bgfx/effects/blit.json b/bgfx/effects/blit.json new file mode 100644 index 00000000000..2d2d281df62 --- /dev/null +++ b/bgfx/effects/blit.json @@ -0,0 +1,22 @@ +{ + "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": "vs_blit", + "fragment": "fs_blit", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/phosphor.json b/bgfx/effects/phosphor.json new file mode 100644 index 00000000000..0efbad997de --- /dev/null +++ b/bgfx/effects/phosphor.json @@ -0,0 +1,25 @@ +{ + "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": "vs_phosphor", + "fragment": "fs_phosphor", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_prev", "type": "int", "values": [ 1.0 ] }, + { "name": "u_passthrough", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor", "type": "vec4", "values": [ 0.7, 0.7, 0.7, 0.0 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/ratios.json b/bgfx/effects/ratios.json new file mode 100644 index 00000000000..0949172b0c9 --- /dev/null +++ b/bgfx/effects/ratios.json @@ -0,0 +1,26 @@ +{ + "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": "vs_ratios", + "fragment": "fs_ratios", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 1.0 ] }, + { "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 1.0 ] }, + { "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 1.0 ] }, + { "name": "u_ratio_amount", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/tint.json b/bgfx/effects/tint.json new file mode 100644 index 00000000000..19cd7687f15 --- /dev/null +++ b/bgfx/effects/tint.json @@ -0,0 +1,24 @@ +{ + "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": "vs_tint", + "fragment": "fs_tint", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }, + { "name": "u_shift", "type": "vec4", "values": [ 0.1, 0.1, 0.0, 0.0 ] } + ] +}
\ No newline at end of file |