diff options
author | 2016-03-28 22:58:16 +0200 | |
---|---|---|
committer | 2016-03-28 22:58:32 +0200 | |
commit | c0b118271258cae30a9eaff517e91c1d8c96231e (patch) | |
tree | a8fd89ccf05a0733f542289464e906ea0b8fcf64 /bgfx/effects/hlsl | |
parent | 68ebc2b0e5b454c848f5343f16afacca8135674b (diff) |
Final bgfx fixups for release
Diffstat (limited to 'bgfx/effects/hlsl')
-rw-r--r-- | bgfx/effects/hlsl/LICENSE | 27 | ||||
-rw-r--r-- | bgfx/effects/hlsl/README.md | 5 | ||||
-rw-r--r-- | bgfx/effects/hlsl/blit.json | 121 | ||||
-rw-r--r-- | bgfx/effects/hlsl/color.json | 35 | ||||
-rw-r--r-- | bgfx/effects/hlsl/deconverge.json | 37 | ||||
-rw-r--r-- | bgfx/effects/hlsl/defocus.json | 31 | ||||
-rw-r--r-- | bgfx/effects/hlsl/distortion.json | 40 | ||||
-rw-r--r-- | bgfx/effects/hlsl/ntsc_decode.json | 42 | ||||
-rw-r--r-- | bgfx/effects/hlsl/ntsc_encode.json | 38 | ||||
-rw-r--r-- | bgfx/effects/hlsl/phosphor.json | 33 | ||||
-rw-r--r-- | bgfx/effects/hlsl/post.json | 53 | ||||
-rw-r--r-- | bgfx/effects/hlsl/prescale.json | 32 |
12 files changed, 494 insertions, 0 deletions
diff --git a/bgfx/effects/hlsl/LICENSE b/bgfx/effects/hlsl/LICENSE new file mode 100644 index 00000000000..e1a4f1f53d6 --- /dev/null +++ b/bgfx/effects/hlsl/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/hlsl/README.md b/bgfx/effects/hlsl/README.md new file mode 100644 index 00000000000..72aad88f861 --- /dev/null +++ b/bgfx/effects/hlsl/README.md @@ -0,0 +1,5 @@ +# **BGFX shader effects** # + +Cointains definitions for BGFX shader effects + +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/hlsl/blit.json b/bgfx/effects/hlsl/blit.json new file mode 100644 index 00000000000..bbc9fd295d4 --- /dev/null +++ b/bgfx/effects/hlsl/blit.json @@ -0,0 +1,121 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//============================================================ +// +// blit.json: A simple texture-to-target copy. +// +//============================================================ +{ + // blend (required): The blend state for this effect. + "blend": { + // equation (optional): What equation to perform on the source and destination blend values. + // values: "add", "sub", "revSub", "min", "max" + // default: "add" + // + // "subtract" and "revSubtract" are provided as aliases for "sub" and "revSub" + "equation": "add", + + // blend function parameters (optional): What factors to use in the blend function when calculating the final pixel. + // values: "0", "1", "srcColor", "1-srcColor", "dstColor", "1-dstColor", "srcAlpha", "1-srcAlpha", "dstAlpha", "1-dstAlpha" + // defaults (srcColor, srcAlpha): "1" + // defaults (dstColor, dstAlpha): "0" + // + // "zero", "one", "invSrcColor", "invDstColor", "invSrcAlpha", and "invDstAlpha" are provided as aliases for "0", "1", "1-srcColor", "1-dstColor", "1-srcAlpha", and "1-dstAlpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + + // depth (required): The depth state for this effect. + "depth": { + // function (optional): The depth function to use when drawing. + // values: "never", "less", "equal", "lequal", "greater", "notequal", "gequal", "always" + // default: "always" + "function": "always", + + // writeenable (optional): Whether to store Z-buffer data. + // values: true, false + // default: false + "writeenable": false + }, + + // cull (required): The cull mode for this effect. + "cull": { + // mode (optional): What winding, if any, to cull. + // values: "none", "cw", "ccw" + // default: "ccw" + // + // "clockwise" and "counterclockwise" are provided as aliases for "cw" and "ccw" + "mode": "none" + }, + + // write (required): Write enable for color and alpha channels. + "write": { + // rgb (optional): Whether to store color data when drawing. + // values: true, false + // default: false + "rgb": true, + + // alpha (optional): Whether to store alpha data when drawing. + // values: true, false + // default: false + "alpha": true + }, + + // vertex (required): The vertex shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "vertex": "vs_blit", + + // pixel/fragment (required): The pixel or fragment shader to use when drawing. + // value: A string containing the name of a shader file to use, minus the extension. + "fragment": "fs_blit", + + // uniforms (required): The list of uniforms for this effect. Can be empty, but must exist. + "uniforms": [ + { + // name (required): The name of the uniform, as used in either the vertex or pixel/fragment shader. + // value: A string containing the name of the uniform as described above. + // + // NOTE: Some names correspond to special values that will be automatically filled by the BGFX + // code if they are used by the shader. These names are: + // "u_screen_dims" + // The dimensions of the first texture input if present, otherwise the dimensions of the output window. + // Valid values: xy + // "u_inv_screen_dims" + // The reciprocal of u_screen_dims. + // Valid values: xy + // "u_source_dims" + // The size, in pixels, of the screen texture incoming to the chain. + // Valid values: xy + // "u_rotation_type" + // This screen's rotation type. 0 if ROT0, 1 if ROT90, 2 if ROT180, 3 of ROT270. + // Valid values: x + // "u_swap_xy" + // Whether this screen is swapped on the X and Y axes. 1 if true, 0 if false. + // Valid values: x + // "u_quad_dims" + // The dimensions, in pixels, occupied by this one screen primitive itself in the output window. + // Valid values: xy + // "u_tex_sizeN" + // The dimensions, in pixels, of the texture in input pair N. Starts at 0. + // valid values: xy + "name": "s_tex", + + // type (required): The type of the uniform. + // values: "int", "vec4", "mat3", "mat4" + // + // Note: "int" should only be used for samplers. + "type": "int", + + // values (required): The array of numbers with which to initialize the uniform. + // value: A JSON array containin the correct amount of numbers to initialize a uniform of the + // above-specified type. The following size rules should be followed: + // "int": 1 float + // "vec4": 4 floats + // "mat3": 9 floats + // "mat4": 16 floats + "values": [ 1.0 ] + } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/hlsl/color.json b/bgfx/effects/hlsl/color.json new file mode 100644 index 00000000000..5a033140233 --- /dev/null +++ b/bgfx/effects/hlsl/color.json @@ -0,0 +1,35 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// color.json: Color aberration shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_color", + "fragment": "fs_color", + "uniforms": [ + { "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": [ 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/hlsl/deconverge.json b/bgfx/effects/hlsl/deconverge.json new file mode 100644 index 00000000000..dafd2fb630e --- /dev/null +++ b/bgfx/effects/hlsl/deconverge.json @@ -0,0 +1,37 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// deconverge.json: Electron-gun misalignment shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_deconverge", + "fragment": "fs_deconverge", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_size", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.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 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/hlsl/defocus.json b/bgfx/effects/hlsl/defocus.json new file mode 100644 index 00000000000..7ba4b2cec49 --- /dev/null +++ b/bgfx/effects/hlsl/defocus.json @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// defocus.json: Foucs adjustment shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_defocus", + "fragment": "fs_defocus", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "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/hlsl/distortion.json b/bgfx/effects/hlsl/distortion.json new file mode 100644 index 00000000000..e8bbac16095 --- /dev/null +++ b/bgfx/effects/hlsl/distortion.json @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:ImJezze +//============================================================ +// +// distortion.json: Output distortion shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_distortion", + "fragment": "fs_distortion", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 0.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_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_rotation_type", "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 ] }, + { "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 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/hlsl/ntsc_decode.json b/bgfx/effects/hlsl/ntsc_decode.json new file mode 100644 index 00000000000..208f35b0ff3 --- /dev/null +++ b/bgfx/effects/hlsl/ntsc_decode.json @@ -0,0 +1,42 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// ntsc_decode.json: Composite NTSC decoder shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_ntsc_decode", + "fragment": "fs_ntsc_decode", + "uniforms": [ + { "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/hlsl/ntsc_encode.json b/bgfx/effects/hlsl/ntsc_encode.json new file mode 100644 index 00000000000..8ff193398b2 --- /dev/null +++ b/bgfx/effects/hlsl/ntsc_encode.json @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// ntsc_encode.json: Composite NTSC encoder shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_ntsc_encode", + "fragment": "fs_ntsc_encode", + "uniforms": [ + { "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/hlsl/phosphor.json b/bgfx/effects/hlsl/phosphor.json new file mode 100644 index 00000000000..aaa3c12f727 --- /dev/null +++ b/bgfx/effects/hlsl/phosphor.json @@ -0,0 +1,33 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// phosphor.json: Phosphor persistence shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "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/hlsl/post.json b/bgfx/effects/hlsl/post.json new file mode 100644 index 00000000000..c4a86da84e5 --- /dev/null +++ b/bgfx/effects/hlsl/post.json @@ -0,0 +1,53 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz,ImJezze +//============================================================ +// +// post.json: Scanline, hum-bar, shadow-mask, and final +// color convolution shader for CRT simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_post", + "fragment": "fs_post", + "uniforms": [ + { "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_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, + { "name": "u_quad_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, + { "name": "u_humbar_hertz_rate", "type": "vec4", "values": [ 0.001, 0.0, 0.0, 0.0 ] }, + { "name": "u_humbar_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_bright_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_bright_offset", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_jitter", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_height", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_variation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_amount", "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": [ 12.0, 12.0, 0.0, 0.0 ] }, + { "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 ] } + ] +}
\ No newline at end of file diff --git a/bgfx/effects/hlsl/prescale.json b/bgfx/effects/hlsl/prescale.json new file mode 100644 index 00000000000..a636c4316e0 --- /dev/null +++ b/bgfx/effects/hlsl/prescale.json @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:ImJezze +//============================================================ +// +// prescale.json: Unfiltered upscale shader for CRT +// simulation. +// +//============================================================ +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { + "function": "always" + }, + "cull": { "mode": "none" }, + "write": { + "rgb": true, + "alpha": true + }, + "vertex": "vs_prescale", + "fragment": "fs_prescale", + "uniforms": [ + { "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_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + ] +}
\ No newline at end of file |