Add bgfx command line options, major shakeup of organization, nw

This commit is contained in:
therealmogminer@gmail.com 2016-03-12 01:31:13 +01:00
parent ad1e6ef899
commit cd8f796df6
184 changed files with 1015 additions and 169 deletions

View File

@ -25,38 +25,38 @@ all:
else
ifeq ($(TARGET), 0)
VS_FLAGS=--platform windows -p vs_3_0 -O 3
FS_FLAGS=--platform windows -p ps_3_0 -O 3
SHADER_PATH=shaders/dx9
VS_FLAGS=--platform windows -p vs_3_0 -O 3 --debug
FS_FLAGS=--platform windows -p ps_3_0 -O 3 --debug
SHADER_PATH=bgfx/shaders/dx9
else
ifeq ($(TARGET), 1)
VS_FLAGS=--platform windows -p vs_4_0 -O 3
FS_FLAGS=--platform windows -p ps_4_0 -O 3
CS_FLAGS=--platform windows -p cs_5_0 -O 1
SHADER_PATH=shaders/dx11
VS_FLAGS=--platform windows -p vs_4_0 -O 3 --debug
FS_FLAGS=--platform windows -p ps_4_0 -O 3 --debug
CS_FLAGS=--platform windows -p cs_5_0 -O 1 --debug
SHADER_PATH=bgfx/shaders/dx11
else
ifeq ($(TARGET), 2)
VS_FLAGS=--platform nacl
FS_FLAGS=--platform nacl
SHADER_PATH=shaders/gles
SHADER_PATH=bgfx/shaders/gles
else
ifeq ($(TARGET), 3)
VS_FLAGS=--platform android
FS_FLAGS=--platform android
CS_FLAGS=--platform android
SHADER_PATH=shaders/gles
SHADER_PATH=bgfx/shaders/gles
else
ifeq ($(TARGET), 4)
VS_FLAGS=--platform linux -p 120
FS_FLAGS=--platform linux -p 120
CS_FLAGS=--platform linux -p 430
SHADER_PATH=shaders/glsl
SHADER_PATH=bgfx/shaders/glsl
else
ifeq ($(TARGET), 5)
VS_FLAGS=--platform osx -p metal
FS_FLAGS=--platform osx -p metal
CS_FLAGS=--platform osx -p metal
SHADER_PATH=shaders/metal
SHADER_PATH=bgfx/shaders/metal
endif
endif
endif

135
bgfx/chains/hlsl.json Normal file
View File

@ -0,0 +1,135 @@
{ "name": "Classic D3D HLSL CRT Simulation",
"author": "Ryan Holtz & ImJezze",
"sliders": [
{ "type": "int_enum", "name": "adjustments", "text": "Enable Adjustments", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
{ "type": "int_enum", "name": "ntsc", "text": "Enable NTSC", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "any", "strings": [ "Off", "On" ] },
{ "type": "float", "name": "a_value", "text": "NTSC A Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "b_value", "text": "NTSC B Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "cc_value", "text": "NTSC Color Carrier (Hz)", "default": 35795454, "max": 36795454, "min": 34795454, "step": 100, "scale": 0.0000001, "format": "%1.7f", "screen": "raster" },
{ "type": "float", "name": "o_value", "text": "NTSC Time Offset", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "p_value", "text": "NTSC Phase Offset", "default": 100, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "scan_time", "text": "NTSC Scanline Duration (uSec)", "default": 526, "max": 1500, "min": 1, "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "float", "name": "notch_width", "text": "NTSC Color Notch Filter Width", "default": 100, "max": 400, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "y_freq_response", "text": "NTSC Y Signal Bandwidth (Hz)", "default": 600, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" },
{ "type": "float", "name": "i_freq_response", "text": "NTSC I Signal Bandwidth (Hz)", "default": 120, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" },
{ "type": "float", "name": "q_freq_response", "text": "NTSC Q Signal Bandwidth (Hz)", "default": 60, "max": 2100, "min": 1, "step": 10, "scale": 0.01, "format": "%2.2f", "screen": "raster" },
{ "type": "float", "name": "jitter_offset", "text": "NTSC Frame Jitter Offset", "default": 0, "max": 200, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "color", "name": "red_ratios", "text": "Red Output from ", "default": [ 100, 0, 0 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "color", "name": "grn_ratios", "text": "Green Output from ", "default": [ 0, 100, 0 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "color", "name": "blu_ratios", "text": "Blue Output from ", "default": [ 0, 0, 100 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "color", "name": "offset", "text": "Signal Offset, ", "default": [ 0, 0, 0 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "color", "name": "scale", "text": "Signal Scale, ", "default": [ 100, 100, 100 ], "max": [ 200, 200, 200 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "saturation", "text": "Color Saturation", "default": 100, "max": 400, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "vec2", "name": "converge_red", "text": "Red Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "vec2", "name": "converge_green", "text": "Green Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "vec2", "name": "converge_blue", "text": "Blue Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "vec2", "name": "radial_converge_red", "text": "Red Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "vec2", "name": "radial_converge_green", "text": "Green Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "vec2", "name": "radial_converge_blue", "text": "Blue Convergence, ", "default": [ 0, 0 ], "max": [ 8000, 6000 ], "min": [ -8000, -6000 ], "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" }
],
"parameters": [
{ "name": "jitter", "type": "frame", "period": 2 }
],
"targets": [
{
"name": "guest",
"mode": "guest",
"prescale": 1,
"doublebuffer": true
},
{ "name": "native",
"mode": "native",
"prescale": 1,
"doublebuffer": true
},
{ "name": "previous",
"mode": "native",
"prescale": 1,
"doublebuffer": true
}
],
"passes": [
{ "effect": "ntsc_encode",
"name": "NTSC Decode",
"disablewhen": [
{ "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
{ "type": "slider", "condition": "equal", "combine": "or", "name": "ntsc", "value": 0 }
],
"uniforms": [
{ "uniform": "u_a_value", "slider": "a_value" },
{ "uniform": "u_b_value", "slider": "b_value" },
{ "uniform": "u_cc_value", "slider": "cc_value" },
{ "uniform": "u_p_value", "slider": "p_value" },
{ "uniform": "u_scan_time", "slider": "scan_time" },
{ "uniform": "u_jitter_offset", "slider": "jitter_offset" },
{ "uniform": "u_jitter_amount", "parameter": "jitter" }
],
"input": [
{ "sampler": "DiffuseSampler", "texture": "screen" }
],
"output": "guest"
},
{ "effect": "ntsc_decode",
"name": "NTSC Decode",
"disablewhen": [
{ "type": "slider", "condition": "equal", "combine": "or", "name": "adjustments", "value": 0 },
{ "type": "slider", "condition": "equal", "combine": "or", "name": "ntsc", "value": 0 }
],
"uniforms": [
{ "uniform": "u_a_value", "slider": "a_value" },
{ "uniform": "u_b_value", "slider": "b_value" },
{ "uniform": "u_cc_value", "slider": "cc_value" },
{ "uniform": "u_o_value", "slider": "o_value" },
{ "uniform": "u_scan_time", "slider": "scan_time" },
{ "uniform": "u_notch_width", "slider": "notch_width" },
{ "uniform": "u_y_freq_response", "slider": "y_freq_response" },
{ "uniform": "u_i_freq_response", "slider": "i_freq_response" },
{ "uniform": "u_q_freq_response", "slider": "q_freq_response" },
{ "uniform": "u_q_freq_response", "slider": "q_freq_response" },
{ "uniform": "u_jitter_offset", "slider": "jitter_offset" },
{ "uniform": "u_jitter_amount", "parameter": "jitter" }
],
"input": [
{ "sampler": "DiffuseSampler", "texture": "guest" }
],
"output": "guest"
},
{ "effect": "blit",
"name": "NTSC Skip",
"disablewhen": [
{ "type": "slider", "condition": "notequal", "combine": "and", "name": "adjustments", "value": 0 },
{ "type": "slider", "condition": "notequal", "combine": "and", "name": "ntsc", "value": 0 }
],
"input": [
{ "sampler": "s_tex", "texture": "screen" }
],
"output": "guest"
},
{ "effect": "blit",
"name": "Prescale",
"input": [
{ "sampler": "s_tex", "texture": "guest" }
],
"output": "native"
},
{ "effect": "deconverge",
"name": "Deconvergence",
"uniforms": [
{ "uniform": "u_converge_red", "slider": "converge_red" },
{ "uniform": "u_converge_green", "slider": "converge_green" },
{ "uniform": "u_converge_blue", "slider": "converge_blue" },
{ "uniform": "u_radial_converge_red", "slider": "radial_converge_red" },
{ "uniform": "u_radial_converge_green", "slider": "radial_converge_green" },
{ "uniform": "u_radial_converge_blue", "slider": "radial_converge_blue" }
],
"input": [
{ "sampler": "DiffuseSampler", "texture": "native" }
],
"output": "native"
}
],
"output": "native"
}

View File

@ -11,7 +11,7 @@
{ "type": "vec2", "name": "shift", "text": "Frame Shift ", "default": [ 0, 0 ], "max": [ 25, 25 ], "min": [ -25, -25 ], "step": 1, "scale": 1.0, "format": "%2.f", "screen": "raster" }
],
"parameters": [
{ "name": "alternating", "type": "frame_mask", "period": 2 }
{ "name": "alternating", "type": "frame", "period": 2 }
],
"targets": [
{ "name": "native",

28
bgfx/effects/color.json Normal file
View File

@ -0,0 +1,28 @@
{
"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_color",
"fragment": "fs_color",
"uniforms": [
{ "name": "DiffuseSampler", "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 ] }
]
}

View File

@ -0,0 +1,33 @@
{
"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_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": "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 ] }
]
}

View File

@ -0,0 +1,35 @@
{
"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_ntsc_decode",
"fragment": "fs_ntsc_decode",
"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_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": [ 3.5795454, 0.0, 0.0, 0.0 ] },
{ "name": "u_o_value", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "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 ] }
]
}

View File

@ -0,0 +1,31 @@
{
"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_ntsc_encode",
"fragment": "fs_ntsc_encode",
"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_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": [ 3.5795454, 0.0, 0.0, 0.0 ] },
{ "name": "u_p_value", "type": "vec4", "values": [ 0.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 ] }
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bgfx/shaders/dx9/fs_gui.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bgfx/shaders/dx9/vs_gui.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More