summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/bgfx/shaders')
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/blurs/fs_smart-blur.sc36
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/crt-geom_common.sc203
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc202
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc257
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc37
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc37
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc37
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc148
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc29
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_update.sc27
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc102
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc17
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc17
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc53
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc16
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc11
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc11
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/eagle/fs_eagle.sc30
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_defocus.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_decode.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_encode.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc27
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq2x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq3x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq4x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_lcd-grid.sc106
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_persistence.sc16
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/lcd-grid/varying.def.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc19
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc19
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_bcg.sc24
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_palette16.sc37
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_rgb32.sc14
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_yuy16.sc38
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_bob-and-ghost-deinterlace.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass0.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass1.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc13
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc21
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_gaussian.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_gaussian.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_gaussian.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_gaussian.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/warp/fs_dilation-horizontal-fast.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc14
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv1-noblend.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_custom-jinc2-sharper.sc20
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.sc20
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass1.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass2.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.sc12
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.sc8
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.sc4
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.sc10
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc6
-rw-r--r--src/osd/modules/render/bgfx/shaders/fs_screen.sc2
-rw-r--r--src/osd/modules/render/bgfx/shaders/makefile27
-rw-r--r--src/osd/modules/render/bgfx/shaders/shader.mk68
-rw-r--r--src/osd/modules/render/bgfx/shaders/vs_gui.sc5
-rw-r--r--src/osd/modules/render/bgfx/shaders/vs_screen.sc5
177 files changed, 1819 insertions, 827 deletions
diff --git a/src/osd/modules/render/bgfx/shaders/chains/blurs/fs_smart-blur.sc b/src/osd/modules/render/bgfx/shaders/chains/blurs/fs_smart-blur.sc
index 78229ec9c49..6ea70cb6aac 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/blurs/fs_smart-blur.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/blurs/fs_smart-blur.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
/*
Hyllian Smart-Blur Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,26 +39,26 @@ uniform vec4 SB_THRESHOLD;
bool eq(vec3 c1, vec3 c2)
{
- vec3 df = abs(c1 - c2);
- return df.r < SB_THRESHOLD.r && df.g < SB_THRESHOLD.g && df.b < SB_THRESHOLD.b;
+ vec3 df = abs(c1 - c2);
+ return df.r < SB_THRESHOLD.r && df.g < SB_THRESHOLD.g && df.b < SB_THRESHOLD.b;
}
void main()
{
- vec3 A = texture2D(s_p, v_texcoord1.xw).xyz;
- vec3 B = texture2D(s_p, v_texcoord1.yw).xyz;
- vec3 C = texture2D(s_p, v_texcoord1.zw).xyz;
- vec3 D = texture2D(s_p, v_texcoord2.xw).xyz;
- vec3 E = texture2D(s_p, v_texcoord2.yw).xyz;
- vec3 F = texture2D(s_p, v_texcoord2.zw).xyz;
- vec3 G = texture2D(s_p, v_texcoord3.xw).xyz;
- vec3 H = texture2D(s_p, v_texcoord3.yw).xyz;
- vec3 I = texture2D(s_p, v_texcoord3.zw).xyz;
+ vec3 A = texture2D(s_p, v_texcoord1.xw).xyz;
+ vec3 B = texture2D(s_p, v_texcoord1.yw).xyz;
+ vec3 C = texture2D(s_p, v_texcoord1.zw).xyz;
+ vec3 D = texture2D(s_p, v_texcoord2.xw).xyz;
+ vec3 E = texture2D(s_p, v_texcoord2.yw).xyz;
+ vec3 F = texture2D(s_p, v_texcoord2.zw).xyz;
+ vec3 G = texture2D(s_p, v_texcoord3.xw).xyz;
+ vec3 H = texture2D(s_p, v_texcoord3.yw).xyz;
+ vec3 I = texture2D(s_p, v_texcoord3.zw).xyz;
- if (eq(E,F) && eq(E,H) && eq(E,I) && eq(E,B) && eq(E,C) && eq(E,A) && eq(E,D) && eq(E,G))
- {
- E = (A + B + C + D + E + F + G + H + I) / 9.0;
- }
+ if (eq(E,F) && eq(E,H) && eq(E,I) && eq(E,B) && eq(E,C) && eq(E,A) && eq(E,D) && eq(E,G))
+ {
+ E = (A + B + C + D + E + F + G + H + I) / 9.0;
+ }
- gl_FragColor = vec4(E, 1.0);
-} \ No newline at end of file
+ gl_FragColor = vec4(E, 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc b/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc
index c82d7c82bec..40b0947da38 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
/*
Hyllian Smart-Blur Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/crt-geom_common.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/crt-geom_common.sc
new file mode 100644
index 00000000000..9118e42d5c8
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/crt-geom_common.sc
@@ -0,0 +1,203 @@
+// Comment the next line to disable interpolation in linear gamma (and gain speed).
+//#define LINEAR_PROCESSING
+
+// Enable 3x oversampling of the beam profile
+#define OVERSAMPLE
+
+// Use the older, purely gaussian beam profile
+#define USEGAUSSIAN
+
+// Macros.
+#define FIX(c) max(abs(c), 1e-5)
+#define PI 3.141592653589
+
+vec4 TEX2D(vec2 c)
+{
+ vec2 underscan = step(0.0,c) * step(0.0,vec2_splat(1.0)-c);
+ vec4 col = texture2D(mpass_texture, c) * vec4_splat(underscan.x*underscan.y);
+#ifdef LINEAR_PROCESSING
+ col = pow(col, vec4_splat(CRTgamma.x));
+#endif
+ return col;
+}
+
+// Enable screen curvature.
+uniform vec4 curvature;
+
+uniform vec4 spot_size;
+uniform vec4 spot_growth;
+uniform vec4 spot_growth_power;
+
+uniform vec4 u_interp;
+
+uniform vec4 aperture_strength;
+uniform vec4 aperture_brightboost;
+
+uniform vec4 CRTgamma;
+uniform vec4 monitorsRGB;
+uniform vec4 monitorgamma;
+
+uniform vec4 overscan;
+uniform vec4 aspect;
+
+uniform vec4 d;
+uniform vec4 R;
+
+uniform vec4 cornersize;
+uniform vec4 cornersmooth;
+
+float intersect(vec2 xy , vec2 sinangle, vec2 cosangle)
+{
+ float A = dot(xy,xy)+d.x*d.x;
+ float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x);
+ float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y;
+ return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
+}
+
+vec2 bkwtrans(vec2 xy, vec2 sinangle, vec2 cosangle)
+{
+ float c = intersect(xy, sinangle, cosangle);
+ vec2 pt = vec2_splat(c)*xy;
+ pt -= vec2_splat(-R.x)*sinangle;
+ pt /= vec2_splat(R.x);
+ vec2 tang = sinangle/cosangle;
+ vec2 poc = pt/cosangle;
+ float A = dot(tang,tang)+1.0;
+ float B = -2.0*dot(poc,tang);
+ float C = dot(poc,poc)-1.0;
+ float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
+ vec2 uv = (pt-a*sinangle)/cosangle;
+ float r = FIX(R.x*acos(a));
+ return uv*r/sin(r/R.x);
+}
+
+vec2 transform(vec2 coord, vec3 stretch, vec2 sinangle, vec2 cosangle)
+{
+ coord = (coord-vec2_splat(0.5))*aspect.xy*stretch.z+stretch.xy;
+ return (bkwtrans(coord, sinangle, cosangle)/overscan.xy/aspect.xy+vec2_splat(0.5));
+}
+
+float corner(vec2 coord)
+{
+ coord = (coord - vec2_splat(0.5)) * overscan.xy + vec2_splat(0.5);
+ coord = min(coord, vec2_splat(1.0)-coord) * aspect.xy;
+ vec2 cdist = vec2_splat(cornersize.x);
+ coord = (cdist - min(coord,cdist));
+ float dist = sqrt(dot(coord,coord));
+ return clamp((max(cdist.x,1e-3)-dist)*cornersmooth.x,0.0, 1.0);
+}
+
+// Calculate the influence of a scanline on the current pixel.
+//
+// 'distance' is the distance in texture coordinates from the current
+// pixel to the scanline in question.
+// 'color' is the colour of the scanline at the horizontal location of
+// the current pixel.
+vec4 scanlineWeights(float distance, vec4 color)
+{
+ // "wid" controls the width of the scanline beam, for each RGB channel
+ // The "weights" lines basically specify the formula that gives
+ // you the profile of the beam, i.e. the intensity as
+ // a function of distance from the vertical center of the
+ // scanline. In this case, it is gaussian if width=2, and
+ // becomes nongaussian for larger widths. Ideally this should
+ // be normalized so that the integral across the beam is
+ // independent of its width. That is, for a narrower beam
+ // "weights" should have a higher peak at the center of the
+ // scanline than for a wider beam.
+#ifdef USEGAUSSIAN
+ vec4 wid = spot_size.x + spot_growth.x * pow(color, vec4_splat(spot_growth_power.x));
+ vec4 weights = vec4(distance / wid);
+ float maxwid = spot_size.x + spot_growth.x;
+ float norm = maxwid / ( 1.0 + exp(-1.0/(maxwid*maxwid)) );
+ return norm * exp(-weights * weights) / wid;
+#else
+ vec4 wid = 2.0 + 2.0 * pow(color, vec4_splat(4.0));
+ vec4 weights = vec4_splat(distance / 0.3);
+ return 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);
+#endif
+}
+
+vec4 cubic(vec4 x, float B, float C)
+{
+ // https://en.wikipedia.org/wiki/Mitchell%E2%80%93Netravali_filters
+ vec2 a = x.yz; // components in [0,1]
+ vec2 b = x.xw; // components in [1,2]
+ vec2 a2 = a*a;
+ vec2 b2 = b*b;
+ a = (2.0-1.5*B-1.0*C)*a*a2 + (-3.0+2.0*B+C)*a2 + (1.0-(1.0/3.0)*B);
+ b = ((-1.0/6.0)*B-C)*b*b2 + (B+5.0*C)*b2 + (-2.0*B-8.0*C)*b + ((4.0/3.0)*B+4.0*C);
+ return vec4(b.x,a.x,a.y,b.y);
+}
+
+vec4 x_coeffs(vec4 x, float pos_x)
+{
+ if (u_interp.x < 0.5) { // box
+ float wid = length(vec2(dFdx(pos_x),dFdy(pos_x)));
+ float dx = clamp((0.5 + 0.5*wid - x.y)/wid, 0.0, 1.0);
+ return vec4(0.0,dx,1.0-dx,0.0);
+ } else if (u_interp.x < 1.5) { // linear
+ return vec4(0.0, 1.0-x.y, 1.0-x.z, 0.0);
+ } else if (u_interp.x < 2.5) { // Lanczos
+ // Prevent division by zero.
+ vec4 coeffs = FIX(PI * x);
+ // Lanczos2 kernel.
+ coeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);
+ // Normalize.
+ coeffs /= dot(coeffs, vec4_splat(1.0));
+ return coeffs;
+ } else if (u_interp.x < 3.5) { // Catmull-Rom
+ return cubic(x,0.0,0.5);
+ } else if (u_interp.x < 4.5) { // Mitchell-Netravali
+ return cubic(x,1.0/3.0,1.0/3.0);
+ } else /*if (u_interp.x < 5.5)*/ { // B-spline
+ return cubic(x,1.0,0.0);
+ }
+}
+
+vec4 sample_scanline(vec2 xy, vec4 coeffs, float onex)
+{
+ // Calculate the effective colour of the given
+ // scanline at the horizontal location of the current pixel,
+ // using the Lanczos coefficients.
+ vec4 col = clamp(TEX2D(xy + vec2(-onex, 0.0))*coeffs.x +
+ TEX2D(xy)*coeffs.y +
+ TEX2D(xy +vec2(onex, 0.0))*coeffs.z +
+ TEX2D(xy + vec2(2.0 * onex, 0.0))*coeffs.w , 0.0, 1.0);
+ return col;
+}
+
+vec3 apply_shadow_mask(vec2 coord, vec3 col)
+{
+ vec2 xy = coord * u_quad_dims.xy / u_tex_size1.xy;
+ vec4 mask = texture2D(mask_texture, xy);
+ // count of total bright pixels is encoded in the mask's alpha channel
+ float nbright = 255.0 - 255.0*mask.a;
+ // fraction of bright pixels in the mask
+ float fbright = nbright / ( u_tex_size1.x * u_tex_size1.y );
+ // average darkening factor of the mask
+ float aperture_average = mix(1.0-aperture_strength.x*(1.0-aperture_brightboost.x), 1.0, fbright);
+ // colour of dark mask pixels
+ vec3 clow = vec3_splat(1.0-aperture_strength.x) * col + vec3_splat(aperture_strength.x*(aperture_brightboost.x)) * col * col;
+ float ifbright = 1.0 / fbright;
+ // colour of bright mask pixels
+ vec3 chi = vec3_splat(ifbright*aperture_average) * col - vec3_splat(ifbright - 1.0) * clow;
+ return mix(clow,chi,mask.rgb); // mask texture selects dark vs bright
+}
+
+vec3 linear_to_sRGB(vec3 col)
+{
+ // only applies the gamma ramp; does not adjust the primaries
+ vec3 linear_ramp = vec3(lessThan(col, vec3_splat(0.0031308)));
+ vec3 clin = col * vec3_splat(12.92);
+ vec3 cpow = pow(col, vec3_splat(1.0/2.4)) * vec3_splat(1.055) - vec3_splat(0.055);
+ return mix(cpow, clin, linear_ramp);
+}
+
+vec3 linear_to_output(vec3 col)
+{
+ if (monitorsRGB.x > 0.5)
+ return linear_to_sRGB(col);
+ else
+ return pow(col, vec3_splat(1.0 / monitorgamma.x));
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc
index c5cfcbf2cdc..5b8a633a642 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc
@@ -12,120 +12,33 @@ $input v_sinangle, v_cosangle, v_stretch, v_one, v_texCoord
#include "common.sh"
-// Comment the next line to disable interpolation in linear gamma (and gain speed).
-//#define LINEAR_PROCESSING
-
-// Enable 3x oversampling of the beam profile
-#define OVERSAMPLE
-
-// Use the older, purely gaussian beam profile
-#define USEGAUSSIAN
-
-// Macros.
-#define FIX(c) max(abs(c), 1e-5)
-#define PI 3.141592653589
-
SAMPLER2D(mpass_texture, 0);
SAMPLER2D(mask_texture, 1);
SAMPLER2D(blur_texture, 2);
-
-#ifdef LINEAR_PROCESSING
-# define TEX2D(c) pow(texture2D(mpass_texture, (c)), vec4(CRTgamma))
-#else
-# define TEX2D(c) texture2D(mpass_texture, (c))
-#endif
-
-// Enable screen curvature.
-uniform vec4 curvature;
+SAMPLER2D(mipmap_texture, 3);
uniform vec4 u_tex_size0;
uniform vec4 u_tex_size1;
uniform vec4 u_quad_dims;
-uniform vec4 aperture_strength;
-
-uniform vec4 CRTgamma;
-uniform vec4 monitorgamma;
-
-uniform vec4 overscan;
-uniform vec4 aspect;
-
-uniform vec4 d;
-uniform vec4 R;
-
-uniform vec4 cornersize;
-uniform vec4 cornersmooth;
+#include "crt-geom_common.sc"
uniform vec4 halation;
+uniform vec4 rasterbloom;
-float intersect(vec2 xy , vec2 sinangle, vec2 cosangle)
-{
- float A = dot(xy,xy)+d.x*d.x;
- float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x);
- float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y;
- return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
-}
-
-vec2 bkwtrans(vec2 xy, vec2 sinangle, vec2 cosangle)
-{
- float c = intersect(xy, sinangle, cosangle);
- vec2 pt = vec2_splat(c)*xy;
- pt -= vec2_splat(-R.x)*sinangle;
- pt /= vec2_splat(R.x);
- vec2 tang = sinangle/cosangle;
- vec2 poc = pt/cosangle;
- float A = dot(tang,tang)+1.0;
- float B = -2.0*dot(poc,tang);
- float C = dot(poc,poc)-1.0;
- float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
- vec2 uv = (pt-a*sinangle)/cosangle;
- float r = FIX(R.x*acos(a));
- return uv*r/sin(r/R.x);
-}
+uniform vec4 blurwidth;
-vec2 transform(vec2 coord, vec3 stretch, vec2 sinangle, vec2 cosangle)
+vec4 texblur(vec2 c)
{
- coord = (coord-vec2_splat(0.5))*aspect.xy*stretch.z+stretch.xy;
- return (bkwtrans(coord, sinangle, cosangle)/overscan.xy/aspect.xy+vec2_splat(0.5));
-}
-
-float corner(vec2 coord)
-{
- coord = (coord - vec2_splat(0.5)) * overscan.xy + vec2_splat(0.5);
- coord = min(coord, vec2_splat(1.0)-coord) * aspect.xy;
- vec2 cdist = vec2_splat(cornersize.x);
- coord = (cdist - min(coord,cdist));
- float dist = sqrt(dot(coord,coord));
- return clamp((max(cdist.x,1e-3)-dist)*cornersmooth.x,0.0, 1.0);
-}
-
-// Calculate the influence of a scanline on the current pixel.
-//
-// 'distance' is the distance in texture coordinates from the current
-// pixel to the scanline in question.
-// 'color' is the colour of the scanline at the horizontal location of
-// the current pixel.
-vec4 scanlineWeights(float distance, vec4 color)
-{
- // "wid" controls the width of the scanline beam, for each RGB channel
- // The "weights" lines basically specify the formula that gives
- // you the profile of the beam, i.e. the intensity as
- // a function of distance from the vertical center of the
- // scanline. In this case, it is gaussian if width=2, and
- // becomes nongaussian for larger widths. Ideally this should
- // be normalized so that the integral across the beam is
- // independent of its width. That is, for a narrower beam
- // "weights" should have a higher peak at the center of the
- // scanline than for a wider beam.
-#ifdef USEGAUSSIAN
- vec4 wid = 0.3 + 0.1 * pow(color, vec4_splat(3.0));
- vec4 weights = vec4(distance / wid);
- return 0.4 * exp(-weights * weights) / wid;
-#else
- vec4 wid = 2.0 + 2.0 * pow(color, vec4_splat(4.0));
- vec4 weights = vec4_splat(distance / 0.3);
- return 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);
-#endif
+ vec4 col = pow(texture2D(blur_texture,c), vec4(vec3_splat(CRTgamma.x),1.0));
+ // taper the blur texture outside its border with a gaussian
+ float w = blurwidth.x / 320.0;
+ c = min(c, vec2_splat(1.0)-c) * aspect.xy * vec2_splat(1.0/w);
+ vec2 e2c = exp(-c*c);
+ // approximation of erf gives smooth step
+ // (convolution of gaussian with step)
+ c = (step(0.0,c)-vec2_splat(0.5)) * sqrt(vec2_splat(1.0)-e2c) * (vec2_splat(1.0) + vec2_splat(0.1749)*e2c) + vec2_splat(0.5);
+ return col * vec4_splat( c.x * c.y );
}
void main()
@@ -136,6 +49,10 @@ void main()
// | | | | |
// -------------------------------
// | | | | |
+ // | 00 | 10 | 20 | 30 | <-- previous scanline
+ // | | | | |
+ // -------------------------------
+ // | | | | |
// | 01 | 11 | 21 | 31 | <-- current scanline
// | | @ | | |
// -------------------------------
@@ -147,9 +64,10 @@ void main()
//
// Each character-cell represents a pixel on the output
// surface, "@" represents the current pixel (always somewhere
- // in the bottom half of the current scan-line, or the top-half
- // of the next scanline). The grid of lines represents the
+ // in the current scan-line). The grid of lines represents the
// edges of the texels of the underlying texture.
+ // The "deluxe" shader includes contributions from the
+ // previous, current, and next scanlines.
// Texture coordinates of the texel containing the active pixel.
vec2 xy;
@@ -157,79 +75,69 @@ void main()
xy = transform(v_texCoord, v_stretch, v_sinangle, v_cosangle);
else
xy = (v_texCoord-vec2_splat(0.5))/overscan.xy+vec2_splat(0.5);
- vec2 xy0 = xy;
float cval = corner(xy);
+ // extract average brightness from the mipmap texture
+ float avgbright = dot(texture2D(mipmap_texture,vec2(1.0,1.0)).rgb,vec3_splat(1.0))/3.0;
+ float rbloom = 1.0 - rasterbloom.x * ( avgbright - 0.5 );
+ // expand the screen when average brightness is higher
+ xy = (xy - vec2_splat(0.5)) * rbloom + vec2_splat(0.5);
+ vec2 xy0 = xy;
// Of all the pixels that are mapped onto the texel we are
// currently rendering, which pixel are we currently rendering?
- vec2 ratio_scale = xy * u_tex_size0.xy - vec2_splat(0.5);
-
+ vec2 ratio_scale = xy * u_tex_size0.xy - vec2(0.5,0.0);
+
#ifdef OVERSAMPLE
float filter = fwidth(ratio_scale.y);
#endif
- vec2 uv_ratio = fract(ratio_scale);
+ vec2 uv_ratio = fract(ratio_scale) - vec2(0.0,0.5);
// Snap to the center of the underlying texel.
xy = (floor(ratio_scale) + vec2_splat(0.5)) / u_tex_size0.xy;
- // Calculate Lanczos scaling coefficients describing the effect
+ // Calculate scaling coefficients describing the effect
// of various neighbour texels in a scanline on the current
// pixel.
- vec4 coeffs = PI * vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x);
-
- // Prevent division by zero.
- coeffs = FIX(coeffs);
-
- // Lanczos2 kernel.
- coeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);
-
- // Normalize.
- coeffs /= dot(coeffs, vec4_splat(1.0));
-
- // Calculate the effective colour of the current and next
- // scanlines at the horizontal location of the current pixel,
- // using the Lanczos coefficients above.
- vec4 col = clamp(TEX2D(xy + vec2(-v_one.x, 0.0))*coeffs.x +
- TEX2D(xy)*coeffs.y +
- TEX2D(xy +vec2(v_one.x, 0.0))*coeffs.z +
- TEX2D(xy + vec2(2.0 * v_one.x, 0.0))*coeffs.w , 0.0, 1.0);
-
- vec4 col2 = clamp(TEX2D(xy + vec2(-v_one.x, v_one.y))*coeffs.x +
- TEX2D(xy + vec2(0.0, v_one.y))*coeffs.y +
- TEX2D(xy + v_one)*coeffs.z +
- TEX2D(xy + vec2(2.0 * v_one.x, v_one.y))*coeffs.w , 0.0, 1.0);
+ vec4 coeffs = x_coeffs(vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x), ratio_scale.x);
+ vec4 col = sample_scanline(xy, coeffs, v_one.x);
+ vec4 col_prev = sample_scanline(xy + vec2(0.0,-v_one.y), coeffs, v_one.x);
+ vec4 col_next = sample_scanline(xy + vec2(0.0, v_one.y), coeffs, v_one.x);
#ifndef LINEAR_PROCESSING
col = pow(col , vec4_splat(CRTgamma.x));
- col2 = pow(col2, vec4_splat(CRTgamma.x));
+ col_prev = pow(col_prev, vec4_splat(CRTgamma.x));
+ col_next = pow(col_next, vec4_splat(CRTgamma.x));
#endif
// Calculate the influence of the current and next scanlines on
// the current pixel.
vec4 weights = scanlineWeights(uv_ratio.y, col);
- vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
+ vec4 weights_prev = scanlineWeights(uv_ratio.y + 1.0, col_prev);
+ vec4 weights_next = scanlineWeights(uv_ratio.y - 1.0, col_next);
#ifdef OVERSAMPLE
uv_ratio.y =uv_ratio.y+1.0/3.0*filter;
weights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;
- weights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;
+ weights_prev=(weights_prev+scanlineWeights(uv_ratio.y+1.0, col_prev))/3.0;
+ weights_next=(weights_next+scanlineWeights(uv_ratio.y-1.0, col_next))/3.0;
uv_ratio.y =uv_ratio.y-2.0/3.0*filter;
- weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;
- weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;
+ weights=weights+scanlineWeights(uv_ratio.y, col)/3.0;
+ weights_prev=weights_prev+scanlineWeights(uv_ratio.y+1.0, col_prev)/3.0;
+ weights_next=weights_next+scanlineWeights(uv_ratio.y-1.0, col_next)/3.0;
#endif
- vec3 mul_res = (col * weights + col2 * weights2).rgb;
+ vec4 mul_res = col * weights + col_prev * weights_prev + col_next * weights_next;
// halation and corners
- vec3 blur = pow(texture2D(blur_texture,xy0).rgb, vec3_splat(CRTgamma.x));
- mul_res = mix(mul_res, blur, halation.x) * vec3_splat(cval);
-
- // Convert the image gamma for display on our output device.
- mul_res = pow(mul_res, vec3_splat(1.0 / monitorgamma.x));
+ vec4 blur = texblur(xy0);
+ // include factor of rbloom:
+ // (probably imperceptible) brightness reduction when raster grows
+ mul_res = mix(mul_res, blur, halation.x) * vec4_splat(cval*rbloom);
// Shadow mask
- xy = v_texCoord.xy * u_quad_dims.xy / u_tex_size1.xy;
- vec3 mask = texture2D(mask_texture, xy).rgb;
- mask = mix(vec3_splat(1.0), mask, aperture_strength.x);
-
- gl_FragColor = vec4(mul_res*mask, col.a);
+ vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res.rgb);
+
+ // Convert the image gamma for display on our output device.
+ cout = linear_to_output(cout);
+
+ gl_FragColor = vec4(cout,1.0);
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc
index 919ba46d0ab..5226a9999cc 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc
@@ -12,216 +12,91 @@ $input v_sinangle, v_cosangle, v_stretch, v_one, v_texCoord
#include "common.sh"
-// Comment the next line to disable interpolation in linear gamma (and gain speed).
-//#define LINEAR_PROCESSING
-
-// Enable 3x oversampling of the beam profile
-#define OVERSAMPLE
-
-// Use the older, purely gaussian beam profile
-#define USEGAUSSIAN
-
-// Macros.
-#define FIX(c) max(abs(c), 1e-5)
-#define PI 3.141592653589
-
SAMPLER2D(mpass_texture, 0);
SAMPLER2D(mask_texture, 1);
-#ifdef LINEAR_PROCESSING
-# define TEX2D(c) pow(texture2D(mpass_texture, (c)), vec4(CRTgamma))
-#else
-# define TEX2D(c) texture2D(mpass_texture, (c))
-#endif
-
-// Enable screen curvature.
-uniform vec4 curvature;
uniform vec4 u_tex_size0;
uniform vec4 u_tex_size1;
uniform vec4 u_quad_dims;
-uniform vec4 aperture_strength;
-
-uniform vec4 CRTgamma;
-uniform vec4 monitorgamma;
-
-uniform vec4 overscan;
-uniform vec4 aspect;
+#include "crt-geom_common.sc"
-uniform vec4 d;
-uniform vec4 R;
-uniform vec4 cornersize;
-uniform vec4 cornersmooth;
-
-float intersect(vec2 xy , vec2 sinangle, vec2 cosangle)
+void main()
{
- float A = dot(xy,xy)+d.x*d.x;
- float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x);
- float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y;
- return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
-}
+ // Here's a helpful diagram to keep in mind while trying to
+ // understand the code:
+ //
+ // | | | | |
+ // -------------------------------
+ // | | | | |
+ // | 01 | 11 | 21 | 31 | <-- current scanline
+ // | | @ | | |
+ // -------------------------------
+ // | | | | |
+ // | 02 | 12 | 22 | 32 | <-- next scanline
+ // | | | | |
+ // -------------------------------
+ // | | | | |
+ //
+ // Each character-cell represents a pixel on the output
+ // surface, "@" represents the current pixel (always somewhere
+ // in the bottom half of the current scan-line, or the top-half
+ // of the next scanline). The grid of lines represents the
+ // edges of the texels of the underlying texture.
+
+ // Texture coordinates of the texel containing the active pixel.
+ vec2 xy;
+ if (curvature.x > 0.5)
+ xy = transform(v_texCoord, v_stretch, v_sinangle, v_cosangle);
+ else
+ xy = (v_texCoord-vec2_splat(0.5))/overscan.xy+vec2_splat(0.5);
+ float cval = corner(xy);
+
+ // Of all the pixels that are mapped onto the texel we are
+ // currently rendering, which pixel are we currently rendering?
+ vec2 ratio_scale = xy * u_tex_size0.xy - vec2_splat(0.5);
-vec2 bkwtrans(vec2 xy, vec2 sinangle, vec2 cosangle)
-{
- float c = intersect(xy, sinangle, cosangle);
- vec2 pt = vec2_splat(c)*xy;
- pt -= vec2_splat(-R.x)*sinangle;
- pt /= vec2_splat(R.x);
- vec2 tang = sinangle/cosangle;
- vec2 poc = pt/cosangle;
- float A = dot(tang,tang)+1.0;
- float B = -2.0*dot(poc,tang);
- float C = dot(poc,poc)-1.0;
- float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
- vec2 uv = (pt-a*sinangle)/cosangle;
- float r = FIX(R.x*acos(a));
- return uv*r/sin(r/R.x);
-}
+#ifdef OVERSAMPLE
+ float filter = fwidth(ratio_scale.y);
+#endif
+ vec2 uv_ratio = fract(ratio_scale);
-vec2 transform(vec2 coord, vec3 stretch, vec2 sinangle, vec2 cosangle)
-{
- coord = (coord-vec2_splat(0.5))*aspect.xy*stretch.z+stretch.xy;
- return (bkwtrans(coord, sinangle, cosangle)/overscan.xy/aspect.xy+vec2_splat(0.5));
-}
+ // Snap to the center of the underlying texel.
+ xy = (floor(ratio_scale) + vec2_splat(0.5)) / u_tex_size0.xy;
-float corner(vec2 coord)
-{
- coord = (coord - vec2_splat(0.5)) * overscan.xy + vec2_splat(0.5);
- coord = min(coord, vec2_splat(1.0)-coord) * aspect.xy;
- vec2 cdist = vec2_splat(cornersize.x);
- coord = (cdist - min(coord,cdist));
- float dist = sqrt(dot(coord,coord));
- return clamp((max(cdist.x,1e-3)-dist)*cornersmooth.x,0.0, 1.0);
-}
+ // Calculate scaling coefficients describing the effect
+ // of various neighbour texels in a scanline on the current
+ // pixel.
+ vec4 coeffs = x_coeffs(vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x), ratio_scale.x);
-// Calculate the influence of a scanline on the current pixel.
-//
-// 'distance' is the distance in texture coordinates from the current
-// pixel to the scanline in question.
-// 'color' is the colour of the scanline at the horizontal location of
-// the current pixel.
-vec4 scanlineWeights(float distance, vec4 color)
-{
- // "wid" controls the width of the scanline beam, for each RGB channel
- // The "weights" lines basically specify the formula that gives
- // you the profile of the beam, i.e. the intensity as
- // a function of distance from the vertical center of the
- // scanline. In this case, it is gaussian if width=2, and
- // becomes nongaussian for larger widths. Ideally this should
- // be normalized so that the integral across the beam is
- // independent of its width. That is, for a narrower beam
- // "weights" should have a higher peak at the center of the
- // scanline than for a wider beam.
-#ifdef USEGAUSSIAN
- vec4 wid = 0.3 + 0.1 * pow(color, vec4_splat(3.0));
- vec4 weights = vec4(distance / wid);
- return 0.4 * exp(-weights * weights) / wid;
-#else
- vec4 wid = 2.0 + 2.0 * pow(color, vec4_splat(4.0));
- vec4 weights = vec4_splat(distance / 0.3);
- return 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);
+ vec4 col = sample_scanline(xy, coeffs, v_one.x);
+ vec4 col2 = sample_scanline(xy + vec2(0.0, v_one.y), coeffs, v_one.x);
+
+#ifndef LINEAR_PROCESSING
+ col = pow(col , vec4_splat(CRTgamma.x));
+ col2 = pow(col2, vec4_splat(CRTgamma.x));
#endif
-}
-void main()
-{
- // Here's a helpful diagram to keep in mind while trying to
- // understand the code:
- //
- // | | | | |
- // -------------------------------
- // | | | | |
- // | 01 | 11 | 21 | 31 | <-- current scanline
- // | | @ | | |
- // -------------------------------
- // | | | | |
- // | 02 | 12 | 22 | 32 | <-- next scanline
- // | | | | |
- // -------------------------------
- // | | | | |
- //
- // Each character-cell represents a pixel on the output
- // surface, "@" represents the current pixel (always somewhere
- // in the bottom half of the current scan-line, or the top-half
- // of the next scanline). The grid of lines represents the
- // edges of the texels of the underlying texture.
-
- // Texture coordinates of the texel containing the active pixel.
- vec2 xy;
- if (curvature.x > 0.5)
- xy = transform(v_texCoord, v_stretch, v_sinangle, v_cosangle);
- else
- xy = (v_texCoord-vec2_splat(0.5))/overscan.xy+vec2_splat(0.5);
- float cval = corner(xy);
-
- // Of all the pixels that are mapped onto the texel we are
- // currently rendering, which pixel are we currently rendering?
- vec2 ratio_scale = xy * u_tex_size0.xy - vec2_splat(0.5);
-
+ // Calculate the influence of the current and next scanlines on
+ // the current pixel.
+ vec4 weights = scanlineWeights(uv_ratio.y, col);
+ vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
#ifdef OVERSAMPLE
- float filter = fwidth(ratio_scale.y);
+ uv_ratio.y =uv_ratio.y+1.0/3.0*filter;
+ weights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;
+ weights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;
+ uv_ratio.y =uv_ratio.y-2.0/3.0*filter;
+ weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;
+ weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;
#endif
- vec2 uv_ratio = fract(ratio_scale);
-
- // Snap to the center of the underlying texel.
- xy = (floor(ratio_scale) + vec2_splat(0.5)) / u_tex_size0.xy;
-
- // Calculate Lanczos scaling coefficients describing the effect
- // of various neighbour texels in a scanline on the current
- // pixel.
- vec4 coeffs = PI * vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x);
-
- // Prevent division by zero.
- coeffs = FIX(coeffs);
-
- // Lanczos2 kernel.
- coeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);
-
- // Normalize.
- coeffs /= dot(coeffs, vec4_splat(1.0));
-
- // Calculate the effective colour of the current and next
- // scanlines at the horizontal location of the current pixel,
- // using the Lanczos coefficients above.
- vec4 col = clamp(TEX2D(xy + vec2(-v_one.x, 0.0))*coeffs.x +
- TEX2D(xy)*coeffs.y +
- TEX2D(xy +vec2(v_one.x, 0.0))*coeffs.z +
- TEX2D(xy + vec2(2.0 * v_one.x, 0.0))*coeffs.w , 0.0, 1.0);
-
- vec4 col2 = clamp(TEX2D(xy + vec2(-v_one.x, v_one.y))*coeffs.x +
- TEX2D(xy + vec2(0.0, v_one.y))*coeffs.y +
- TEX2D(xy + v_one)*coeffs.z +
- TEX2D(xy + vec2(2.0 * v_one.x, v_one.y))*coeffs.w , 0.0, 1.0);
+ vec4 mul_res = col * weights + col2 * weights2 * vec4_splat(cval);
+ // Shadow mask
+ vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res.rgb);
-#ifndef LINEAR_PROCESSING
- col = pow(col , vec4_splat(CRTgamma.x));
- col2 = pow(col2, vec4_splat(CRTgamma.x));
-#endif
+ // Convert the image gamma for display on our output device.
+ cout = linear_to_output(cout);
- // Calculate the influence of the current and next scanlines on
- // the current pixel.
- vec4 weights = scanlineWeights(uv_ratio.y, col);
- vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
-#ifdef OVERSAMPLE
- uv_ratio.y =uv_ratio.y+1.0/3.0*filter;
- weights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;
- weights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;
- uv_ratio.y =uv_ratio.y-2.0/3.0*filter;
- weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;
- weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;
-#endif
- vec3 mul_res = (col * weights + col2 * weights2).rgb * vec3_splat(cval);
-
- // Convert the image gamma for display on our output device.
- mul_res = pow(mul_res, vec3_splat(1.0 / monitorgamma.x));
-
- // Color the texel.
-
- xy = v_texCoord.xy * u_quad_dims.xy / u_tex_size1.xy;
- vec3 mask = texture2D(mask_texture, xy).rgb;
- mask = mix(vec3_splat(1.0), mask, aperture_strength.x);
-
- gl_FragColor = vec4(mul_res*mask, col.a);
+ gl_FragColor = vec4(cout,mul_res.a);
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc
index f45d1d5df81..6290ae330eb 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc
@@ -1,4 +1,4 @@
-$input v_texCoord, v_coeffs
+$input v_texCoord, v_coeffs, v_coeffs2
#include "common.sh"
@@ -6,24 +6,33 @@ uniform vec4 u_gamma;
uniform vec4 u_tex_size0;
SAMPLER2D(s_tex, 0);
-#define TEX2D(v) pow(texture2D(s_tex, v).rgb, vec3_splat(u_gamma.x))
+#define TEX2D(v) pow(texture2D(s_tex, v), vec4(vec3_splat(u_gamma.x), 1.0))
void main()
{
- vec3 sum = vec3_splat(0.0);
+ vec4 sum = vec4_splat(0.0);
float onex = 1.0/u_tex_size0.x;
- sum += TEX2D(v_texCoord + vec2(-4.0 * onex, 0.0)) * vec3_splat(v_coeffs.w);
- sum += TEX2D(v_texCoord + vec2(-3.0 * onex, 0.0)) * vec3_splat(v_coeffs.z);
- sum += TEX2D(v_texCoord + vec2(-2.0 * onex, 0.0)) * vec3_splat(v_coeffs.y);
- sum += TEX2D(v_texCoord + vec2(-1.0 * onex, 0.0)) * vec3_splat(v_coeffs.x);
+ sum += TEX2D(v_texCoord + vec2(-8.0 * onex, 0.0)) * vec4_splat(v_coeffs2.w);
+ sum += TEX2D(v_texCoord + vec2(-7.0 * onex, 0.0)) * vec4_splat(v_coeffs2.z);
+ sum += TEX2D(v_texCoord + vec2(-6.0 * onex, 0.0)) * vec4_splat(v_coeffs2.y);
+ sum += TEX2D(v_texCoord + vec2(-5.0 * onex, 0.0)) * vec4_splat(v_coeffs2.x);
+ sum += TEX2D(v_texCoord + vec2(-4.0 * onex, 0.0)) * vec4_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(-3.0 * onex, 0.0)) * vec4_splat(v_coeffs.z);
+ sum += TEX2D(v_texCoord + vec2(-2.0 * onex, 0.0)) * vec4_splat(v_coeffs.y);
+ sum += TEX2D(v_texCoord + vec2(-1.0 * onex, 0.0)) * vec4_splat(v_coeffs.x);
sum += TEX2D(v_texCoord);
- sum += TEX2D(v_texCoord + vec2(+1.0 * onex, 0.0)) * vec3_splat(v_coeffs.x);
- sum += TEX2D(v_texCoord + vec2(+2.0 * onex, 0.0)) * vec3_splat(v_coeffs.y);
- sum += TEX2D(v_texCoord + vec2(+3.0 * onex, 0.0)) * vec3_splat(v_coeffs.z);
- sum += TEX2D(v_texCoord + vec2(+4.0 * onex, 0.0)) * vec3_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(+1.0 * onex, 0.0)) * vec4_splat(v_coeffs.x);
+ sum += TEX2D(v_texCoord + vec2(+2.0 * onex, 0.0)) * vec4_splat(v_coeffs.y);
+ sum += TEX2D(v_texCoord + vec2(+3.0 * onex, 0.0)) * vec4_splat(v_coeffs.z);
+ sum += TEX2D(v_texCoord + vec2(+4.0 * onex, 0.0)) * vec4_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(+5.0 * onex, 0.0)) * vec4_splat(v_coeffs2.x);
+ sum += TEX2D(v_texCoord + vec2(+6.0 * onex, 0.0)) * vec4_splat(v_coeffs2.y);
+ sum += TEX2D(v_texCoord + vec2(+7.0 * onex, 0.0)) * vec4_splat(v_coeffs2.z);
+ sum += TEX2D(v_texCoord + vec2(+8.0 * onex, 0.0)) * vec4_splat(v_coeffs2.w);
- float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w));
-
- gl_FragColor = vec4( pow(sum*vec3_splat(norm), vec3_splat(1.0/u_gamma.x)), 1.0 );
+ float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w
+ +v_coeffs2.x+v_coeffs2.y+v_coeffs2.z+v_coeffs2.w));
+
+ gl_FragColor = pow(sum*vec4_splat(norm), vec4(vec3_splat(1.0/u_gamma.x), 1.0));
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc
index 107d1d7a5bb..9f4eace6cbe 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc
@@ -1,4 +1,4 @@
-$input v_texCoord, v_coeffs
+$input v_texCoord, v_coeffs, v_coeffs2
#include "common.sh"
@@ -6,24 +6,33 @@ uniform vec4 u_gamma;
uniform vec4 u_tex_size0;
SAMPLER2D(s_tex, 0);
-#define TEX2D(v) pow(texture2D(s_tex, v).rgb, vec3_splat(u_gamma.x))
+#define TEX2D(v) pow(texture2D(s_tex, v), vec4(vec3_splat(u_gamma.x), 1.0))
void main()
{
- vec3 sum = vec3_splat(0.0);
+ vec4 sum = vec4_splat(0.0);
float oney = 1.0/u_tex_size0.y;
- sum += TEX2D(v_texCoord + vec2(0.0, -4.0 * oney)) * vec3_splat(v_coeffs.w);
- sum += TEX2D(v_texCoord + vec2(0.0, -3.0 * oney)) * vec3_splat(v_coeffs.z);
- sum += TEX2D(v_texCoord + vec2(0.0, -2.0 * oney)) * vec3_splat(v_coeffs.y);
- sum += TEX2D(v_texCoord + vec2(0.0, -1.0 * oney)) * vec3_splat(v_coeffs.x);
+ sum += TEX2D(v_texCoord + vec2(0.0, -8.0 * oney)) * vec4_splat(v_coeffs2.w);
+ sum += TEX2D(v_texCoord + vec2(0.0, -7.0 * oney)) * vec4_splat(v_coeffs2.z);
+ sum += TEX2D(v_texCoord + vec2(0.0, -6.0 * oney)) * vec4_splat(v_coeffs2.y);
+ sum += TEX2D(v_texCoord + vec2(0.0, -5.0 * oney)) * vec4_splat(v_coeffs2.x);
+ sum += TEX2D(v_texCoord + vec2(0.0, -4.0 * oney)) * vec4_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(0.0, -3.0 * oney)) * vec4_splat(v_coeffs.z);
+ sum += TEX2D(v_texCoord + vec2(0.0, -2.0 * oney)) * vec4_splat(v_coeffs.y);
+ sum += TEX2D(v_texCoord + vec2(0.0, -1.0 * oney)) * vec4_splat(v_coeffs.x);
sum += TEX2D(v_texCoord);
- sum += TEX2D(v_texCoord + vec2(0.0, +1.0 * oney)) * vec3_splat(v_coeffs.x);
- sum += TEX2D(v_texCoord + vec2(0.0, +2.0 * oney)) * vec3_splat(v_coeffs.y);
- sum += TEX2D(v_texCoord + vec2(0.0, +3.0 * oney)) * vec3_splat(v_coeffs.z);
- sum += TEX2D(v_texCoord + vec2(0.0, +4.0 * oney)) * vec3_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(0.0, +1.0 * oney)) * vec4_splat(v_coeffs.x);
+ sum += TEX2D(v_texCoord + vec2(0.0, +2.0 * oney)) * vec4_splat(v_coeffs.y);
+ sum += TEX2D(v_texCoord + vec2(0.0, +3.0 * oney)) * vec4_splat(v_coeffs.z);
+ sum += TEX2D(v_texCoord + vec2(0.0, +4.0 * oney)) * vec4_splat(v_coeffs.w);
+ sum += TEX2D(v_texCoord + vec2(0.0, +5.0 * oney)) * vec4_splat(v_coeffs2.x);
+ sum += TEX2D(v_texCoord + vec2(0.0, +6.0 * oney)) * vec4_splat(v_coeffs2.y);
+ sum += TEX2D(v_texCoord + vec2(0.0, +7.0 * oney)) * vec4_splat(v_coeffs2.z);
+ sum += TEX2D(v_texCoord + vec2(0.0, +8.0 * oney)) * vec4_splat(v_coeffs2.w);
- float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w));
-
- gl_FragColor = vec4( pow(sum*vec3_splat(norm), vec3_splat(1.0/u_gamma.x)), 1.0 );
+ float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w
+ +v_coeffs2.x+v_coeffs2.y+v_coeffs2.z+v_coeffs2.w));
+
+ gl_FragColor = pow(sum*vec4_splat(norm), vec4(vec3_splat(1.0/u_gamma.x), 1.0));
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc
new file mode 100644
index 00000000000..37ab685957c
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc
@@ -0,0 +1,37 @@
+$input v_texCoord, v_lpcoeffs1, v_lpcoeffs2
+
+#include "common.sh"
+
+SAMPLER2D(s_screen, 0);
+
+uniform vec4 u_tex_size0;
+
+vec3 sample_screen(vec2 c)
+{
+ vec2 underscan = step(0.0,c) * step(0.0,vec2_splat(1.0)-c);
+ vec3 col = texture2D(s_screen, c).rgb * vec3_splat(underscan.x*underscan.y);
+ return col;
+}
+
+void main()
+{
+ float onex = 1.0/u_tex_size0.x;
+
+ vec3 sum = sample_screen(v_texCoord) * vec3_splat(v_lpcoeffs1.x);
+ sum +=sample_screen(v_texCoord+vec2(-1.0*onex,0.0))*vec3_splat(v_lpcoeffs1.y);
+ sum +=sample_screen(v_texCoord+vec2( 1.0*onex,0.0))*vec3_splat(v_lpcoeffs1.y);
+ sum +=sample_screen(v_texCoord+vec2(-2.0*onex,0.0))*vec3_splat(v_lpcoeffs1.z);
+ sum +=sample_screen(v_texCoord+vec2( 2.0*onex,0.0))*vec3_splat(v_lpcoeffs1.z);
+ sum +=sample_screen(v_texCoord+vec2(-3.0*onex,0.0))*vec3_splat(v_lpcoeffs1.w);
+ sum +=sample_screen(v_texCoord+vec2( 3.0*onex,0.0))*vec3_splat(v_lpcoeffs1.w);
+ sum +=sample_screen(v_texCoord+vec2(-4.0*onex,0.0))*vec3_splat(v_lpcoeffs2.x);
+ sum +=sample_screen(v_texCoord+vec2( 4.0*onex,0.0))*vec3_splat(v_lpcoeffs2.x);
+ sum +=sample_screen(v_texCoord+vec2(-5.0*onex,0.0))*vec3_splat(v_lpcoeffs2.y);
+ sum +=sample_screen(v_texCoord+vec2( 5.0*onex,0.0))*vec3_splat(v_lpcoeffs2.y);
+ sum +=sample_screen(v_texCoord+vec2(-6.0*onex,0.0))*vec3_splat(v_lpcoeffs2.z);
+ sum +=sample_screen(v_texCoord+vec2( 6.0*onex,0.0))*vec3_splat(v_lpcoeffs2.z);
+ sum +=sample_screen(v_texCoord+vec2(-7.0*onex,0.0))*vec3_splat(v_lpcoeffs2.w);
+ sum +=sample_screen(v_texCoord+vec2( 7.0*onex,0.0))*vec3_splat(v_lpcoeffs2.w);
+
+ gl_FragColor = vec4( sum, texture2D(s_screen, v_texCoord).a );
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc
new file mode 100644
index 00000000000..2e0f8038053
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc
@@ -0,0 +1,148 @@
+$input v_texCoord
+
+#include "common.sh"
+
+SAMPLER2D(s_screen, 0);
+SAMPLER2D(s_mipmap, 1);
+
+uniform vec4 u_tex_size0;
+uniform vec4 u_tex_size1;
+uniform vec4 u_smooth;
+
+/*
+ * Based loosely on the idea outlined at
+ * https://nyorain.github.io/mipmap-compute-shader.html
+ * Each higher mipmap level is delayed by one frame.
+ *
+ * A rectangle containing (1,1) has the last mipmap level
+ * (normally a single pixel containing the average of the frame),
+ * passed through a two-tap IIR temporal filter.
+ */
+
+const vec2 v05 = vec2(0.5,0.5);
+
+// pix has integer coordinates -> average four pixels using bilinear filtering
+vec4 sample_screen(vec2 pix)
+{
+ vec2 border = step(-0.5, u_tex_size0.xy - pix);
+ float weight = border.x * border.y;
+
+ // avoid boundary! if dimensions are odd, average 1 or 2 pixels
+ vec2 x = clamp(pix, vec2_splat(0.0), u_tex_size0.xy - v05);
+ // if we're at the boundary, include weight factor
+ // -> effectively always average 4 pixels, with some of them possibly zero
+ border = clamp(u_tex_size0.xy-x,0.0,1.0);
+ weight *= border.x * border.y;
+
+ vec4 tex = texture2D(s_screen, x / u_tex_size0.xy);
+
+ return tex * vec4_splat(weight);
+}
+
+vec4 sample_mipmap(vec2 pix, vec2 offset, vec2 size)
+{
+ vec2 border = step(-0.5, size - pix) * step(-0.5, pix);
+ float weight = border.x * border.y;
+
+ // avoid boundary! if dimensions are odd, average 1 or 2 pixels
+ vec2 x = clamp(pix, vec2_splat(0.0), size - v05);
+ // if we're at the boundary, include weight factor
+ // -> effectively always average 4 pixels, with some of them possibly zero
+ border = clamp(size-x,0.0,1.0);
+ weight *= border.x * border.y;
+
+ vec4 tex = texture2D(s_mipmap, (x + offset) / u_tex_size0.xy);
+
+ return tex * vec4_splat(weight);
+}
+
+void main()
+{
+ vec2 pix = v_texCoord.xy * u_tex_size0.xy;
+ vec2 x = pix*vec2_splat(8.0);
+ if (pix.x < u_tex_size0.x * 0.5) {
+ // first level: sample from screen texture
+
+ // sample 4x4 grid
+ // each sample uses bilinear filtering to average a 2x2 region
+ // overall reduction by 8x8
+ vec4 tex = ( sample_screen(x + vec2(-3.0,-3.0))
+ + sample_screen(x + vec2(-3.0,-1.0))
+ + sample_screen(x + vec2(-3.0, 1.0))
+ + sample_screen(x + vec2(-3.0, 3.0))
+ + sample_screen(x + vec2(-1.0,-3.0))
+ + sample_screen(x + vec2(-1.0,-1.0))
+ + sample_screen(x + vec2(-1.0, 1.0))
+ + sample_screen(x + vec2(-1.0, 3.0))
+ + sample_screen(x + vec2( 1.0,-3.0))
+ + sample_screen(x + vec2( 1.0,-1.0))
+ + sample_screen(x + vec2( 1.0, 1.0))
+ + sample_screen(x + vec2( 1.0, 3.0))
+ + sample_screen(x + vec2( 3.0,-3.0))
+ + sample_screen(x + vec2( 3.0,-1.0))
+ + sample_screen(x + vec2( 3.0, 1.0))
+ + sample_screen(x + vec2( 3.0, 3.0)) ) * 0.0625;
+
+ gl_FragColor = vec4(tex.rgb,1.0);
+ } else {
+ // higher levels: sample from mipmap texture
+ vec2 newsize = u_tex_size0.xy; // size of texture being sampled
+ float fac = 8.0; // keep track of the linear reduction factor
+ float dx = u_tex_size0.x;
+ vec2 offset = vec2_splat(0.0);
+ vec2 offset0 = offset;
+ bool fc = false;
+
+ for (int i = 0; i < 3; i++) { // 3 is sufficient for dimensions up to 4k
+ // place subsequent levels to the right
+ if (pix.x > dx * 0.5) {
+ dx = dx * 0.5;
+ newsize = ceil(newsize*v05*v05*v05); // size of sampled texture is eighthed
+ fac *= 8.0;
+ offset0 = offset;
+ offset.x = offset.x + dx;
+ pix.x -= dx;
+ x = pix * vec2_splat(8.0);
+ if (newsize.x < 8.5 && newsize.y < 8.5) { // reducing to a single pixel
+ fc = true;
+ break;
+ }
+ } else break;
+ }
+
+ if (fc)
+ x = vec2(4.0,4.0);
+
+ vec4 tex = ( sample_mipmap(x + vec2(-3.0,-3.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-3.0,-1.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-3.0, 1.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-3.0, 3.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-1.0,-3.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-1.0,-1.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-1.0, 1.0),offset0,newsize)
+ + sample_mipmap(x + vec2(-1.0, 3.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 1.0,-3.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 1.0,-1.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 1.0, 1.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 1.0, 3.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 3.0,-3.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 3.0,-1.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 3.0, 1.0),offset0,newsize)
+ + sample_mipmap(x + vec2( 3.0, 3.0),offset0,newsize) ) * 0.0625;
+
+ if (fc) { // this sample yields average over the whole screen
+ // apply a compensation for the zeros included in the 8^n average
+ float f = fac*fac / (u_tex_size0.x * u_tex_size0.y);
+ vec4 col = tex * vec4_splat(f);
+ if (v_texCoord.y * u_tex_size1.y < ( offset0.y + u_tex_size1.y ) * 0.5) {
+ gl_FragColor = col;
+ } else {
+ // we are near (1,1): in this region include the temporal filter
+ vec4 old = texture2D(s_mipmap, v_texCoord.xy);
+ gl_FragColor = mix(col,old,u_smooth.x);
+ }
+ } else {
+ gl_FragColor = tex;
+ }
+ }
+}
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..f7e116696cb 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
@@ -7,19 +7,36 @@ SAMPLER2D(s_phosphor, 1);
uniform vec4 u_phosphor_power;
uniform vec4 u_phosphor_amplitude;
+uniform vec4 u_phosphor_cutoff;
uniform vec4 u_gamma;
+float decay(float t)
+{
+ // transition smoothly from power to linear at t=t1
+ float t1 = u_phosphor_cutoff.x / ( 1.0 + u_gamma.x / u_phosphor_power.x );
+ float tpow = pow( clamp(t,0.0,t1), -u_phosphor_power.x );
+ // smoothly fade out for t in [t1,cutoff]: linear in gamma space
+ t = clamp(t, 0.0, u_phosphor_cutoff.x);
+ float y = ( t < t1
+ ? tpow
+ : tpow * pow( ( u_phosphor_cutoff.x - t ) / ( u_phosphor_cutoff.x - t1 ), u_gamma.x ) );
+ return y;
+}
+
void main()
{
vec4 screen = texture2D(s_screen, v_texCoord);
vec4 phosphor = texture2D(s_phosphor, v_texCoord);
- vec3 cscrn = pow(screen.rgb, vec3_splat(u_gamma.x));
- vec3 cphos = pow(phosphor.rgb, vec3_splat(u_gamma.x));
+ vec4 cscrn = pow(screen, vec4(vec3_splat(u_gamma.x), 1.0));
+ vec4 cphos = pow(phosphor, vec4(vec3_splat(u_gamma.x), 1.0));
+
+ // 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 *= vec4_splat( u_phosphor_amplitude.x * decay(t) );
- cphos *= vec3_splat( u_phosphor_amplitude.x / pow(255.0*phosphor.a,u_phosphor_power.x) );
+ vec4 col = pow(cscrn + cphos, vec4(vec3_splat(1.0/u_gamma.x), 1.0));
- vec3 col = pow(cscrn + cphos, vec3_splat(1.0/u_gamma.x));
-
- gl_FragColor = vec4(col, 1.0);
+ gl_FragColor = col;
}
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..824a008e96b 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
@@ -7,8 +7,22 @@ SAMPLER2D(s_phosphor, 1);
uniform vec4 u_phosphor_power;
uniform vec4 u_phosphor_amplitude;
+uniform vec4 u_phosphor_cutoff;
uniform vec4 u_gamma;
+float decay(float t)
+{
+ // transition smoothly from power to linear at t=t1
+ float t1 = u_phosphor_cutoff.x / ( 1.0 + u_gamma.x / u_phosphor_power.x );
+ float tpow = pow( clamp(t,0.0,t1), -u_phosphor_power.x );
+ // smoothly fade out for t in [t1,cutoff]: linear in gamma space
+ t = clamp(t, 0.0, u_phosphor_cutoff.x);
+ float y = ( t < t1
+ ? tpow
+ : tpow * pow( ( u_phosphor_cutoff.x - t ) / ( u_phosphor_cutoff.x - t1 ), u_gamma.x ) );
+ return y;
+}
+
void main()
{
vec4 screen = texture2D(s_screen, v_texCoord);
@@ -17,8 +31,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 * decay(t) );
+
+ 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 ) );
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc
index 034ca88185b..0de371e22c8 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/varying.def.sc
@@ -1,9 +1,12 @@
vec2 v_texCoord : TEXCOORD0 = vec2(0.0, 0.0);
vec3 v_stretch : TEXCOORD1 = vec3(0.0,0.0,0.0);
-vec2 v_sinangle : TEXCOORD2 = vec2(0.0,0.0);
+vec2 v_sinangle : TEXCOORD2 = vec2(0.0,0.0);
vec2 v_cosangle : TEXCOORD3 = vec2(0.0,0.0);
vec2 v_one : TEXCOORD4 = vec2(0.0,0.0);
vec4 v_coeffs : TEXCOORD5 = vec4(0.0,0.0,0.0,0.0);
+vec4 v_coeffs2 : TEXCOORD6 = vec4(0.0,0.0,0.0,0.0);
+vec4 v_lpcoeffs1: TEXCOORD7 = vec4(0.0,0.0,0.0,0.0);
+vec4 v_lpcoeffs2: TEXCOORD8 = vec4(0.0,0.0,0.0,0.0);
vec3 a_position : POSITION;
vec4 a_color0 : COLOR0;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc
index cc3ed09aa14..4f17f0d0ec3 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc
@@ -19,78 +19,82 @@ uniform vec4 R;
uniform vec4 angle;
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
uniform vec4 u_rotation_type;
#define FIX(c) max(abs(c), 1e-5)
float intersect(vec2 xy , vec2 sinangle, vec2 cosangle)
{
- float A = dot(xy,xy)+d.x*d.x;
- float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x);
- float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y;
- return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
+ float A = dot(xy,xy)+d.x*d.x;
+ float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x);
+ float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y;
+ return (-B-sqrt(B*B-4.0*A*C))/(2.0*A);
}
vec2 bkwtrans(vec2 xy, vec2 sinangle, vec2 cosangle)
{
- float c = intersect(xy, sinangle, cosangle);
- vec2 pt = vec2_splat(c)*xy;
- pt -= vec2_splat(-R.x)*sinangle;
- pt /= vec2_splat(R.x);
- vec2 tang = sinangle/cosangle;
- vec2 poc = pt/cosangle;
- float A = dot(tang,tang)+1.0;
- float B = -2.0*dot(poc,tang);
- float C = dot(poc,poc)-1.0;
- float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
- vec2 uv = (pt-a*sinangle)/cosangle;
- float r = FIX(R.x*acos(a));
- return uv*r/sin(r/R.x);
+ float c = intersect(xy, sinangle, cosangle);
+ vec2 pt = vec2_splat(c)*xy;
+ pt -= vec2_splat(-R.x)*sinangle;
+ pt /= vec2_splat(R.x);
+ vec2 tang = sinangle/cosangle;
+ vec2 poc = pt/cosangle;
+ float A = dot(tang,tang)+1.0;
+ float B = -2.0*dot(poc,tang);
+ float C = dot(poc,poc)-1.0;
+ float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);
+ vec2 uv = (pt-a*sinangle)/cosangle;
+ float r = FIX(R.x*acos(a));
+ return uv*r/sin(r/R.x);
}
vec2 fwtrans(vec2 uv, vec2 sinangle, vec2 cosangle)
{
- float r = FIX(sqrt(dot(uv,uv)));
- uv *= sin(r/R.x)/r;
- float x = 1.0-cos(r/R.x);
- float D = d.x/R.x + x*cosangle.x*cosangle.y+dot(uv,sinangle);
- return d.x*(uv*cosangle-x*sinangle)/D;
+ float r = FIX(sqrt(dot(uv,uv)));
+ uv *= sin(r/R.x)/r;
+ float x = 1.0-cos(r/R.x);
+ float D = d.x/R.x + x*cosangle.x*cosangle.y+dot(uv,sinangle);
+ return d.x*(uv*cosangle-x*sinangle)/D;
}
vec3 maxscale(vec2 sinangle, vec2 cosangle)
{
- vec2 c = bkwtrans(-R.x * sinangle / (1.0 + R.x/d.x*cosangle.x*cosangle.y), sinangle, cosangle);
- vec2 a = vec2(0.5,0.5)*aspect.xy;
- vec2 lo = vec2(fwtrans(vec2(-a.x,c.y), sinangle, cosangle).x,
- fwtrans(vec2(c.x,-a.y), sinangle, cosangle).y)/aspect.xy;
- vec2 hi = vec2(fwtrans(vec2(+a.x,c.y), sinangle, cosangle).x,
- fwtrans(vec2(c.x,+a.y), sinangle, cosangle).y)/aspect.xy;
- return vec3((hi+lo)*aspect.xy*0.5,max(hi.x-lo.x,hi.y-lo.y));
+ vec2 c = bkwtrans(-R.x * sinangle / (1.0 + R.x/d.x*cosangle.x*cosangle.y), sinangle, cosangle);
+ vec2 a = vec2(0.5,0.5)*aspect.xy;
+ vec2 lo = vec2(fwtrans(vec2(-a.x,c.y), sinangle, cosangle).x,
+ fwtrans(vec2(c.x,-a.y), sinangle, cosangle).y)/aspect.xy;
+ vec2 hi = vec2(fwtrans(vec2(+a.x,c.y), sinangle, cosangle).x,
+ fwtrans(vec2(c.x,+a.y), sinangle, cosangle).y)/aspect.xy;
+ return vec3((hi+lo)*aspect.xy*0.5,max(hi.x-lo.x,hi.y-lo.y));
}
void main()
{
- // Do the standard vertex processing.
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_texCoord = a_texcoord0;
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
- // Precalculate a bunch of useful values we'll need in the fragment
- // shader.
- vec2 ang;
- // if (u_rotation_type.x < 0.5)
- // ang = vec2(0.0,angle.x);
- // else if (u_rotation_type.x < 1.5)
- // ang = vec2(angle.x,0.0);
- // else if (u_rotation_type.x < 2.5)
- // ang = vec2(0.0,-angle.x);
- // else
- // ang = vec2(-angle.x,0.0);
- ang = angle.xy;
- v_sinangle = sin(ang);
- v_cosangle = cos(ang);
- v_stretch = maxscale(v_sinangle, v_cosangle);
+ // Precalculate a bunch of useful values we'll need in the fragment
+ // shader.
+ vec2 ang;
+ // if (u_rotation_type.x < 0.5)
+ // ang = vec2(0.0,angle.x);
+ // else if (u_rotation_type.x < 1.5)
+ // ang = vec2(angle.x,0.0);
+ // else if (u_rotation_type.x < 2.5)
+ // ang = vec2(0.0,-angle.x);
+ // else
+ // ang = vec2(-angle.x,0.0);
+ ang = angle.xy;
+ v_sinangle = sin(ang);
+ v_cosangle = cos(ang);
+ v_stretch = maxscale(v_sinangle, v_cosangle);
- // The size of one texel, in texture-coordinates.
- v_one = 1.0 / u_tex_size0.xy;
+ // The size of one texel, in texture-coordinates.
+ v_one = 1.0 / u_tex_size0.xy;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc
index 4bd5a57e3ef..a5fb1d22622 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc
@@ -1,18 +1,23 @@
$input a_position, a_texcoord0, a_color0
-$output v_texCoord, v_coeffs
+$output v_texCoord, v_coeffs, v_coeffs2
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
uniform vec4 u_width;
uniform vec4 u_aspect;
void main()
{
- float wid = u_width.x*u_tex_size0.x/(320.*u_aspect.x);;
- v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid));
+ float wid = u_width.x*u_tex_size0.x/(320.*u_aspect.x);
+ v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid));
+ v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid));
- // Do the standard vertex processing.
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_texCoord = a_texcoord0;
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc
index 3ff1e07f236..93676cde1d5 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc
@@ -1,18 +1,23 @@
$input a_position, a_texcoord0, a_color0
-$output v_texCoord, v_coeffs
+$output v_texCoord, v_coeffs, v_coeffs2
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
uniform vec4 u_width;
uniform vec4 u_aspect;
void main()
{
- float wid = u_width.x*u_tex_size0.y/(320.*u_aspect.y);
- v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid));
+ float wid = u_width.x*u_tex_size0.y/(320.*u_aspect.y);
+ v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid));
+ v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid));
- // Do the standard vertex processing.
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_texCoord = a_texcoord0;
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc
new file mode 100644
index 00000000000..2ca983d41d7
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc
@@ -0,0 +1,53 @@
+$input a_position, a_texcoord0, a_color0
+$output v_texCoord, v_lpcoeffs1, v_lpcoeffs2
+
+#include "common.sh"
+
+uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
+uniform vec4 u_lowpass_cutoff;
+uniform vec4 u_lowpass_width;
+
+void main()
+{
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
+
+ // interpret the cutoff and width as target resolutions in pixels per scanline
+ // include factor of 1/2 because max frequency at given resolution is Nyquist
+ float a = 0.5 * u_lowpass_cutoff.x / u_tex_size0.x;
+ float b = 0.5 * u_lowpass_width.x / u_tex_size0.x;
+ float w0 = (a-0.5*b);
+ float w1 = (a+0.5*b);
+
+ float two_pi = 6.283185307179586;
+ vec3 n1 = vec3(1.0,2.0,3.0);
+ vec4 n2 = vec4(4.0,5.0,6.0,7.0);
+
+ // target frequency response:
+ // 1 for w < w0
+ // 0 for w > w1
+ // linearly decreasing for w0 < w < w1
+ // this will be approximated by including the lowest Fourier modes
+ if (w0 > 0.5) { // no filtering
+ v_lpcoeffs1 = vec4(1.0,0.0,0.0,0.0);
+ v_lpcoeffs2 = vec4_splat(0.0);
+ } else if (w1 > 0.5) { // don't reach zero
+ // here the target has a nonzero response at the Nyquist frequency
+ v_lpcoeffs1.x = w1 + w0 - (w1 - 0.5)*(w1 - 0.5)/(w1 - w0);
+ v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*0.5*n1) );
+ v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*0.5*n2) );
+ } else if (w1 == w0) { // sharp cutoff
+ v_lpcoeffs1.x = 2.0 * w0;
+ v_lpcoeffs1.yzw = 2.0 / ( two_pi * n1 ) * sin(two_pi*w0*n1);
+ v_lpcoeffs2 = 2.0 / ( two_pi * n2 ) * sin(two_pi*w0*n2);
+ } else {
+ v_lpcoeffs1.x = w1 + w0;
+ v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*w1*n1) );
+ v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*w1*n2) );
+ }
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc
new file mode 100644
index 00000000000..8424e153cdb
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc
@@ -0,0 +1,16 @@
+$input a_position, a_texcoord0, a_color0
+$output v_texCoord
+
+#include "common.sh"
+
+uniform vec4 u_inv_view_dims;
+
+void main()
+{
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc
index bdd09148403..8424e153cdb 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc
@@ -3,9 +3,14 @@ $output v_texCoord
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- // Do the standard vertex processing.
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_texCoord = a_texcoord0;
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc
index bdd09148403..8424e153cdb 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc
@@ -3,9 +3,14 @@ $output v_texCoord
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- // Do the standard vertex processing.
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_texCoord = a_texcoord0;
+ // Do the standard vertex processing.
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texCoord = a_texcoord0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc
index 37a119ec7d4..ce22c1e7200 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc
@@ -32,14 +32,18 @@ $output v_texcoord0, v_texcoord1, v_color0
// Autos
uniform vec4 u_source_size;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
-
+
onex = vec2(1.0 / u_source_size.x, 0.0);
oney = vec2(0.0, 1.0 / u_source_size.y);
-
+
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/eagle/fs_eagle.sc b/src/osd/modules/render/bgfx/shaders/chains/eagle/fs_eagle.sc
index a07a848ffbd..ca769f5dc07 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/eagle/fs_eagle.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/eagle/fs_eagle.sc
@@ -7,7 +7,7 @@ $input v_color0, texCoord, t1, t2, t3, t4, t5, t6, t7, t8
/* Copied from the Dosbox source code */
/* Copyright (C) 2002-2007 The DOSBox Team */
/* License: GNU-GPL */
-/* Adapted by guest(r) on 16.4.2007 */
+/* Adapted by guest(r) on 16.4.2007 */
#include "common.sh"
@@ -32,10 +32,10 @@ float GET_RESULT(float A, float B, float C, float D)
float r = 0.0;
if (A == C) x += 1.0; else if (B == C) y += 1.0;
if (A == D) x += 1.0; else if (B == D) y += 1.0;
- if (x <= 1.0) r += 1.0;
+ if (x <= 1.0) r += 1.0;
if (y <= 1.0) r -= 1.0;
return r;
-}
+}
void main()
{
@@ -43,7 +43,7 @@ void main()
// Reading the texels
- vec3 C0 = texture2D(decal, t1.xy).xyz;
+ vec3 C0 = texture2D(decal, t1.xy).xyz;
vec3 C1 = texture2D(decal, t1.zw).xyz;
vec3 C2 = texture2D(decal, t2.xy).xyz;
vec3 D3 = texture2D(decal, t2.zw).xyz;
@@ -62,7 +62,7 @@ void main()
vec3 p00,p10,p01,p11;
- // reducing float3 to float
+ // reducing float3 to float
float c0 = reduce(C0); float c1 = reduce(C1);
float c2 = reduce(C2); float c3 = reduce(C3);
float c4 = reduce(C4); float c5 = reduce(C5);
@@ -76,7 +76,7 @@ void main()
/* Copied from the Dosbox source code */
/* Copyright (C) 2002-2007 The DOSBox Team */
/* License: GNU-GPL */
- /* Adapted by guest(r) on 16.4.2007 */
+ /* Adapted by guest(r) on 16.4.2007 */
if (c4 != c8)
{
if (c7 == c5)
@@ -122,16 +122,16 @@ void main()
else
{
p01 = 0.5 * (C4 + C5);
- }
+ }
- if ((c8 == d2) || (c3 == c4))
- {
+ if ((c8 == d2) || (c3 == c4))
+ {
p10 = 0.25 * (3.0 * C4 + C7);
- }
- else
- {
+ }
+ else
+ {
p10 = 0.5 * (C7 + C8);
- }
+ }
}
else
{
@@ -158,8 +158,8 @@ void main()
}
}
}
-
+
p10 = (fp.x < 0.50) ? (fp.y < 0.50 ? p00 : p10) : (fp.y < 0.50 ? p01: p11);
-
+
gl_FragColor = vec4(p10.rgb, 1.0);
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc b/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc
index d233629a036..095d5d562e0 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc
@@ -8,18 +8,22 @@ $output v_color0, texCoord, t1, t2, t3, t4, t5, t6, t7, t8
/* Copied from the Dosbox source code */
/* Copyright (C) 2002-2007 The DOSBox Team */
/* License: GNU-GPL */
-/* Adapted by guest(r) on 16.4.2007 */
+/* Adapted by guest(r) on 16.4.2007 */
#include "common.sh"
// Autos
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_color0 = a_color0;
-
+
vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy;
float dx = ps.x;
float dy = ps.y;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
index 51bb14676d3..2c11ac8499b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
@@ -22,10 +22,11 @@ void main()
vec4 cin = texture2D(s_tex, v_texcoord0);
vec4 cout = vec4(0.0, 0.0, 0.0, cin.a);
mat3 xy = mat3(u_chroma_a.xyz, u_chroma_b.xyz, u_chroma_c.xyz);
- const mat3 XYZ_TO_sRGB = mat3(
- 3.2406, -0.9689, 0.0557,
- -1.5372, 1.8758, -0.2040,
- -0.4986, 0.0415, 1.0570
+
+ mat3 XYZ_TO_sRGB = mtxFromRows3(
+ vec3( 3.2406, -1.5372, -0.4986),
+ vec3(-0.9689, 1.8758, 0.0415),
+ vec3( 0.0557, -0.2040, 1.0570)
);
for (int i = 0; i < 3; ++i) {
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_defocus.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_defocus.sc
index cfb7b487596..20820f0c0a3 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_defocus.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_defocus.sc
@@ -25,7 +25,7 @@ void main()
{
// previously this pass was applied two times with offsets of 0.25, 0.5, 0.75, 1.0
// now this pass is applied only once with offsets of 0.25, 0.55, 1.0, 1.6 to achieve the same appearance as before till a maximum defocus of 2.0
- // 0.075x² + 0.225x + 0.25
+ // 0.075x² + 0.225x + 0.25
const vec2 Coord1Offset = vec2(-1.60, 0.25);
const vec2 Coord2Offset = vec2(-1.00, -0.55);
const vec2 Coord3Offset = vec2(-0.55, 1.00);
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc
index 36f4fa9eaad..ed4f6195944 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc
@@ -134,11 +134,11 @@ vec2 GetDistortedCoords(vec2 centerCoord, float amount, float amountCube)
float r2 = centerCoord.x * centerCoord.x + centerCoord.y * centerCoord.y;
float f = kcube == 0.0 ? 1.0 + r2 * k : 1.0 + r2 * (k + kcube * sqrt(r2));
- // fit screen bounds
+ // fit screen bounds
f /= 1.0 + amount * 0.25 + amountCube * 0.125;
// apply cubic distortion factor
- centerCoord *= f;
+ centerCoord *= f;
return centerCoord;
}
@@ -183,7 +183,7 @@ void main()
// corner distortion at least by the amount of the image distorition
float distortCornerAmount = max(u_distort_corner.x, u_distortion.x + u_cubic_distortion.x);
- float roundCornerAmount = u_round_corner.x * 0.5;
+ float roundCornerAmount = u_round_corner.x * 0.5;
float smoothBorderAmount = u_smooth_border.x * 0.5;
vec2 TexelDims = vec2(1.0 / u_target_dims.x, 1.0 / u_target_dims.y);
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_decode.sc
index b196674a094..60b54381ec3 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_decode.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_decode.sc
@@ -52,7 +52,7 @@ void main()
vec4 PI = vec4(3.1415927, 3.1415927, 3.1415927, 3.1415927);
vec4 PI2 = vec4(6.2831854, 6.2831854, 6.2831854, 6.2831854);
-
+
vec4 Fc_y1 = (u_cc_value.xxxx - u_notch_width.xxxx * onehalf) * TimePerSample;
vec4 Fc_y2 = (u_cc_value.xxxx + u_notch_width.xxxx * onehalf) * TimePerSample;
vec4 Fc_y3 = u_y_freq_response.xxxx * TimePerSample;
@@ -69,7 +69,7 @@ void main()
vec4 Fc_y2_pi2 = Fc_y2 * PI2;
vec4 Fc_y3_pi2 = Fc_y3 * PI2;
vec4 PI2Length = PI2 / SampleCount;
-
+
vec4 W = PI2 * u_cc_value.xxxx * u_scan_time.xxxx;
vec4 WoPI = W / PI;
@@ -120,7 +120,7 @@ void main()
IAccum = IAccum + C * cos(WT) * FilterI;
QAccum = QAccum + C * sin(WT) * FilterQ;
}
-
+
vec3 YIQ = vec3(
(YAccum.r + YAccum.g + YAccum.b + YAccum.a),
(IAccum.r + IAccum.g + IAccum.b + IAccum.a) * 2.0,
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_encode.sc
index 61964c10c30..e94eeff6962 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_encode.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_ntsc_encode.sc
@@ -58,7 +58,7 @@ void main()
const float PI = 3.1415927;
const float PI2 = 6.2831854;
-
+
float W = PI2 * u_cc_value.x * u_scan_time.x;
float WoPI = W / PI;
@@ -69,4 +69,4 @@ void main()
vec4 TW = T * W;
gl_FragColor = Y + I * cos(TW) + Q * sin(TW);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc
index 5942c75bab6..2126398062b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc
@@ -37,34 +37,15 @@ SAMPLER2D(s_shadow, 1);
// Scanline Pixel Shader
//-----------------------------------------------------------------------------
-vec2 GetAdjustedCoords(vec2 coord)
-{
- // center coordinates
- coord -= 0.5;
-
- // apply screen scale
- coord *= u_screen_scale.xy;
-
- // un-center coordinates
- coord += 0.5;
-
- // apply screen offset
- coord += u_screen_offset.xy;
-
- return coord;
-}
-
void main()
{
- vec2 BaseCoord = GetAdjustedCoords(v_texcoord0);
-
// Color
- vec4 BaseColor = texture2D(s_tex, BaseCoord);
+ vec4 BaseColor = texture2D(s_tex, v_texcoord0);
// Clamp
- if (BaseCoord.x < 0.0 || BaseCoord.y < 0.0 || BaseCoord.x > 1.0 || BaseCoord.y > 1.0)
+ if (v_texcoord0.x < 0.0 || v_texcoord0.y < 0.0 || v_texcoord0.x > 1.0 || v_texcoord0.y > 1.0)
{
- gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
}
else
{
@@ -76,7 +57,7 @@ void main()
float ColorBrightness = 0.299 * BaseColor.r + 0.587 * BaseColor.g + 0.114 * BaseColor.b;
- float ScanCoord = BaseCoord.y;
+ float ScanCoord = v_texcoord0.y;
ScanCoord += u_swap_xy.x > 0.0
? u_quad_dims.x <= u_source_dims.x * 2.0
? 0.5 / u_quad_dims.x // uncenter scanlines if the quad is less than twice the size of the source
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc
index b77d85d1ea8..55c2f0e2e34 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc
@@ -8,6 +8,7 @@ $output v_color0, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3
// Autos
uniform vec4 u_source_size;
+uniform vec4 u_inv_view_dims;
// User-supplied
uniform vec4 u_converge_red;
@@ -20,6 +21,9 @@ uniform vec4 u_radial_converge_blue;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
vec2 half_value = vec2(0.5, 0.5);
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq2x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq2x.sc
index 38f81111567..3f6c2645ba4 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq2x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq2x.sc
@@ -57,11 +57,11 @@ void main()
mat3 pattern = mat3(diff(w5, w1), diff(w5, w2), diff(w5, w3), diff(w5, w4), 0.0, diff(w5, w6), diff(w5, w7), diff(w5, w8), diff(w5, w9));
vec4 cross = vec4(diff(w4, w2), diff(w2, w6), diff(w8, w4), diff(w6, w8));
-
+
vec2 index;
index.x = dot(pattern[0], vec3( 1.0, 2.0, 4.0)) +
- dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
- dot(pattern[2], vec3(32.0, 64.0, 128.0));
+ dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
+ dot(pattern[2], vec3(32.0, 64.0, 128.0));
index.y = dot(cross, vec4(1.0, 2.0, 4.0, 8.0)) * SCALE * SCALE + dot(floor(fp * vec2(SCALE, SCALE)), vec2(1.0, SCALE));
vec2 step = vec2(1.0, 1.0) / vec2(256.0, 16.0 * (SCALE * SCALE));
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq3x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq3x.sc
index a29c2c00da8..1cb08a52da4 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq3x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq3x.sc
@@ -57,11 +57,11 @@ void main()
mat3 pattern = mat3(diff(w5, w1), diff(w5, w2), diff(w5, w3), diff(w5, w4), 0.0, diff(w5, w6), diff(w5, w7), diff(w5, w8), diff(w5, w9));
vec4 cross = vec4(diff(w4, w2), diff(w2, w6), diff(w8, w4), diff(w6, w8));
-
+
vec2 index;
index.x = dot(pattern[0], vec3( 1.0, 2.0, 4.0)) +
- dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
- dot(pattern[2], vec3(32.0, 64.0, 128.0));
+ dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
+ dot(pattern[2], vec3(32.0, 64.0, 128.0));
index.y = dot(cross, vec4(1.0, 2.0, 4.0, 8.0)) * SCALE * SCALE + dot(floor(fp * vec2(SCALE, SCALE)), vec2(1.0, SCALE));
vec2 step = vec2(1.0, 1.0) / vec2(256.0, 16.0 * (SCALE * SCALE));
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq4x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq4x.sc
index e6c0e1c2aaa..6e87d47dc0c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq4x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/fs_hq4x.sc
@@ -57,11 +57,11 @@ void main()
mat3 pattern = mat3(diff(w5, w1), diff(w5, w2), diff(w5, w3), diff(w5, w4), 0.0, diff(w5, w6), diff(w5, w7), diff(w5, w8), diff(w5, w9));
vec4 cross = vec4(diff(w4, w2), diff(w2, w6), diff(w8, w4), diff(w6, w8));
-
+
vec2 index;
index.x = dot(pattern[0], vec3( 1.0, 2.0, 4.0)) +
- dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
- dot(pattern[2], vec3(32.0, 64.0, 128.0));
+ dot(pattern[1], vec3( 8.0, 0.0, 16.0)) +
+ dot(pattern[2], vec3(32.0, 64.0, 128.0));
index.y = dot(cross, vec4(1.0, 2.0, 4.0, 8.0)) * SCALE * SCALE + dot(floor(fp * vec2(SCALE, SCALE)), vec2(1.0, SCALE));
vec2 step = vec2(1.0, 1.0) / vec2(256.0, 16.0 * (SCALE * SCALE));
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc
index a77ac7006f7..727f5763857 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc
@@ -8,12 +8,16 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
// Autos
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_color0 = a_color0;
-
+
vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy;
float dx = ps.x;
float dy = ps.y;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc
index a77ac7006f7..727f5763857 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc
@@ -8,12 +8,16 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
// Autos
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_color0 = a_color0;
-
+
vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy;
float dx = ps.x;
float dy = ps.y;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc
index a77ac7006f7..727f5763857 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc
@@ -8,12 +8,16 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
// Autos
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_color0 = a_color0;
-
+
vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy;
float dx = ps.x;
float dy = ps.y;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_lcd-grid.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_lcd-grid.sc
new file mode 100644
index 00000000000..801d1a2e9a4
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_lcd-grid.sc
@@ -0,0 +1,106 @@
+$input v_color0, v_texcoord0
+
+// license:GPL-2.0+
+// copyright-holders:cgwg
+
+#include "common.sh"
+
+SAMPLER2D(s_tex, 0);
+
+uniform vec4 u_tex_size0;
+uniform vec4 u_quad_dims;
+uniform vec4 u_rsubpix;
+uniform vec4 u_gsubpix;
+uniform vec4 u_bsubpix;
+uniform vec4 u_gain;
+uniform vec4 u_LCDgamma;
+uniform vec4 u_blacklevel;
+uniform vec4 u_ambient;
+uniform vec4 u_BGR;
+uniform vec4 u_monitorgamma;
+uniform vec4 u_subpixsize;
+
+vec3 fetch_offset(vec2 coord, vec2 offset)
+{
+ vec2 x = coord + offset;
+ vec3 col = texture2D(s_tex, x).rgb;
+ vec3 col2 = pow(vec3_splat(u_gain.x) * col + vec3_splat(u_blacklevel.x), vec3_splat(u_LCDgamma.x)) + vec3_splat(u_ambient.x);
+ // want zero for outside pixels
+ vec4 b = step(0.0,vec4(x.x,x.y,1.0-x.x,1.0-x.y));
+ return vec3_splat(b.x*b.y*b.z*b.w) * col2;
+}
+
+float intsmear_func(float z, float c1, float c2, float c3, float c4, float c5, float c6)
+{
+ float z2 = z*z;
+ // both cases have c0=1
+ return z * (1.0 + z2*(c1 + z2*(c2 + z2*(c3 + z2*(c4 + z2*(c5 + z2*c6))))));
+}
+
+float intsmear_fx(float z)
+{
+ // integral of (1 - x^2 - x^4 + x^6)^2
+ return intsmear_func(z, -2.0/3.0, -1.0/5.0, 4.0/7.0, -1.0/9.0, -2.0/11.0, 1.0/13.0);
+}
+
+float intsmear_fy(float z)
+{
+ // integral of (1 - 2x^4 + x^6)^2
+ return intsmear_func(z, 0.0, -4.0/5.0, 2.0/7.0, 4.0/9.0, -4.0/11.0, 1.0/13.0);
+}
+
+float intsmear_x(float x, float dx, float d)
+{
+ float zl = clamp((x-dx*0.5)/d,-1.0,1.0);
+ float zh = clamp((x+dx*0.5)/d,-1.0,1.0);
+ return d * ( intsmear_fx(zh) - intsmear_fx(zl) )/dx;
+}
+float intsmear_y(float x, float dx, float d)
+{
+ float zl = clamp((x-dx*0.5)/d,-1.0,1.0);
+ float zh = clamp((x+dx*0.5)/d,-1.0,1.0);
+ return d * ( intsmear_fy(zh) - intsmear_fy(zl) )/dx;
+}
+
+void main()
+{
+ vec3 cr = pow(u_rsubpix.rgb, vec3_splat(u_monitorgamma.x));
+ vec3 cg = pow(u_gsubpix.rgb, vec3_splat(u_monitorgamma.x));
+ vec3 cb = pow(u_bsubpix.rgb, vec3_splat(u_monitorgamma.x));
+
+ vec2 tl = v_texcoord0 * u_tex_size0.xy - vec2(0.5,0.5);
+ vec2 tli = floor(tl);
+ float subpix = fract(tl.x) * 3.0;
+ float rsubpix = u_tex_size0.x / u_quad_dims.x * 3.0;
+
+ vec3 lcol, rcol;
+ lcol = vec3(intsmear_x(subpix+1.0, rsubpix, 3.0*u_subpixsize.x),
+ intsmear_x(subpix , rsubpix, 3.0*u_subpixsize.x),
+ intsmear_x(subpix-1.0, rsubpix, 3.0*u_subpixsize.x));
+ rcol = vec3(intsmear_x(subpix-2.0, rsubpix, 3.0*u_subpixsize.x),
+ intsmear_x(subpix-3.0, rsubpix, 3.0*u_subpixsize.x),
+ intsmear_x(subpix-4.0, rsubpix, 3.0*u_subpixsize.x));
+
+ if (u_BGR.x > 0.5) {
+ lcol.rgb = lcol.bgr;
+ rcol.rgb = rcol.bgr;
+ }
+
+ float tcol, bcol;
+ subpix = fract(tl.y);
+ rsubpix = u_tex_size0.y / u_quad_dims.y;
+ tcol = intsmear_y(subpix ,rsubpix, u_subpixsize.y);
+ bcol = intsmear_y(subpix-1.0,rsubpix, u_subpixsize.y);
+
+ tl = (tli + vec2_splat(0.5)) / u_tex_size0.xy;
+ vec2 one = vec2_splat(1.0) / u_tex_size0.xy;
+
+ vec3 ul = fetch_offset(tl, vec2(0,0) ) * lcol * vec3_splat(tcol);
+ vec3 br = fetch_offset(tl, one ) * rcol * vec3_splat(bcol);
+ vec3 bl = fetch_offset(tl, vec2(0,one.y)) * lcol * vec3_splat(bcol);
+ vec3 ur = fetch_offset(tl, vec2(one.x,0)) * rcol * vec3_splat(tcol);
+
+ vec3 csum = ul + br + bl + ur;
+ vec3 col = mul(mtxFromCols(u_rsubpix.rgb, u_gsubpix.rgb, u_bsubpix.rgb), csum);
+ gl_FragColor = vec4(pow(col, vec3_splat(1.0/u_monitorgamma.x)), 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_persistence.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_persistence.sc
new file mode 100644
index 00000000000..4c9e998d3ec
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/fs_persistence.sc
@@ -0,0 +1,16 @@
+$input v_color0, v_texcoord0
+
+#include "common.sh"
+
+SAMPLER2D(s_screen, 0);
+SAMPLER2D(s_motionblur, 1);
+
+uniform vec4 u_persistence;
+
+void main()
+{
+ vec4 screen = texture2D(s_screen , v_texcoord0);
+ vec4 motionblur = texture2D(s_motionblur, v_texcoord0);
+
+ gl_FragColor = mix(screen, motionblur, u_persistence.x);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/varying.def.sc
new file mode 100644
index 00000000000..2aa3cb425c0
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/varying.def.sc
@@ -0,0 +1,6 @@
+vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
+vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
+
+vec3 a_position : POSITION;
+vec4 a_color0 : COLOR0;
+vec2 a_texcoord0 : TEXCOORD0;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc
new file mode 100644
index 00000000000..df2b37f203c
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc
@@ -0,0 +1,19 @@
+$input a_position, a_texcoord0, a_color0
+$output v_texcoord0, v_color0
+
+// license:BSD-3-Clause
+// copyright-holders:Dario Manesku
+
+#include "common.sh"
+
+uniform vec4 u_inv_view_dims;
+
+void main()
+{
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texcoord0 = a_texcoord0;
+ v_color0 = a_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc
new file mode 100644
index 00000000000..df2b37f203c
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc
@@ -0,0 +1,19 @@
+$input a_position, a_texcoord0, a_color0
+$output v_texcoord0, v_color0
+
+// license:BSD-3-Clause
+// copyright-holders:Dario Manesku
+
+#include "common.sh"
+
+uniform vec4 u_inv_view_dims;
+
+void main()
+{
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+ v_texcoord0 = a_texcoord0;
+ v_color0 = a_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_bcg.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_bcg.sc
new file mode 100644
index 00000000000..37d64462c51
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_bcg.sc
@@ -0,0 +1,24 @@
+$input v_color0, v_texcoord0
+
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+
+#include "common.sh"
+
+// Samplers
+SAMPLER2D(s_tex, 0);
+SAMPLER2D(s_pal, 1);
+
+uniform vec4 u_inv_tex_size1;
+
+void main()
+{
+ vec4 src = texture2D(s_tex, v_texcoord0);
+ vec2 blu_uv = vec2(src.b * 256.0, 0.0) * u_inv_tex_size1.xy;
+ vec2 grn_uv = vec2(src.g * 256.0, 1.0) * u_inv_tex_size1.xy;
+ vec2 red_uv = vec2(src.r * 256.0, 2.0) * u_inv_tex_size1.xy;
+ float blu = texture2D(s_pal, blu_uv).b;
+ float grn = texture2D(s_pal, grn_uv).g;
+ float red = texture2D(s_pal, red_uv).r;
+ gl_FragColor = vec4(red, grn, blu, src.a) * v_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_palette16.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_palette16.sc
new file mode 100644
index 00000000000..6ecfbcb1a72
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_palette16.sc
@@ -0,0 +1,37 @@
+$input v_color0, v_texcoord0
+
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+
+#include "common.sh"
+
+// Samplers
+SAMPLER2D(s_tex, 0);
+SAMPLER2D(s_pal, 1);
+
+uniform vec4 u_tex_size0;
+uniform vec4 u_inv_tex_size0;
+uniform vec4 u_inv_tex_size1;
+
+void main()
+{
+ vec2 original_uv = v_texcoord0.xy * u_tex_size0.xy * vec2(2.0, 1.0);
+ float mod_val = mod(original_uv.x, 4.0);
+ vec2 rounded_uv = vec2(original_uv.x - mod_val, original_uv.y) * vec2(0.5, 1.0);
+
+ float inv_width = u_inv_tex_size0.x * 0.5;
+
+ vec2 palette_uv = vec2(0.0, 0.0);
+ if (mod_val < 2.0)
+ {
+ palette_uv.x = texture2D(s_tex, rounded_uv * u_inv_tex_size0.xy + vec2(inv_width * 0.5, 0.0)).r;
+ palette_uv.y = texture2D(s_tex, rounded_uv * u_inv_tex_size0.xy + vec2(inv_width * 1.5, 0.0)).r;
+ }
+ else
+ {
+ palette_uv.x = texture2D(s_tex, rounded_uv * u_inv_tex_size0.xy + vec2(inv_width * 2.5, 0.0)).r;
+ palette_uv.y = texture2D(s_tex, rounded_uv * u_inv_tex_size0.xy + vec2(inv_width * 3.5, 0.0)).r;
+ }
+
+ gl_FragColor = vec4(texture2D(s_pal, palette_uv * vec2(256.0, 256.0) * u_inv_tex_size1.xy).rgb, 1.0) * v_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_rgb32.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_rgb32.sc
new file mode 100644
index 00000000000..4292e6cddc6
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_rgb32.sc
@@ -0,0 +1,14 @@
+$input v_color0, v_texcoord0
+
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+
+#include "common.sh"
+
+// Samplers
+SAMPLER2D(s_tex, 0);
+
+void main()
+{
+ gl_FragColor = vec4(texture2D(s_tex, v_texcoord0).rgb, 1.0) * v_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_yuy16.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_yuy16.sc
new file mode 100644
index 00000000000..af3eb3e3954
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_blit_yuy16.sc
@@ -0,0 +1,38 @@
+$input v_color0, v_texcoord0
+
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+
+#include "common.sh"
+
+// Samplers
+SAMPLER2D(s_tex, 0);
+
+uniform vec4 u_tex_size0;
+uniform vec4 u_inv_tex_size0;
+
+vec3 ycc_to_rgb(float y, float cb, float cr)
+{
+ float common = 1.168627 * (y - 0.062745);
+ float r = saturate(common + 1.603922 * (cr - 0.5));
+ float g = saturate(common - 0.392157 * (cb - 0.5) - 0.815686 * (cr - 0.5));
+ float b = saturate(common + 2.023529 * (cb - 0.5));
+ return vec3(r, g, b);
+}
+
+void main()
+{
+ vec2 half_texel = u_inv_tex_size0.xy * vec2(0.5, 0.5);
+
+ vec2 original_uv = v_texcoord0.xy * u_tex_size0.xy;
+ float mod_val = mod(original_uv.x, 2.0);
+ vec2 rounded_uv = vec2(original_uv.x - mod_val, original_uv.y);
+ vec4 srcpix = texture2D(s_tex, rounded_uv * u_inv_tex_size0.xy + half_texel.x);
+
+ float cr = srcpix.r;
+ float cb = srcpix.b;
+ if (mod_val < 1.0)
+ gl_FragColor = vec4(ycc_to_rgb(srcpix.g, cb, cr), 1.0) * v_color0;
+ else
+ gl_FragColor = vec4(ycc_to_rgb(srcpix.a, cb, cr), 1.0) * v_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_bob-and-ghost-deinterlace.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_bob-and-ghost-deinterlace.sc
index 45d38a0e020..d69e9a8f7bc 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_bob-and-ghost-deinterlace.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_bob-and-ghost-deinterlace.sc
@@ -7,7 +7,7 @@ $input v_color0, v_texcoord0
Bob-and-ghost Deinterlacing
Author: hunterk
License: Public domain
-
+
Note: This shader is designed to work with the typical interlaced output from an emulator, which displays both even and odd fields twice.
As such, it is inappropriate for general video use unless the video has already been similarly woven beforehand.
*/
@@ -30,7 +30,7 @@ void main()
float y;
// assume anything with a vertical resolution greater than 400 lines is interlaced
- if (u_tex_size0.y > 400.0)
+ if (u_tex_size0.y > 400.0)
{
y = u_tex_size0.y * v_texcoord0.y;// FIXME + IN.frame_count;
res = pow(vec4(texture2D(s0, v_texcoord0 + vec2(0.0, one_pixel.y))), exponent);
@@ -50,6 +50,6 @@ void main()
{
res = vec4(pow(texture2D(s0, v_texcoord0), exponent));
}
-
+
gl_FragColor = vec4(pow((res + color) / 2.0, inv_exponent));
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass0.sc
index cbff9f450e8..090485da1bc 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass0.sc
@@ -5,7 +5,7 @@ $input v_color0, v_texcoord0, v_texcoord1
/*
Hyllian's Deposterize Shader - Pass0
-
+
Copyright (C) 2011/2016 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -20,7 +20,7 @@ uniform vec4 DIFF_THRESH1;
vec3 df3(vec3 c1, vec3 c2)
{
- return abs(c1 - c2);
+ return abs(c1 - c2);
}
bvec3 le3(vec3 A, vec3 B, vec3 param)
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass1.sc
index c6e0e87b018..085f767358c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_deposterize-pass1.sc
@@ -5,7 +5,7 @@ $input v_color0, v_texcoord0, v_texcoord1
/*
Hyllian's Deposterize Shader - Pass1
-
+
Copyright (C) 2011/2016 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -20,7 +20,7 @@ uniform vec4 DIFF_THRESH2;
vec3 df3(vec3 c1, vec3 c2)
{
- return abs(c1 - c2);
+ return abs(c1 - c2);
}
bvec3 le3(vec3 A, vec3 B, vec3 param)
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc
index 2c8cffab7e1..6b00e4a1934 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/fs_lut.sc
@@ -5,9 +5,9 @@ $input v_color0, v_texcoord0
#include "common.sh"
-#define LUT_TEXTURE_WIDTH 4096.0f
-#define LUT_SIZE 64.0f
-#define LUT_SCALE vec2(1.0f / LUT_TEXTURE_WIDTH, 1.0f / LUT_SIZE)
+// Autos
+uniform vec4 u_tex_size1;
+uniform vec4 u_inv_tex_size1;
SAMPLER2D(s_tex, 0);
SAMPLER2D(s_3dlut, 1);
@@ -17,13 +17,12 @@ void main()
vec4 bp = texture2D(s_tex, v_texcoord0);
vec3 color = bp.rgb;
// NOTE: Do not change the order of parameters here.
- vec3 lutcoord = vec3(color.rg * ((LUT_SIZE - 1.0f) + 0.5f) *
- LUT_SCALE, (LUT_SIZE - 1.0f) * color.b);
+ vec3 lutcoord = vec3(color.rg * ((u_tex_size1.y - 1.0) + 0.5) * u_inv_tex_size1.xy, (u_tex_size1.y - 1.0) * color.b);
float shift = floor(lutcoord.z);
- lutcoord.x += shift * LUT_SCALE.y;
+ lutcoord.x += shift * u_inv_tex_size1.y;
color.rgb = mix(texture2D(s_3dlut, lutcoord.xy).rgb,
- texture2D(s_3dlut, vec2(lutcoord.x + LUT_SCALE.y,
+ texture2D(s_3dlut, vec2(lutcoord.x + u_inv_tex_size1.y,
lutcoord.y)).rgb, lutcoord.z - shift);
gl_FragColor = vec4(color, bp.a) * v_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc
index 1c3b3ee592f..1ed054f1b9a 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's Deposterize Shader - Pass0 vertex shader
-
+
Copyright (C) 2011/2016 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -14,15 +14,19 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
vec2 ps = vec2(1.0 / u_tex_size0.xy);
float dx = ps.x;
float dy = ps.y;
-
+
// This line fixes a bug in ATI cards.
v_texcoord0 = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4(-dx, 0, dx, 0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc
index 7af87394655..69a23cb477c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's Deposterize Shader - Pass1 vertex shader
-
+
Copyright (C) 2011/2016 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -14,15 +14,19 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
vec2 ps = vec2(1.0 / u_tex_size0.xy);
float dx = ps.x;
float dy = ps.y;
-
+
// This line fixes a bug in ATI cards.
v_texcoord0 = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xyyy + vec4(0, -dy, 0, dy); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc
new file mode 100644
index 00000000000..0a9f2f178e1
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc
@@ -0,0 +1,21 @@
+$input a_position, a_texcoord0, a_color0
+$output v_texcoord0, v_color0
+
+// license:BSD-3-Clause
+// copyright-holders:Dario Manesku
+
+#include "common.sh"
+
+uniform vec4 u_inv_view_dims;
+uniform vec4 u_tex_bounds0;
+
+void main()
+{
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
+
+ v_texcoord0 = a_texcoord0 * (u_tex_bounds0.zw - u_tex_bounds0.xy) + u_tex_bounds0.xy;
+ v_color0 = a_color0;
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_gaussian.sc
index 5375561e8ac..cb6ecf95f0d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/fs_gaussian.sc
@@ -22,7 +22,7 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
-
+
vec2 blur = (u_radius.xx * u_dimension.xy) / u_tex_size0.xy;
sum += texture2D(s_tex, v_texcoord0 - vec2(12.0, 12.0) * blur) * 0.001133;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc
index f071beaaa26..77d392ad813 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc
@@ -9,9 +9,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.1, 0.1);
v_color0 = a_color0;
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_gaussian.sc
index 5375561e8ac..cb6ecf95f0d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/fs_gaussian.sc
@@ -22,7 +22,7 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
-
+
vec2 blur = (u_radius.xx * u_dimension.xy) / u_tex_size0.xy;
sum += texture2D(s_tex, v_texcoord0 - vec2(12.0, 12.0) * blur) * 0.001133;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc
index a9f6649c1e5..6d47076f992 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc
@@ -9,9 +9,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.1);
v_color0 = a_color0;
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_gaussian.sc
index 5375561e8ac..cb6ecf95f0d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/fs_gaussian.sc
@@ -22,7 +22,7 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
-
+
vec2 blur = (u_radius.xx * u_dimension.xy) / u_tex_size0.xy;
sum += texture2D(s_tex, v_texcoord0 - vec2(12.0, 12.0) * blur) * 0.001133;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc
index a473bc4123c..403b880b5ec 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc
@@ -9,9 +9,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.9 - 0.16666666 * 0.9, 0.1);
v_color0 = a_color0;
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_gaussian.sc
index 5375561e8ac..cb6ecf95f0d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/fs_gaussian.sc
@@ -22,7 +22,7 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
-
+
vec2 blur = (u_radius.xx * u_dimension.xy) / u_tex_size0.xy;
sum += texture2D(s_tex, v_texcoord0 - vec2(12.0, 12.0) * blur) * 0.001133;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc
index 8af6a293d8e..7121ae6651c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc
@@ -9,9 +9,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+ gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.9 - 0.685185 * 0.9);
v_color0 = a_color0;
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/warp/fs_dilation-horizontal-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/warp/fs_dilation-horizontal-fast.sc
index 3f03d8e6adb..d4ba6141c82 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/warp/fs_dilation-horizontal-fast.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/warp/fs_dilation-horizontal-fast.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's dilation-horizontal-fast Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -43,4 +43,4 @@ void main()
vec3 res = max(E, max(F, D));
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc
index 828dc3078cf..52e0fc2ae90 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's dilation-horizontal-fast Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,20 +32,24 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
float dx = ps.x;
float dy = ps.y;
- // B
- // D E F
- // H
+ // B
+ // D E F
+ // H
- v_texcoord1 = vec4(1.0 / u_tex_size0.xy, 0.0, 0.0); // F H
+ v_texcoord1 = vec4(1.0 / u_tex_size0.xy, 0.0, 0.0); // F H
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv1-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv1-noblend.sc
index 72212fa74a7..1963dfcd617 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv1-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv1-noblend.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR-lv1-noblend Shader
-
+
Copyright (C) 2011-2014 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -129,4 +129,4 @@ void main()
// final sum and weight normalization
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc
index d9e44f0d4c7..988699a2642 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR-lv2-3d Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -176,7 +176,7 @@ void main()
vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25);
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -231,13 +231,13 @@ void main()
vec3 res1 = E.xyz;
res1 = mix(res1, mix(H.xyz, F.xyz, px.x), maximos.x);
res1 = mix(res1, mix(B.xyz, D.xyz, px.z), maximos.z);
-
+
vec3 res2 = E.xyz;
res2 = mix(res2, mix(F.xyz, B.xyz, px.y), maximos.y);
res2 = mix(res2, mix(D.xyz, H.xyz, px.w), maximos.w);
-
+
vec3 E_mix = (c_df(E.xyz, res2) >= c_df(E.xyz, res1)) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 0.0);
vec3 res = mix(res1, res2, E_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc
index 1b47172209e..b4d461cfca0 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
/*
Hyllian's xBR-lv2-lq Shader
-
+
Copyright (C) 2011/2015 Hyllian/Jararaca - sergiogdb@gmail.com
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
@@ -121,7 +121,7 @@ void main()
vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25);
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -166,13 +166,13 @@ void main()
vec3 res1 = E.xyz;
res1 = mix(res1, mix(H.xyz, F.xyz, px.x), maximos.x);
res1 = mix(res1, mix(B.xyz, D.xyz, px.z), maximos.z);
-
+
vec3 res2 = E.xyz;
res2 = mix(res2, mix(F.xyz, B.xyz, px.y), maximos.y);
res2 = mix(res2, mix(D.xyz, H.xyz, px.w), maximos.w);
-
+
vec3 E_mix = (c_df(E.xyz, res2) >= c_df(E.xyz, res1)) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 0.0);
vec3 res = mix(res1, res2, E_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc
index 80d7269349e..3168daf2ba8 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR-lv2-noblend Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -148,7 +148,7 @@ void main()
#endif
interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0);
-
+
vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g));
vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c));
@@ -174,4 +174,4 @@ void main()
vec3 res = mix(res1, res2, res_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc
index 0294c56b84f..75a6dd3296f 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR-lv2 Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -136,10 +136,10 @@ void main()
vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25);
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
-
+
vec4 interp_restriction_lv0 = vec4(notEqual(e,f)) * vec4(notEqual(e,h));
vec4 interp_restriction_lv1 = interp_restriction_lv0;
@@ -191,7 +191,7 @@ void main()
vec3 res1 = E.xyz;
res1 = mix(res1, mix(H.xyz, F.xyz, px.x), maximos.x);
res1 = mix(res1, mix(B.xyz, D.xyz, px.z), maximos.z);
-
+
vec3 res2 = E.xyz;
res2 = mix(res2, mix(F.xyz, B.xyz, px.y), maximos.y);
res2 = mix(res2, mix(D.xyz, H.xyz, px.w), maximos.w);
@@ -200,4 +200,4 @@ void main()
vec3 res = mix(res1, res2, E_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc
index 554c222db47..b13606724e5 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR-lv3-noblend - Shader
-
+
Copyright (C) 2011/2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -175,7 +175,7 @@ void main()
#endif
interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0);
-
+
vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g));
vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c));
vec4 interp_restriction_lv3_left = eq2(g,g0) * vec4(notEqual(d0,g0));
@@ -186,11 +186,11 @@ void main()
vec4 one = vec4(1.0, 1.0, 1.0, 1.0);
vec4 zero = vec4(0.0, 0.0, 0.0, 0.0);
-
+
vec4 edri = vec4(lessThanEqual(wd1,wd2)) * interp_restriction_lv1;
vec4 edr = vec4(lessThan(wd1,wd2)) * interp_restriction_lv1 * ((1.0 - edri.yzwx) + (1.0 - edri.wxyz));
edr = clamp(edr, 0.0, 1.0);
-
+
vec4 hcDiff = df(h,c);
vec4 fgDiff = df(f,g);
vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * fgDiff, hcDiff)) * interp_restriction_lv2_left * edr * (1.0 - edri.yzwx) * eq(e,c);
@@ -210,4 +210,4 @@ void main()
vec3 res = mix(res1, res2, (df12.y >= df12.x) ? one.xyz : zero.xyz);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc
index 162461d145b..e6a4eb79edb 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR-lv3 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -154,7 +154,7 @@ void main()
vec4 Cw = vec4( 5.0, -1.0, -3.0, 3.0 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao * fp.y + Bo * fp.x);
+ vec4 fx = (Ao * fp.y + Bo * fp.x);
vec4 fx_left = (Ax * fp.y + Bx * fp.x);
vec4 fx_up = (Ay * fp.y + By * fp.x);
vec4 fx3_left= (Az * fp.y + Bz * fp.x);
@@ -189,7 +189,7 @@ void main()
vec4 edr = vec4(lessThan(weighted_distance(e, c, g, i, h5, f4, h, f), weighted_distance( h, d, i5, f, i4, b, e, i))) * interp_restriction_lv1;
vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c))) * interp_restriction_lv2_left;
vec4 edr_up = vec4(greaterThanEqual(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c))) * interp_restriction_lv2_up;
-
+
vec4 edr3_left = interp_restriction_lv3_left;
vec4 edr3_up = interp_restriction_lv3_up;
@@ -232,4 +232,4 @@ void main()
vec3 res = mix(res1, res2, E_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_custom-jinc2-sharper.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_custom-jinc2-sharper.sc
index 0abd7ff41c9..fd9a2d72f94 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_custom-jinc2-sharper.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_custom-jinc2-sharper.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_color0
/*
Hyllian's jinc windowed-jinc 2-lobe sharper with anti-ringing Shader
-
+
Copyright (C) 2011-2014 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -18,14 +18,14 @@ uniform vec4 u_tex_size0;
SAMPLER2D(s_p, 0);
- /*
- This is an approximation of Jinc(x)*Jinc(x*r1/r2) for x < 2.5,
- where r1 and r2 are the first two zeros of jinc function.
- For a jinc 2-lobe best approximation, use A=0.5 and B=0.825.
- */
+/*
+ This is an approximation of Jinc(x)*Jinc(x*r1/r2) for x < 2.5,
+ where r1 and r2 are the first two zeros of jinc function.
+ For a jinc 2-lobe best approximation, use A=0.5 and B=0.825.
+*/
// A=0.5, B=0.825 is the best jinc approximation for x<2.5. if B=1.0, it's a lanczos filter.
-// Increase A to get more blur. Decrease it to get a sharper picture.
+// Increase A to get more blur. Decrease it to get a sharper picture.
// B = 0.825 to get rid of dithering. Increase B to get a fine sharpness, though dithering returns.
#define halfpi 1.5707963267948966192313216916398
@@ -47,12 +47,12 @@ float d(vec2 pt1, vec2 pt2)
vec4 min4(vec4 a, vec4 b, vec4 c, vec4 d)
{
- return min(a, min(b, min(c, d)));
+ return min(a, min(b, min(c, d)));
}
vec4 max4(vec4 a, vec4 b, vec4 c, vec4 d)
{
- return max(a, max(b, max(c, d)));
+ return max(a, max(b, max(c, d)));
}
vec4 resampler(vec4 x)
@@ -131,4 +131,4 @@ void main()
// final sum and weight normalization
gl_FragColor = vec4(color, 1);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.sc
index 8fa47570af5..fdb38420261 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR 3D Shader - pass0 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -95,23 +95,23 @@ float hv_wd(float i1, float i2, float i3, float i4, float e1, float e2, float e3
vec4 min4(vec4 a, vec4 b, vec4 c, vec4 d)
{
- return min(a, min(b, min(c, d)));
+ return min(a, min(b, min(c, d)));
}
vec4 max4(vec4 a, vec4 b, vec4 c, vec4 d)
{
- return max(a, max(b, max(c, d)));
+ return max(a, max(b, max(c, d)));
}
void main()
{
//Skip pixels on wrong grid
vec2 fraction = fract(v_texcoord0 * u_tex_size0.xy / XBR_RES);
- if (fraction.x < 0.5 || fraction.y < 0.5)
- {
- gl_FragColor = texture2D(s0, v_texcoord0);
- return;
- }
+ if (fraction.x < 0.5 || fraction.y < 0.5)
+ {
+ gl_FragColor = texture2D(s0, v_texcoord0);
+ return;
+ }
vec2 tex = (floor(v_texcoord0 * u_tex_size0.xy / XBR_RES) + vec2(0.5, 0.5)) * XBR_RES / u_tex_size0.xy;
@@ -224,4 +224,4 @@ void main()
color = block_3d ? color : E.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.sc
index 72009ad3335..2af3f086523 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR 3D Shader - pass0 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -208,4 +208,4 @@ void main()
color = block_3d ? color : A;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.sc
index c2656424ed6..1f205de0a1b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR 3D Shader - pass2 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -210,4 +210,4 @@ void main()
color = block_3d ? color : A.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.sc
index 8a56a3899a6..389435952a7 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass0 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -214,4 +214,4 @@ void main()
color = block_3d ? color : E.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.sc
index 10288b45f5a..1c805080595 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass1 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -207,4 +207,4 @@ void main()
color = block_3d ? color : A.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.sc
index 51f2c6ea887..4587dc9cc93 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass1 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -208,4 +208,4 @@ void main()
color = block_3d ? color : A.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.sc
index f1566381325..1f9727021d7 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass2 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -223,4 +223,4 @@ void main()
color = block_3d ? color : E.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.sc
index 3aa921a0e37..3e06eb4da47 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass3 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -207,4 +207,4 @@ void main()
color = block_3d ? color : A.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.sc
index b417613a657..2b119f5d066 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super 4XBR 3D Shader - pass3 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -208,4 +208,4 @@ void main()
color = block_3d ? color : A.xyz;
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.sc
index 84fc371a0a7..45bfdb1543b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -161,9 +161,9 @@ void main()
vec4 d_mix = d_edge >= 0.0 ? vec4(1.0, 1.0, 1.0, 1.0) : vec4(0.0, 0.0, 0.0, 0.0);
vec4 min_sample = min4(E, F, H, I) + anti_ring * mix((P2-H)*(F-P1), (P0-E)*(I-P3), d_mix);
vec4 max_sample = max4(E, F, H, I) - anti_ring * mix((P2-H)*(F-P1), (P0-E)*(I-P3), d_mix);
-
+
color = clamp(color, min_sample.xyz, max_sample.xyz);
// color = mix(aux, color, 1-2.0*abs(edge_strength-0.5));
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.sc
index d67c215de66..0248c9f2357 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass1 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -155,5 +155,5 @@ void main()
color = clamp(color, min_sample.xyz, max_sample.xyz);
// color = mix(aux, color, 1-2.0*abs(edge_strength-0.5));
- gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.sc
index 89e82d00a31..546525c861d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass1 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -158,5 +158,5 @@ void main()
color = clamp(color, min_sample.xyz, max_sample.xyz);
// color = mix(aux, color, 1-2.0*abs(edge_strength-0.5));
- gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass0.sc
index a1158ebecca..ebae083c9c5 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass0.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -157,4 +157,4 @@ void main()
color = clamp(color, min_sample.xyz, max_sample.xyz);
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass1.sc
index 421fc78b58c..c99b19376cd 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass1.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass1 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -174,5 +174,5 @@ void main()
vec4 max_sample = max4(E, F, H, I) - anti_ring * mix((P2-H)*(F-P1), (P0-E)*(I-P3), d_mix);
color = clamp(color, min_sample.xyz, max_sample.xyz);
- gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass2.sc
index c343dc155a2..0ac5170af33 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/fs_super-xbr-pass2.sc
@@ -4,9 +4,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass1 *******
-
+
Copyright (c) 2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -166,5 +166,5 @@ void main()
vec4 max_sample = max4(E, F, H, I) - anti_ring * mix((P2-H)*(F-P1), (P0-E)*(I-P3), d_mix);
color = clamp(color, min_sample.xyz, max_sample.xyz);
- gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc
index ae3b049b57a..335c9ef8b4c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
// copyright-holders:Hyllian
/*
-
+
******* Super XBR 3D Shader - pass2 *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc
index c5bd41ee120..338cadbe4b7 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc
@@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc
index c5bd41ee120..338cadbe4b7 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc
@@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc
index 67e2a4d6250..21e16b595e4 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +32,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc
index d76ec041199..fc33723ec9d 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass1 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +32,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc
index 579ee064622..a8ec5539c0b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass2 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +32,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc
index f03cc46e2b7..8352137204e 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc
index 67e2a4d6250..21e16b595e4 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_color0
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +32,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc
index 51ffe87fcaa..8f2d3277665 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc
index 51ffe87fcaa..8f2d3277665 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc
@@ -5,9 +5,9 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
// copyright-holders:Hyllian
/*
-
+
******* Super XBR Shader - pass0 vertex shader *******
-
+
Copyright (c) 2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc
index 3e97446a880..de23993d020 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc
@@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc
index a3bb4330f45..7992b9eee51 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc
@@ -9,10 +9,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
uniform vec4 XBR_RES;
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = XBR_RES.xx / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc
index 38e92865308..48e9664b766 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc
@@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc
index 75541985e36..5bcf3e31f5a 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR-lv2-noblend Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc
index ce6e411b75d..22e993426ed 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc
@@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc
index 5421eaf2955..5957004443c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR-lv3-noblend - Shader
-
+
Copyright (C) 2011/2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc
index f4ee1f55ab3..a5ee8cee547 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR-lv3 - Shader
-
+
Copyright (C) 2011/2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.sc
index 533bfe0f762..6843efd251a 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.7c+ReverseAA (squared) Shader
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -171,7 +171,7 @@ void main()
vec3 s = E.xyz;
vec3 n3 = H.xyz;
vec3 n4 = H5.xyz;
-
+
vec3 aa = n2 - n1;
vec3 bb = s - n2;
vec3 cc = n3 - s;
@@ -192,7 +192,7 @@ void main()
s = s1;
n3 = F.xyz;
n4 = F4.xyz;
-
+
aa = n2 - n1;
bb = s - n2;
cc = n3 - s;
@@ -333,4 +333,4 @@ void main()
}
gl_FragColor = vec4(res.xyz, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.sc
index ea58584408b..46b2c3d9162 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta1
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -176,7 +176,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -262,4 +262,4 @@ void main()
res = mix(res, pix, blend);
gl_FragColor = vec4(clamp(GAMMA_OUT(res), 0.0, 1.0), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.sc
index a4e59937d54..cbb6659d0cd 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - Dithering preserved
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -169,7 +169,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -252,4 +252,4 @@ void main()
res = mix(res, pix, blend);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.sc
index 254e8d878cb..45113f32e80 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta3
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -182,7 +182,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -223,7 +223,7 @@ void main()
m = min(m, sharpness * abs(bb));
m = min(m, sharpness * abs(cc));
t = clamp(t, -m, m);
-
+
vec3 s1 = (2.0 * fp.y - 1.0) * t + s;
n1 = D0.xyz;
@@ -278,4 +278,4 @@ void main()
res = mix(res1, res2, step(c_df(E.xyz, res1), c_df(E.xyz, res2)));
gl_FragColor = vec4(clamp(GAMMA_OUT(res), 0.0, 1.0), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.sc
index e3791fed702..efc8c57d752 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - v4
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -175,7 +175,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -216,7 +216,7 @@ void main()
m = min(m, sharpness * abs(bb));
m = min(m, sharpness * abs(cc));
t = clamp(t, -m, m);
-
+
vec3 s1 = (2.0 * fp.y - 1.0) * t + s;
n1 = D0.xyz;
@@ -268,4 +268,4 @@ void main()
res = mix(res1, res2, step(c_df(E.xyz, res1), c_df(E.xyz, res2)));
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.sc
index 858342d25c6..0beb806443b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8b+ReverseAA (semi-rounded) Shader - v4
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -160,7 +160,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -201,7 +201,7 @@ void main()
m = min(m, sharpness * abs(bb));
m = min(m, sharpness * abs(cc));
t = clamp(t, -m, m);
-
+
vec3 s1 = (2.0 * fp.y - 1.0) * t + s;
n1 = D0.xyz;
@@ -253,4 +253,4 @@ void main()
res = mix(res1, res2, step(c_df(E.xyz, res1), c_df(E.xyz, res2)));
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.sc
index 1a4ad25e765..4e3c20169ec 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta3
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -182,7 +182,7 @@ void main()
vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -223,7 +223,7 @@ void main()
m = min(m, sharpness * abs(bb));
m = min(m, sharpness * abs(cc));
t = clamp(t, -m, m);
-
+
vec3 s1 = (2.0 * fp.y - 1.0) * t + s;
n1 = D0.xyz;
@@ -285,4 +285,4 @@ void main()
res = mix(res, pix, blend);
gl_FragColor = vec4(clamp(GAMMA_OUT(res), 0.0, 1.0), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.sc
index bf3af2de385..aff101a1212 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's 2xBR v3.7c+ReverseAA (squared) Shader
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -176,7 +176,7 @@ void main()
vec3 s = E.xyz;
vec3 n3 = H.xyz;
vec3 n4 = H5.xyz;
-
+
vec3 aa = n2 - n1;
vec3 bb = s - n2;
vec3 cc = n3 - s;
@@ -189,7 +189,7 @@ void main()
m = min(m, 2.0 * abs(cc));
vec3 sim1 = (gt3(abs(bb) * 2.0, threshold) + gt3(abs(cc) * 2.0, threshold) + le3(abs(bb) * 2.0, xx) + le3(abs(cc) * 2.0, xx));
t = clamp(t, -m, m);
-
+
vec3 s1 = (2.0 * fp.y - 1.0) * t + s;
n1 = D0.xyz;
@@ -197,7 +197,7 @@ void main()
s = s1;
n3 = F.xyz;
n4 = F4.xyz;
-
+
aa = n2 - n1;
bb = s - n2;
cc = n3 - s;
@@ -338,4 +338,4 @@ void main()
}
gl_FragColor = vec4(res.xyz, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc
index 339c44e284c..35cc742cff1 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.7c+ReverseAA (squared) Shader
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc
index 9d5468107dd..3a9b0e56b1c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta1
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc
index 8e73b14f713..c08e3988e24 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - Dithering preserved
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc
index b4509adf38c..8c2b0aec4cd 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta3
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc
index b00c03fbce3..d7328857ffd 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - v4
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc
index 2a33ced4126..48ebe4f0a54 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8b+ReverseAA (semi-rounded) Shader - v4
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc
index b4509adf38c..8c2b0aec4cd 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.8c+ReverseAA (squared) Shader - beta3
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc
index 339c44e284c..35cc742cff1 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's 2xBR v3.7c+ReverseAA (squared) Shader
-
+
Copyright (C) 2011/2012 Hyllian/Jararaca - sergiogdb@gmail.com
*/
@@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
vec2 ps = 1.0 / u_tex_size0.xy;
@@ -60,7 +64,7 @@ void main()
// G5 H5 I5
// This line fix a bug in ATI cards.
- vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
+ vec2 texCoord = a_texcoord0 + vec2(0.0000001, 0.0000001);
v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx,-2.0*dy); // A1 B1 C1
v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C
v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.sc
index 5af6ea86cc4..37759601aad 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR LV2 A (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -156,4 +156,4 @@ void main()
info.z = dot(edr_up, vec4(8.0, 4.0, 2.0, 1.0));
gl_FragColor = vec4(remapTo01(info, vec3(0.0, 0.0, 0.0), vec3(255.0, 255.0, 255.0)), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.sc
index 668922ec18c..5c1fb0c9d47 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR LV2 Accuracy - pass0 Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -171,4 +171,4 @@ void main()
info.w = dot(edri, vec4(8.0, 4.0, 2.0, 1.0));
gl_FragColor = remapTo01(info, vec4(0.0, 0.0, 0.0, 0.0), vec4(255.0, 255.0, 255.0, 255.0));
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.sc
index a32605fca4e..19ebe21366f 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 Accuracy - pass1 Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -85,7 +85,7 @@ vec4 unpack_info(float i)
float frac_val = fract(i / 2.0f);
info.w = round(frac_val);
i = i / 2.0f - frac_val;
-
+
frac_val = fract(i / 2.0f);
info.z = round(frac_val);
i = i / 2.0f - frac_val;
@@ -118,7 +118,7 @@ void main()
mat4 h = mat4(H, F, B, D);
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -148,13 +148,13 @@ void main()
vec4 res1 = E;
res1 = mix(res1, mix(H, F, px.x), maximos.x);
res1 = mix(res1, mix(B, D, px.z), maximos.z);
-
+
vec4 res2 = E;
res2 = mix(res2, mix(F, B, px.y), maximos.y);
res2 = mix(res2, mix(D, H, px.w), maximos.w);
-
+
vec3 E_mix = (df1(E, res2) >= df1(E, res1)) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 0.0);
vec3 res = mix(res1.xyz, res2.xyz, E_mix);
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.sc
index 9f9c2836454..0b51db92660 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR LV2 B (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -157,4 +157,4 @@ void main()
info.z = dot(edr_up, vec4(8.0, 4.0, 2.0, 1.0));
gl_FragColor = vec4(remapTo01(info, vec3(0.0, 0.0, 0.0), vec3(255.0, 255.0, 255.0)), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.sc
index e7cc84b299d..c03b2f83af4 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR LV2 C (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -119,15 +119,15 @@ void main()
vec4 interp_restriction_lv1 = clamp(vec4(notEqual(e,f)) * vec4(notEqual(e,h)) * ( neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c)), vec4(0.0, 0.0, 0.0, 0.0), vec4(1.0, 1.0, 1.0, 1.0));
vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g));
vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c));
-
+
vec4 edr = vec4(lessThan(weighted_distance(e, c, g, i, h5, f4, h, f), weighted_distance(h, d, i5, f, i4, b, e, i))) * interp_restriction_lv1;
vec4 edr_left = vec4(lessThanEqual(coef * df(f,g), df(h,c))) * interp_restriction_lv2_left * edr;
vec4 edr_up = vec4(greaterThanEqual(df(f,g), coef * df(h,c))) * interp_restriction_lv2_up * edr;
-
+
vec3 info;
info.x = dot(edr, vec4(8.0, 4.0, 2.0, 1.0));
info.y = dot(edr_left, vec4(8.0, 4.0, 2.0, 1.0));
info.z = dot(edr_up, vec4(8.0, 4.0, 2.0, 1.0));
gl_FragColor = vec4(remapTo01(info, vec3(0.0, 0.0, 0.0), vec3(255.0, 255.0, 255.0)), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.sc
index c168b2622a7..e19f6be1eca 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR LV2 D (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -149,7 +149,7 @@ void main()
vec4 interp_restriction_lv2_up = (ne(e,c) * ne(b,c));
interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0);
-
+
vec4 edr = lt(weighted_distance(e, c, g, i, h5, f4, h, f), weighted_distance(h, d, i5, f, i4, b, e, i)) * interp_restriction_lv1;
vec4 edr_left = le(coef * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr;
vec4 edr_up = ge(df(f,g), coef * df(h,c)) * interp_restriction_lv2_up * edr;
@@ -160,4 +160,4 @@ void main()
info.z = dot(vec4(edr_up ), vec4(8.0, 4.0, 2.0, 1.0));
gl_FragColor = vec4(remapTo01(info, vec3(0.0, 0.0, 0.0), vec3(255.0, 255.0, 255.0)), 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.sc
index c46dd90ba0a..4d15482b4c6 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 - noblend - pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -94,7 +94,7 @@ vec4 unpack_info(float i)
float frac_val = fract(i / 2.0f);
info.w = round(frac_val);
i = i / 2.0f - frac_val;
-
+
frac_val = fract(i / 2.0f);
info.z = round(frac_val);
i = i / 2.0f - frac_val;
@@ -159,4 +159,4 @@ void main()
vec3 res = mix(res1, res2, step(df12.x, df12.y));
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.sc
index 6316e485725..b5de4e02fbf 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 - pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -57,7 +57,7 @@ vec4 unpack_info(float i)
float frac_val = fract(i / 2.0f);
info.w = round(frac_val);
i = i / 2.0f - frac_val;
-
+
frac_val = fract(i / 2.0f);
info.z = round(frac_val);
i = i / 2.0f - frac_val;
@@ -100,7 +100,7 @@ void main()
vec4 Cy = vec4(2.0, 0.0, -1.0, 0.5);
// These inequations define the line below which interpolation occurs.
- vec4 fx = (Ao*fp.y+Bo*fp.x);
+ vec4 fx = (Ao*fp.y+Bo*fp.x);
vec4 fx_left = (Ax*fp.y+Bx*fp.x);
vec4 fx_up = (Ay*fp.y+By*fp.x);
@@ -128,7 +128,7 @@ void main()
mat4 pix = mat4(mix(E, mix(H, F, px.x), maximo.x), mix(E, mix(F, B, px.y), maximo.y), mix(E, mix(B, D, px.z), maximo.z), mix(E, mix(D, H, px.w), maximo.w));
vec4 pixel = instMul(yuv_weighted, pix);
-
+
vec4 diff = df(pixel,e);
vec3 res = pix[0].xyz;
@@ -150,4 +150,4 @@ void main()
}
gl_FragColor = vec4(res, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc
index 3a80bf6f7bb..15490257390 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR LV2 A (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc
index 4cd8b064523..f63eb7b2391 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR LV2 Accuracy - pass0 Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc
index c20050aa1f4..db8c513319b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 Accuracy - pass1 Shader
-
+
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
#include "common.sh"
uniform vec4 u_tex_size1;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc
index 5515f4f4904..0c317f16cc7 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR LV2 B (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc
index 9d0b7161844..fbcf72fd706 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR LV2 C (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc
index 8f9b4f316d9..e75cc78ac8c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR LV2 D (squared) - pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc
index 86df31a48e4..56cebbd6540 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 - noblend - pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
#include "common.sh"
uniform vec4 u_tex_size1;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc
index d678e8b0541..c35e62e81ac 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR LV2 - pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
#include "common.sh"
uniform vec4 u_tex_size1;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.sc
index e9328bb4015..229f2f93936 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR level 3 pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -120,7 +120,7 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v
LEFT = UP = LEFT3 = UP3 = 0.0; \
PX0 = vec2(0.0, PX); \
LIN0 = vec4(0.0, 0.0, 0.0, 0.0); \
- } \
+ }
@@ -213,4 +213,4 @@ void main()
lin0.w, lin1.w, lin2.w, lin3.w));
gl_FragColor = vec4(remapTo01(info, vec4(255.0, 255.0, 255.0, 255.0)));
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.sc
index df6d0a72265..407aaf2aaf6 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.sc
@@ -5,7 +5,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR level 3 pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -70,7 +70,7 @@ vec4 unpack_info(float i)
float frac_val = fract(i / 2.0f);
info.w = round(frac_val);
i = i / 2.0f - frac_val;
-
+
frac_val = fract(i / 2.0f);
info.z = round(frac_val);
i = i / 2.0f - frac_val;
@@ -124,7 +124,7 @@ void main()
info_nr = info_nr / 2.0 - frac_val;
info_nr = info_nr / 2.0 - fract(info_nr / 2.0);
info_nr = info_nr / 2.0 - fract(info_nr / 2.0);
-
+
frac_val = fract(info_nr / 2.0);
float pxr = round(frac_val);
info_nr = info_nr / 2.0 - frac_val;
@@ -177,4 +177,4 @@ void main()
}
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc
index d4420512bd4..8ae8f8df41c 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR level 3 pass0 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc
index edfd9fa3dd9..439005d2941 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc
@@ -6,7 +6,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
/*
Hyllian's xBR level 3 pass1 Shader
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0
uniform vec4 u_tex_size1;
uniform vec4 u_target_dims;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A3 B3 C3
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.sc
index fe2e3188052..1fe133cebfc 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.sc
@@ -6,7 +6,7 @@ $input v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass1
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -43,7 +43,7 @@ const vec4 eq_thresholdold = vec4(15.0, 15.0, 15.0, 15.0);
const vec4 eq_threshold = vec4( 2.0, 2.0, 2.0, 2.0);
const vec4 eq_threshold3 = vec4(25.0, 25.0, 25.0, 25.0);
const vec4 yuv_weight = vec4( 4.0, 1.0, 2.0, 0.0);
-const mat4 yuvT = mat4(0.299, -0.169, 0.499, 0.0, 0.587, -0.331, -0.418, 0.0, 0.114, 0.499, -0.0813, 0.0, 0.0, 0.0, 0.0, 0.0);
+const mat4 yuvT = mat4(0.299, -0.169, 0.499, 0.0, 0.587, -0.331, -0.418, 0.0, 0.114, 0.499, -0.0813, 0.0, 0.0, 0.0, 0.0, 0.0);
const mat4 yuv = mat4(0.299, 0.587, 0.114, 0.0, -0.169, -0.331, 0.499, 0.0, 0.499, -0.418, -0.0813, 0.0, 0.0, 0.0, 0.0, 0.0);
const mat4 yuv_weighted = mat4(4.0 * vec4(0.299, 0.587, 0.114, 0.0), 2.0 * vec4(-0.169, -0.331, 0.499, 0.0), vec4(0.499, -0.418, -0.0813, 0.0), vec4(0.0, 0.0, 0.0, 0.0));
const vec4 maximo = vec4(255.0, 255.0, 255.0, 255.0);
@@ -111,7 +111,7 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v
void main()
{
- vec4 A3 = TEX(-1,-3); vec4 B3 = TEX( 0,-3); vec4 C3 = TEX( 1,-3);
+ vec4 A3 = TEX(-1,-3); vec4 B3 = TEX( 0,-3); vec4 C3 = TEX( 1,-3);
vec4 A1 = TEX(-1,-2); vec4 B1 = TEX( 0,-2); vec4 C1 = TEX( 1,-2);
vec4 A2 = TEX(-3,-1); vec4 A0 = TEX(-2,-1); vec4 A = TEX(-1,-1);
vec4 B = TEX( 0,-1); vec4 C = TEX( 1,-1); vec4 C4 = TEX( 2,-1); vec4 C6 = TEX( 3,-1);
@@ -205,4 +205,4 @@ void main()
info.w = (edr4_left.w > 0.0 && edr4_up.w == 0.0) ? 8.0 : ((edr4_up.w > 0.0 && edr4_left.w == 0.0) ? 7.0 : ((edr3_left.w > 0.0 && edr3_up.w == 0.0) ? 6.0 : ((edr3_up.w > 0.0 && edr3_left.w == 0.0) ? 5.0 : ((edr_left.w > 0.0 && edr_up.w == 0.0) ? 4.0 : ((edr_up.w > 0.0 && edr_left.w == 0.0) ? 3.0 : (edr.w > 0.0 ? 2.0 : (edr0.w > 0.0 ? 1.0 : 0.0)))))));
gl_FragColor = vec4(remapTo01(info, maximo));
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.sc
index b0e0edf7778..7c2906246e6 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.sc
@@ -6,7 +6,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoo
/*
Hyllian's xBR MultiLevel4 Shader - Pass2
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -225,11 +225,11 @@ void main()
vec4 jag9 = clamp(jag91 * jag93 + jag92 * jag94 , 0.0, 1.0);
vec4 pe_select = eq(pe, zero) + ((one - nbrs) + jag1) * jag9;
-
+
pe.x = pe_select.x > 0.0 ? pe.x : 1.0;
pe.y = pe_select.y > 0.0 ? pe.y : 1.0;
pe.z = pe_select.z > 0.0 ? pe.z : 1.0;
pe.w = pe_select.w > 0.0 ? pe.w : 1.0;
gl_FragColor = vec4(remapTo01(pe, maximo));
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.sc
index 00391c77120..07490274d70 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.sc
@@ -6,7 +6,7 @@ $input v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass3
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -169,4 +169,4 @@ void main()
lparam.w = addr.x * 8.0 + addr.y;
gl_FragColor = vec4(remapTo01(lparam, low, high));
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.sc
index 535f70a5a7d..bdd9f5b31db 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.sc
@@ -6,7 +6,7 @@ $input v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass3
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -62,7 +62,7 @@ vec4 unpack_info(float i)
float frac_val = fract(i / 2.0f);
info.w = round(frac_val);
i = i / 2.0f - frac_val;
-
+
frac_val = fract(i / 2.0f);
info.z = round(frac_val);
i = i / 2.0f - frac_val;
@@ -110,13 +110,13 @@ vec3 color_mix(vec3 c, vec3 color, vec3 E)
ax.x = round(info); \
iq.x = dot(ax, bin) - 2.0; \
iq.y = dot(ay, bin) - 2.0; \
- PIXEL = texture2D(ORIG_texture, v_texcoord0 + iq.x * v_texcoord1.xy + iq.y * v_texcoord1.zw).xyz; \
+ PIXEL = texture2D(ORIG_texture, v_texcoord0 + iq.x * v_texcoord1.xy + iq.y * v_texcoord1.zw).xyz;
void main()
{
float scale_factor = u_target_size.x / u_tex_size1.x;
-
+
vec2 fp = fract(v_texcoord0 * u_tex_size1.xy) - vec2(0.5, 0.5); // pos = pixel position
vec4 UL = texture2D(decal, v_texcoord0 + 0.25 * v_texcoord1.xy + 0.25 * v_texcoord1.zw);
@@ -161,4 +161,4 @@ void main()
color = color_mix(c4, color, E.xyz);
gl_FragColor = vec4(color, 1.0);
-} \ No newline at end of file
+}
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc
index bab183ddd30..24f3b396cc2 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc
@@ -7,7 +7,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass1
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A3 B3 C3
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc
index 71ebf7d574a..1d67bb87ebe 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc
@@ -7,7 +7,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
/*
Hyllian's xBR MultiLevel4 Shader - Pass2
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco
#include "common.sh"
uniform vec4 u_tex_size0;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A1 B1 C1
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc
index 19195ba5b27..2c85859340b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc
@@ -7,7 +7,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass3
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size1;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A3 B3 C3
diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc
index bf9f297ec9d..5e62a75a12e 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc
@@ -7,7 +7,7 @@ $output v_texcoord0, v_texcoord1, v_color0
/*
Hyllian's xBR MultiLevel4 Shader - Pass4
-
+
Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0
#include "common.sh"
uniform vec4 u_tex_size1;
+uniform vec4 u_inv_view_dims;
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
// A3 B3 C3
diff --git a/src/osd/modules/render/bgfx/shaders/fs_screen.sc b/src/osd/modules/render/bgfx/shaders/fs_screen.sc
index 52dac92785c..ab1bff59dee 100644
--- a/src/osd/modules/render/bgfx/shaders/fs_screen.sc
+++ b/src/osd/modules/render/bgfx/shaders/fs_screen.sc
@@ -6,7 +6,7 @@ $input v_color0, v_texcoord0
#include "common.sh"
// Samplers
-SAMPLER2D(s_tex, 0);
+SAMPLER2D(s_tex, 0);
void main()
{
diff --git a/src/osd/modules/render/bgfx/shaders/makefile b/src/osd/modules/render/bgfx/shaders/makefile
index 1ca45471b9b..c998f2564d9 100644
--- a/src/osd/modules/render/bgfx/shaders/makefile
+++ b/src/osd/modules/render/bgfx/shaders/makefile
@@ -12,25 +12,28 @@ SUBDIRS := $(patsubst .,,$(patsubst ./,,$(shell find . -type d)))
rebuild: main $(SUBDIRS)
endif
+.NOTPARALLEL:
$(SUBDIRS):
@echo $@
ifeq ($(OS),windows)
- @make -s --no-print-directory TARGET=0 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=1 SHADERS_DIR=$@/ clean all
+ $(SILENT) $(MAKE) --no-print-directory TARGET=0 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=1 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
endif
- @make -s --no-print-directory TARGET=2 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=3 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=4 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=5 SHADERS_DIR=$@/ clean all
+ $(SILENT) $(MAKE) --no-print-directory TARGET=2 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=3 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=4 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=5 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=7 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
main:
ifeq ($(OS),windows)
- @make -s --no-print-directory TARGET=0 clean all
- @make -s --no-print-directory TARGET=1 clean all
+ $(SILENT) $(MAKE) --no-print-directory TARGET=0 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=1 clean all SILENT="$(SILENT)"
endif
- @make -s --no-print-directory TARGET=2 clean all
- @make -s --no-print-directory TARGET=3 clean all
- @make -s --no-print-directory TARGET=4 clean all
- @make -s --no-print-directory TARGET=5 clean all
+ $(SILENT) $(MAKE) --no-print-directory TARGET=2 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=3 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=4 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=5 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) --no-print-directory TARGET=7 clean all SILENT="$(SILENT)"
.PHONY: main rebuild $(SUBDIRS)
diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk
index e7db3cdc242..cc656d5e828 100644
--- a/src/osd/modules/render/bgfx/shaders/shader.mk
+++ b/src/osd/modules/render/bgfx/shaders/shader.mk
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2019 Branimir Karadzic. All rights reserved.
-# License: http://www.opensource.org/licenses/BSD-2-Clause
+# Copyright 2011-2021 Branimir Karadzic.
+# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
#
THISDIR:=../../../../../../3rdparty/bgfx/scripts
@@ -19,25 +19,51 @@ ifndef TARGET
.PHONY: all
all:
@echo Usage: make TARGET=# [clean, all, rebuild]
- @echo " TARGET=0 (hlsl - d3d9)"
- @echo " TARGET=1 (hlsl - d3d11)"
- @echo " TARGET=2 (essl - nacl)"
+ @echo " TARGET=0 (hlsl - d3d9 / Windows only!)"
+ @echo " TARGET=1 (hlsl - d3d11 / Windows only!)"
@echo " TARGET=3 (essl - android)"
@echo " TARGET=4 (glsl)"
@echo " TARGET=5 (metal)"
@echo " TARGET=6 (pssl)"
- @echo " TARGET=7 (spriv)"
- @echo " VERBOSE=1 show build commands."
+ @echo " TARGET=7 (spirv)"
+
+.PHONY: build
+build:
+ifeq ($(OS), windows)
+ @make -s --no-print-directory TARGET=0 all
+ @make -s --no-print-directory TARGET=1 all
+endif
+ @make -s --no-print-directory TARGET=3 all
+ @make -s --no-print-directory TARGET=4 all
+ @make -s --no-print-directory TARGET=5 all
+ @make -s --no-print-directory TARGET=7 all
+
+.PHONY: clean
+clean:
+ifeq ($(OS), windows)
+ @make -s --no-print-directory TARGET=0 clean
+ @make -s --no-print-directory TARGET=1 clean
+endif
+ @make -s --no-print-directory TARGET=3 clean
+ @make -s --no-print-directory TARGET=4 clean
+ @make -s --no-print-directory TARGET=5 clean
+ @make -s --no-print-directory TARGET=7 clean
+
+.PHONY: rebuild
+rebuild: clean build
+
else
+ADDITIONAL_INCLUDES?=
+
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/$(SHADERS_DIR)
else
ifeq ($(TARGET), 1)
-VS_FLAGS=--platform windows -p vs_4_0 -O 3
-FS_FLAGS=--platform windows -p ps_4_0 -O 3
+VS_FLAGS=--platform windows -p vs_5_0 -O 3
+FS_FLAGS=--platform windows -p ps_5_0 -O 3
CS_FLAGS=--platform windows -p cs_5_0 -O 1
SHADER_PATH=shaders/dx11/$(SHADERS_DIR)
else
@@ -108,44 +134,38 @@ CS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(
BIN = $(VS_BIN) $(FS_BIN)
ASM = $(VS_ASM) $(FS_ASM)
-ifeq ($(TARGET), 1)
+ifeq ($(TARGET), $(filter $(TARGET),1 3 4 5 6 7))
BIN += $(CS_BIN)
ASM += $(CS_ASM)
-else
-ifeq ($(TARGET), 3)
-BIN += $(CS_BIN)
-ASM += $(CS_ASM)
-else
-ifeq ($(TARGET), 4)
-BIN += $(CS_BIN)
-ASM += $(CS_ASM)
-endif
-endif
endif
-$(BUILD_INTERMEDIATE_DIR)/vs_%.bin : $(SHADERS_DIR)vs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/vs_%.bin: $(SHADERS_DIR)vs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(VS_FLAGS) --type vertex --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
-$(BUILD_INTERMEDIATE_DIR)/fs_%.bin : $(SHADERS_DIR)fs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/fs_%.bin: $(SHADERS_DIR)fs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(FS_FLAGS) --type fragment --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
-$(BUILD_INTERMEDIATE_DIR)/cs_%.bin : $(SHADERS_DIR)cs_%.sc
+$(BUILD_INTERMEDIATE_DIR)/cs_%.bin: $(SHADERS_DIR)cs_%.sc
@echo [$(<)]
$(SILENT) $(SHADERC) $(CS_FLAGS) --type compute --depends -o $(@) -f $(<) --disasm
$(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
.PHONY: all
all: dirs $(BIN)
- @echo Target $(SHADER_PATH)
+ @echo Target $(notdir $(CURDIR)) / $(SHADER_PATH)
.PHONY: clean
clean:
@echo Cleaning...
@-rm -vf $(BIN)
+
+.PHONY: cleanall
+cleanall:
+ @echo Cleaning...
@-$(call CMD_RMDIR,$(BUILD_INTERMEDIATE_DIR))
.PHONY: dirs
diff --git a/src/osd/modules/render/bgfx/shaders/vs_gui.sc b/src/osd/modules/render/bgfx/shaders/vs_gui.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/vs_gui.sc
+++ b/src/osd/modules/render/bgfx/shaders/vs_gui.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/shaders/vs_screen.sc b/src/osd/modules/render/bgfx/shaders/vs_screen.sc
index 405ef8feb3b..df2b37f203c 100644
--- a/src/osd/modules/render/bgfx/shaders/vs_screen.sc
+++ b/src/osd/modules/render/bgfx/shaders/vs_screen.sc
@@ -6,9 +6,14 @@ $output v_texcoord0, v_color0
#include "common.sh"
+uniform vec4 u_inv_view_dims;
+
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300
+ gl_Position.xy += u_inv_view_dims.xy * gl_Position.w;
+#endif
v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}