Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function autoshader()
- local height = tonumber(mp.get_property("height"))
- if height >= 720 then -- Anime4K mode A (HQ)
- print("Vertical resolution of", height, "(>= 720): Loading Anime4K mode A.")
- mp.commandv("set", "glsl-shaders", "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_VL.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl")
- elseif height >= 480 then --Anime4K mode B
- print("Vertical resolution of", height, "(>= 480): Loading Anime4K mode B.")
- mp.commandv("set", "glsl-shaders", "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl")
- else --Anime4K mode C
- print("Vertical resolution of", height, "(< 480): Loading Anime4K mode C.")
- mp.commandv("set", "glsl-shaders", "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl")
- end
- end
- mp.add_key_binding(nil, "autoshader", autoshader)
- mp.register_event("file-loaded", autoshader)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement