diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin index 55dde80cc29..c2beaf0a0bb 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin index cce09f22ca3..d9bc7650ad0 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin index 2913fdb8841..e11056cba06 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin index 30b51092d0a..a949255755c 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin index b342b7cd067..8feb7c80209 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_update.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_update.bin index 80274c348ec..8a48edead09 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_update.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_update.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin index 0dc6e0f3bba..828ca499848 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin and b/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin index 362d112289e..38b61d754ac 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin and b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin index d275d388690..4f3d92a37f2 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin and b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin index e37754bcb08..7e83a3fefbb 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin and b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin index e37754bcb08..7e83a3fefbb 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin and b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin differ diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc index e70036084ff..7244bef7f55 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc @@ -17,7 +17,10 @@ void main() vec3 cscrn = pow(screen.rgb, vec3_splat(u_gamma.x)); vec3 cphos = pow(phosphor.rgb, vec3_splat(u_gamma.x)); - cphos *= vec3_splat( u_phosphor_amplitude.x / pow(255.0*phosphor.a,u_phosphor_power.x) ); + // encode the upper 2 bits of the time elapsed in the lower 2 bits of b + float t = 255.0*phosphor.a + fract(phosphor.b*255.0/4.0)*1024.0; + + cphos *= vec3_splat( u_phosphor_amplitude.x * pow(t,-u_phosphor_power.x) ); vec3 col = pow(cscrn + cphos, vec3_splat(1.0/u_gamma.x)); diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc index 5215054b0db..9057fbdbf83 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc @@ -17,8 +17,15 @@ void main() vec3 lum = vec3(0.299,0.587,0.114); float bscrn = dot(pow(screen.rgb,vec3_splat(u_gamma.x)),lum); float bphos = dot(pow(phosphor.rgb,vec3_splat(u_gamma.x)),lum); - //bscrn /= pow(1.0,u_phosphor_power.x); - bphos /= pow(1.0+255.0*phosphor.a,u_phosphor_power.x); - gl_FragColor = ( bscrn > bphos ? vec4(screen.rgb,1.0/255.0) : vec4(phosphor.rgb,phosphor.a+1.0/255.0) ); + // encode the upper 2 bits of the time elapsed in the lower 2 bits of b + float t = 1.0 + 255.0*phosphor.a + fract(phosphor.b*255.0/4.0)*1024.0; + + bphos = ( t > 1023.0 ? 0.0 : bphos*pow(t,-u_phosphor_power.x) ); + + gl_FragColor = ( bscrn >= bphos ? + vec4(screen.rg,floor(screen.b*255.0/4.0)*4.0/255.0,1.0/255.0) + : vec4(phosphor.rg, + (floor(phosphor.b*255.0/4.0)*4.0 + floor(t/256.0))/255.0, + fract(t/256.0)*256.0/255.0 ) ); }