Skip to content

Commit c7a9290

Browse files
bgfx: add vector CRT renderer (#15692)
* bgfx: add vector CRT renderer * docs: Add missing vector CRT screenshots * Fix erroneous indent * bgfx: enable vector CRT rendering by default. Keep -nobgfx_vectorcrt available as an explicit opt-out. * Increase bloom targets from one-third to half resolution to prevent the blur kernel from becoming under-resolved at 1080p. Normalize blur offsets against output resolution to preserve the apparent bloom size. * Adjust default vector bloom settings * bgfx: improve vector CRT bloom sampling
1 parent ceb2c72 commit c7a9290

68 files changed

Lines changed: 1735 additions & 10 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bgfx/README.md

Lines changed: 13 additions & 0 deletions

bgfx/effects/vector-crt/beam.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"blend": { "equation": "add", "srcColor": "1", "dstColor": "1", "srcAlpha": "1", "dstAlpha": "1" },
3+
"depth": { "function": "always", "writeenable": false },
4+
"cull": { "mode": "none" },
5+
"write": { "rgb": true, "alpha": true },
6+
"vertex": "chains/vector-crt/vs_beam",
7+
"fragment": "chains/vector-crt/fs_beam",
8+
"uniforms": [
9+
{ "name": "u_vector_params", "type": "vec4", "values": [ 0.016667, 0.080, 1.25, 0.14 ] },
10+
{ "name": "u_target_dims", "type": "vec4", "values": [ 640.0, 480.0, 0.0015625, 0.0020833 ] }
11+
]
12+
}

bgfx/effects/vector-crt/blur.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"blend": { "equation": "add", "srcColor": "1", "dstColor": "0", "srcAlpha": "1", "dstAlpha": "0" },
3+
"depth": { "function": "always", "writeenable": false },
4+
"cull": { "mode": "none" },
5+
"write": { "rgb": true, "alpha": true },
6+
"vertex": "chains/vector-crt/vs_post",
7+
"fragment": "chains/vector-crt/fs_blur",
8+
"uniforms": [
9+
{ "name": "s_tex", "type": "int", "values": [ 0 ] },
10+
{ "name": "u_blur", "type": "vec4", "values": [ 0.001, 0.0, 0.0, 0.0 ] }
11+
]
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"blend": { "equation": "add", "srcColor": "1", "dstColor": "1", "srcAlpha": "1", "dstAlpha": "1" },
3+
"depth": { "function": "always", "writeenable": false },
4+
"cull": { "mode": "none" },
5+
"write": { "rgb": true, "alpha": false },
6+
"vertex": "chains/vector-crt/vs_post",
7+
"fragment": "chains/vector-crt/fs_composite",
8+
"uniforms": [
9+
{ "name": "s_accum", "type": "int", "values": [ 0 ] },
10+
{ "name": "s_bloom", "type": "int", "values": [ 1 ] },
11+
{ "name": "u_composite", "type": "vec4", "values": [ 0.8, 1.0, 2.2, 0.1 ] }
12+
]
13+
}

bgfx/effects/vector-crt/decay.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"blend": { "equation": "add", "srcColor": "1", "dstColor": "0", "srcAlpha": "1", "dstAlpha": "0" },
3+
"depth": { "function": "always", "writeenable": false },
4+
"cull": { "mode": "none" },
5+
"write": { "rgb": true, "alpha": true },
6+
"vertex": "chains/vector-crt/vs_post",
7+
"fragment": "chains/vector-crt/fs_decay",
8+
"uniforms": [
9+
{ "name": "s_accum", "type": "int", "values": [ 0 ] },
10+
{ "name": "u_decay", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"blend": { "equation": "add", "srcColor": "1", "dstColor": "0", "srcAlpha": "1", "dstAlpha": "0" },
3+
"depth": { "function": "always", "writeenable": false },
4+
"cull": { "mode": "none" },
5+
"write": { "rgb": true, "alpha": true },
6+
"vertex": "chains/vector-crt/vs_post",
7+
"fragment": "chains/vector-crt/fs_downsample",
8+
"uniforms": [
9+
{ "name": "s_accum", "type": "int", "values": [ 0 ] },
10+
{ "name": "u_source_texel", "type": "vec4", "values": [ 0.0015625, 0.0020833, 0.0, 0.0 ] }
11+
]
12+
}
1.78 KB
Binary file not shown.
1.61 KB
Binary file not shown.
1.29 KB
Binary file not shown.
456 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)