Any update on shaders?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Any update on shaders?

Post by almeath »

I have searched for an update on possible future inclusion of shader support in ScummVM. Most of the posts are 3 to 8 years old and not much seems to be on the horizon.

That being said, I tracked down a CRT emulation branch and tested it out in macOS. It is enabled with the command crt_shader=true. It works well, but there is only the one built-in shader and no ability to load others (such as glsl/p) without some programming knowledge.

Anyway, I am just interested in hearing if there is any intent (or not) to consider this functionality in future releases. DOSBox SVN finally supports glsl shaders and I have been enjoying the ability to mimic the CRT monitors of old. It would be great to have the same capability in ScummVM.

User avatar
criezy
ScummVM Developer
Posts: 739
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Any update on shaders?

Post by criezy »

There is no update I am afraid.
I would love to finally have shaders available in ScummVM but as always for this to happen we need a developer with the time, motivation and knowledge to work on it. And we are in short supplies of those.

Kasenshlogga
Posts: 23
Joined: Thu Jul 18, 2019 1:31 pm

Re: Any update on shaders?

Post by Kasenshlogga »

For now you can use Reshade if you set the graphics mode to OpenGL. I've already posted a config for CMI here: viewtopic.php?p=88204#p88204

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

Kasenshlogga wrote:
Thu Apr 16, 2020 7:04 pm
For now you can use Reshade if you set the graphics mode to OpenGL. I've already posted a config for CMI here: viewtopic.php?p=88204#p88204
Thank you, but can Reshade work on macOS? It appears to use .fx files which I thought are Direct 3D only.

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

almeath wrote:
Fri Apr 17, 2020 3:01 pm
Kasenshlogga wrote:
Thu Apr 16, 2020 7:04 pm
For now you can use Reshade if you set the graphics mode to OpenGL. I've already posted a config for CMI here: viewtopic.php?p=88204#p88204
Thank you, but can Reshade work on macOS? It appears to use .fx files which I thought are Direct 3D only.
I have tried applying your CMI preset but it definitely does nothing for me in macOS. Thanks anyway.

AgustinCordes
Posts: 32
Joined: Wed Nov 23, 2011 2:08 am
Location: Buenos Aires, Argentina
Contact:

Re: Any update on shaders?

Post by AgustinCordes »

almeath wrote:
Wed Apr 15, 2020 2:54 pm
Anyway, I am just interested in hearing if there is any intent (or not) to consider this functionality in future releases. DOSBox SVN finally supports glsl shaders and I have been enjoying the ability to mimic the CRT monitors of old. It would be great to have the same capability in ScummVM.
I can have a look at this. I've been interested in supporting a subtle CRT shader in ScummVM for a while, but don't have much time these days. That GitHub fork was a great find, but I can't seem to get it working. How are you exactly enabling it with the crt_emulation command? Is it a command line parameter? I'm also running macOS, so it should work all the same.

User avatar
criezy
ScummVM Developer
Posts: 739
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Any update on shaders?

Post by criezy »

There was a start at implementing support for libretto shaders by a former ScummVM developer. It can be found at https://github.com/lordhoto/scummvm/tre ... tro-shader
This was not finished and is probably outdated by now with all the changes we made in ScummVM, but this could maybe provide a starting point.

AgustinCordes
Posts: 32
Joined: Wed Nov 23, 2011 2:08 am
Location: Buenos Aires, Argentina
Contact:

Re: Any update on shaders?

Post by AgustinCordes »

OK, I got this working! Forgot that the rendering system should be OpenGL. I recently added a fairly minimal CRT shader to Boxer with decent results: Image

Most of these shaders are too aggressive for my taste. I'll look into improving support in ScummVM, the guy from that Github fork did an exceedingly good job in integrating this feature properly with the backend.

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

AgustinCordes wrote:
Tue Apr 21, 2020 7:22 pm
Most of these shaders are too aggressive for my taste. I'll look into improving support in ScummVM, the guy from that Github fork did an exceedingly good job in integrating this feature properly with the backend.
Thanks, it is great to know there is interest in pursuing this further. :)

This is the specific CRT branch I found: https://github.com/braindx/scummvm

If anyone wants a pre-compiled binary for macOS: https://www.dropbox.com/s/532n7rapxfjsi ... t.zip?dl=0

The setting to use is crt_emulation=true, which can be specified inside your config/preferences file. I presume it would also work via the command line.

Personally, I find the effect in the braindx build too strong for my tastes, specifically the curvature. I would not know where to begin in terms of modifying it directly.

I like the shader you are using from Boxer. Did you design it yourself or modify one from somewhere? It looks similar to my current favorite, "CRT-Lottes_tweaked" available here for DOSBOx SVN: https://github.com/tyrells/dosbox-svn-shaders

It has very subtle curvature and looks a whole lot like the shadow mask CRT monitors I used back in the day. The tyrell GLSL shaders are adjusted for DOSBox but if anyone could figure out a way to import these into a working fork of ScummVM I would be thrilled. :wink:

Here is the tweaked Lottes CRT shader in action in DOSBox SVN:

https://www.dropbox.com/s/mji4i2hfurp2q ... s.jpg?dl=0

https://www.dropbox.com/s/x917kq3946dl0 ... s.jpg?dl=0
Last edited by almeath on Tue Apr 21, 2020 8:59 pm, edited 1 time in total.

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

criezy wrote:
Tue Apr 21, 2020 7:15 pm
There was a start at implementing support for libretto shaders by a former ScummVM developer. It can be found at https://github.com/lordhoto/scummvm/tre ... tro-shader
This was not finished and is probably outdated by now with all the changes we made in ScummVM, but this could maybe provide a starting point.
Thanks for this too. I do not know enough about coding to do anything with it personally, but I will see if it builds and provides any basic functionality.

AgustinCordes
Posts: 32
Joined: Wed Nov 23, 2011 2:08 am
Location: Buenos Aires, Argentina
Contact:

Re: Any update on shaders?

Post by AgustinCordes »

almeath wrote:
Tue Apr 21, 2020 8:31 pm
Here is the tweaked Lottes CRT shader in action in DOSBox SVN:

https://www.dropbox.com/s/mji4i2hfurp2q ... s.jpg?dl=0

https://www.dropbox.com/s/x917kq3946dl0 ... s.jpg?dl=0
I like this, very similar to the one I tweaked which is based on Geom. I'd increase the brightness a bit more in your examples. Maybe I can try and migrate those tweaks to braindx's crt-emulation branch, since that's also based on Lottes.

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

AgustinCordes wrote:
Wed Apr 22, 2020 2:13 pm
I like this, very similar to the one I tweaked which is based on Geom. I'd increase the brightness a bit more in your examples. Maybe I can try and migrate those tweaks to braindx's crt-emulation branch, since that's also based on Lottes.
Actually, those screen caps do not do full justice to that shader because I crank my brightness up to maximum when I’m using it. On my 5k screen I can supposedly get up to 500 nits, which gives everything a nice CRT-style glow. I will try to update the screen caps with a more accurate brightness level.

That’s the other thing .. some of these shaders that emulate a shadow mask effect need 4k or higher to get the full benefit.

If you could get the Lottes shader into the braindx branch that would be amazing. I am not sure what tweaks were necessary for migrating them to DOSBox or if those same considerations apply to ScummVM. Good luck with it. :)

AgustinCordes
Posts: 32
Joined: Wed Nov 23, 2011 2:08 am
Location: Buenos Aires, Argentina
Contact:

Re: Any update on shaders?

Post by AgustinCordes »

I tweaked the Lottes shader from the crt-emulation branch with the following results:

I like it myself. It's a tad more aggressive than my Boxer shader but still looks authentic. It's quite easy to increase sharpening or decrease bloom if desired. In fact, I could produce three presets, from subtle to prominent.

Image
Image

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

AgustinCordes wrote:
Thu Apr 23, 2020 1:27 am
I tweaked the Lottes shader from the crt-emulation branch with the following results:
Wonderful! Presets would be great, but could you also provide a quick set of instructions to advise how to alter the key settings, particularly curvature - I’m not a huge fan of curvature, just my personal preference. Well done though! :D

User avatar
almeath
Posts: 136
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Re: Any update on shaders?

Post by almeath »

AgustinCordes wrote:
Thu Apr 23, 2020 1:27 am
I like it myself. It's a tad more aggressive than my Boxer shader but still looks authentic.
I would like to try your Boxer shader, and was wondering if it can be converted into a GLSL shader file for DOSBox and/or implemented in the ScummVM CRT branch?

Post Reply