summaryrefslogtreecommitdiffstatshomepage
path: root/bgfx/effects
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-18 03:21:34 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-18 03:21:34 +0100
commitea9e591a0c5d0e16a6d7fcfb4c5eb3e633977993 (patch)
treed0f704b3c19b2a1e3e51ded1efd15b03c1e6ac6b /bgfx/effects
parentd7dc173df9c06660472c7acda3c47cc0d6f0f448 (diff)
Polishing up BGFX shader system, nw
Diffstat (limited to 'bgfx/effects')
-rw-r--r--bgfx/effects/LICENSE27
-rw-r--r--bgfx/effects/README.md5
-rw-r--r--bgfx/effects/bloom_scale.json23
-rw-r--r--bgfx/effects/color.json6
-rw-r--r--bgfx/effects/deconverge.json12
-rw-r--r--bgfx/effects/defocus.json8
-rw-r--r--bgfx/effects/distortion.json14
-rw-r--r--bgfx/effects/ntsc_decode.json26
-rw-r--r--bgfx/effects/ntsc_encode.json18
-rw-r--r--bgfx/effects/post.json12
-rw-r--r--bgfx/effects/ratios.json26
-rw-r--r--bgfx/effects/tint.json25
12 files changed, 76 insertions, 126 deletions
diff --git a/bgfx/effects/LICENSE b/bgfx/effects/LICENSE
new file mode 100644
index 00000000000..e1a4f1f53d6
--- /dev/null
+++ b/bgfx/effects/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2016, Ryan Holtz and MAME Development Team
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of bsd3 nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/bgfx/effects/README.md b/bgfx/effects/README.md
new file mode 100644
index 00000000000..2b165723286
--- /dev/null
+++ b/bgfx/effects/README.md
@@ -0,0 +1,5 @@
+# **Tests** #
+
+Cointains definitions for BGFX shader chains
+
+Licensed under [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) by Ryan Holtz and MAME Development Team
diff --git a/bgfx/effects/bloom_scale.json b/bgfx/effects/bloom_scale.json
deleted file mode 100644
index 5ba081a5a19..00000000000
--- a/bgfx/effects/bloom_scale.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "blend": {
- "equation": "add",
- "srcColor": "1",
- "dstColor": "0",
- "srcAlpha": "1",
- "dstAlpha": "0"
- },
- "depth": {
- "function": "always"
- },
- "cull": { "mode": "none" },
- "write": {
- "rgb": "true",
- "alpha": "true"
- },
- "vertex": "vs_bloom_scale",
- "fragment": "fs_bloom_scale",
- "uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }
- ]
-} \ No newline at end of file
diff --git a/bgfx/effects/color.json b/bgfx/effects/color.json
index 41e38714e9c..df6448631ec 100644
--- a/bgfx/effects/color.json
+++ b/bgfx/effects/color.json
@@ -17,12 +17,12 @@
"vertex": "vs_color",
"fragment": "fs_color",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
{ "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] },
{ "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] },
{ "name": "u_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scale", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] },
- { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }
+ { "name": "u_scale", "type": "vec4", "values": [ 0.95, 0.95, 0.95, 0.0 ] },
+ { "name": "u_saturation", "type": "vec4", "values": [ 1.5, 0.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/deconverge.json b/bgfx/effects/deconverge.json
index 69d67632497..8da0d5434b4 100644
--- a/bgfx/effects/deconverge.json
+++ b/bgfx/effects/deconverge.json
@@ -17,17 +17,13 @@
"vertex": "vs_deconverge",
"fragment": "fs_deconverge",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_texsize", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_screenrect", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_converge_red", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.5, 0.0, 0.0 ] },
{ "name": "u_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_radial_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_radial_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_radial_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_quad_dims", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_guest_dims", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/defocus.json b/bgfx/effects/defocus.json
index ddf8abf1b62..364283f9f48 100644
--- a/bgfx/effects/defocus.json
+++ b/bgfx/effects/defocus.json
@@ -17,10 +17,8 @@
"vertex": "vs_defocus",
"fragment": "fs_defocus",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_screen_dims", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_quad_dims", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_defocus", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_screen_dims", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_defocus", "type": "vec4", "values": [ 0.5, 0.5, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/distortion.json b/bgfx/effects/distortion.json
index e8fcb4722c7..de216b397b2 100644
--- a/bgfx/effects/distortion.json
+++ b/bgfx/effects/distortion.json
@@ -17,13 +17,13 @@
"vertex": "vs_distortion",
"fragment": "fs_distortion",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 0.0 ] },
- { "name": "u_screen_dims", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_curvature", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_round_corner", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_smooth_border", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_vignetting", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_reflection", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "s_tex", "type": "int", "values": [ 0.0 ] },
+ { "name": "u_screen_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
+ { "name": "u_curvature", "type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] },
+ { "name": "u_round_corner", "type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] },
+ { "name": "u_smooth_border", "type": "vec4", "values": [ 0.05, 0.0, 0.0, 0.0 ] },
+ { "name": "u_vignetting", "type": "vec4", "values": [ 0.20, 0.0, 0.0, 0.0 ] },
+ { "name": "u_reflection", "type": "vec4", "values": [ 0.30, 0.0, 0.0, 0.0 ] },
{ "name": "u_rotation_type", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/ntsc_decode.json b/bgfx/effects/ntsc_decode.json
index 89e8288f8b2..0bf1963c85f 100644
--- a/bgfx/effects/ntsc_decode.json
+++ b/bgfx/effects/ntsc_decode.json
@@ -17,18 +17,18 @@
"vertex": "vs_ntsc_decode",
"fragment": "fs_ntsc_decode",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
- { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
- { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 3.5795454, 3.5795454, 3.5795454 ] },
- { "name": "u_o_value", "type": "vec4", "values": [ 1.570796325, 1.570796325, 1.570796325, 1.570796325 ] },
- { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
- { "name": "u_notch_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_y_freq_response", "type": "vec4", "values": [ 6.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_i_freq_response", "type": "vec4", "values": [ 1.2, 0.0, 0.0, 0.0 ] },
- { "name": "u_q_freq_response", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
+ { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
+ { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
+ { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 3.5795454, 3.5795454, 3.5795454 ] },
+ { "name": "u_o_value", "type": "vec4", "values": [ 1.570796325, 1.570796325, 1.570796325, 1.570796325 ] },
+ { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
+ { "name": "u_notch_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_y_freq_response", "type": "vec4", "values": [ 6.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_i_freq_response", "type": "vec4", "values": [ 1.2, 0.0, 0.0, 0.0 ] },
+ { "name": "u_q_freq_response", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/ntsc_encode.json b/bgfx/effects/ntsc_encode.json
index 9cee95af3c3..f635edad14c 100644
--- a/bgfx/effects/ntsc_encode.json
+++ b/bgfx/effects/ntsc_encode.json
@@ -17,14 +17,14 @@
"vertex": "vs_ntsc_encode",
"fragment": "fs_ntsc_encode",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_cc_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_p_value", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
+ { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_cc_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_p_value", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/post.json b/bgfx/effects/post.json
index f73e2a0be7c..21936db55d6 100644
--- a/bgfx/effects/post.json
+++ b/bgfx/effects/post.json
@@ -17,12 +17,11 @@
"vertex": "vs_post",
"fragment": "fs_post",
"uniforms": [
- { "name": "DiffuseSampler", "type": "int", "values": [ 0.0 ] },
- { "name": "ShadowSampler", "type": "int", "values": [ 1.0 ] },
+ { "name": "s_tex", "type": "int", "values": [ 0.0 ] },
+ { "name": "s_shadow", "type": "int", "values": [ 1.0 ] },
{ "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_screen_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_shadow_dims", "type": "vec4", "values": [ 32.0, 32.0, 0.0, 0.0 ] },
+ { "name": "u_screen_dims", "type": "vec4", "values": [ 1336.0, 1002.0, 0.0, 0.0 ] },
+ { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] },
{ "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_prepare_bloom", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_prepare_vector", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
@@ -41,8 +40,7 @@
{ "name": "u_back_color", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_shadow_tile_mode", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_shadow_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_shadow_count", "type": "vec4", "values": [ 6.0, 4.0, 0.0, 0.0 ] },
- { "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.25, 0.0, 0.0 ] },
+ { "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.333, 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 ] }
]
diff --git a/bgfx/effects/ratios.json b/bgfx/effects/ratios.json
deleted file mode 100644
index 7b8af5c1875..00000000000
--- a/bgfx/effects/ratios.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "blend": {
- "equation": "add",
- "srcColor": "1",
- "dstColor": "0",
- "srcAlpha": "1",
- "dstAlpha": "0"
- },
- "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
deleted file mode 100644
index 9b022ebe993..00000000000
--- a/bgfx/effects/tint.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "blend": {
- "equation": "add",
- "srcColor": "1",
- "dstColor": "0",
- "srcAlpha": "1",
- "dstAlpha": "0"
- },
- "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 ] },
- { "name": "u_texsize", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }
- ]
-} \ No newline at end of file