Open eugene-s-nesdev opened 3 years ago
I just tried this and it works well enough but has a very significant impact on performance, it seems. My framerate dropped by almost 50%. Is that worth the performance hit, you think? Here's a copy of the modified shader if you'd like to try it: https://pastebin.com/eJ4kCnQ9
Thank you. Is this CG or GLSL code? Tried on puNES but it can't load it. Can you attach it?
Is that worth the performance hit, you think?
Yep, it worth. r57shell is once shader at this moment which can generate PAL NES palette very close to hardware. Maybe default values isn't very accurate yet, but user can adjust it. I will try to find more accurate values in the future. There are some hardware capturing screenshots: avermedia305.zip USE RAW (enabled) + //USE LUT (disabled) options works fullspeed at 1050ti. This is slowest mode.
Ah, the pastebin is for slang, sorry. I'll try to get the other formats updated, as well, ASAP.
Mistake about use USE LUT, it reduce quality but increase performance. Topic post fixed. Also USE LUT works only when USE RAW enabled, otherwise it does nothing (Look at comments in the shader's source code)
Ok, here's a GLSL version to test: https://pastebin.com/LXaFngiS
Let me know how it treats you.
Saved code to pal-r57shell.glsl and puNES crashes every time at startup. test.zip
does it give you any kind of error? It seems to be working fine here in RetroArch.
No. But it happens only on windows-glsl build. Emulator crashes with no-warnings. I've just compiled punes from scratch on mint 19.3 and both (old and new) shaders works perfectly. Strange thing.
Source and autobuilds are here: https://github.com/punesemu/puNES
Fresh commit https://github.com/punesemu/puNES/commit/31a7bd2c101db15313806a075d17a1d4f6fcf437 fixes crash. For now it works.
Ok, great to hear! I guess I'll get those changes pushed up to the repo, then :)
EDIT: alright, done, for glsl and slang, at least. I'll try to find time to handle the Cg version soon.
https://github.com/libretro/common-shaders/blob/master/pal/shaders/pal-r57shell.cg
Most of retroarch NES cores (and puNES standalone emulator with shaders support) have RAW-palette option. If you're set emulator palette to RAW, and uncomment line 70 same time (#define USE_RAW) shader will generate true-palnes palette
If you're uncomment line 74 (#define USE_LUT) shader will generate less accurate colors, but performance will increase. NOTE: USE LUT works only when USE RAW enabled, otherwise it does nothing
This is very uncomfortable to comment/uncomment these parameters in shader source every time. Users use this shader not only with NES but with another systems too, like snes, genesis etc, which requires keep use_raw disabled. So if you're can, please, make GUI setting for this.
Default values must be OFF (0) for compatibility reasons. Value ON (1) is preferred for NES systems, but it works correct only if you're set raw-palette in emulator core options.
This issue relates to all versions of r57shell PAL shader (glsl/gles, cg, etc)