VOGONS


some more shaders for SVN r4319 and later

Topic actions

First post, by Delfino Furioso

User metadata
Rank Newbie
Rank
Newbie

+++UPDATE 2020-05-22 : all converted crt shaders are now hosted on @tyrells git repo+++

+++UPDATE 2020-03-27 : thread title renamed as these shaders are not new, we're just adding svn compatibilty+++

Hi everyone!

since the introduction of shaders support in r4319 I've wanted to switch back to dosbox builds (such as ECE) that do not deviate much from the SVN forumula
what kept me from doing it was the limited choice of shaders - since only some are builtin and they mainly reimplement the scalers we are already used to

My knowledge of shaders programming is limited, but I wanted to try to port some of my favourite shaders anyway.
Turns out that I just needed to study the default shader coded within sdlmain.cpp and understand the variable being used.

Credits for all shaders go to the programmers whom created them back in the day
The code I've based my work on is hosted here
https://github.com/libretro/glsl-shaders/tree … ter/crt/shaders

Thanks to Dugan for his work on shipping the previous shaders support code with his fork (now unmantained)
https://github.com/duganchen/dosbox_shaders

Also thanks to Marty for tweaking Dugan's work and shipping earlier revisions of some of these shaders, back when SVN still did not support glsl
https://github.com/MartyShepard/DOSBox-Optionals

Last edited by Delfino Furioso on 2020-05-11, 12:24. Edited 3 times in total.

Reply 2 of 67, by Delfino Furioso

User metadata
Rank Newbie
Rank
Newbie

Hi and thank you!

I don't know if I will be able to do it, since it has some variables and coding conventions which are specific to how the libretro engine will load the shader.
Porting the dugan shaders was easier because they were already coded against the patch that SVN has merged with r4319
That's my understanding, anyway.

I'll try anyway and keep you posted about the results!

in the meantime, some screenshots of the EasyMode and Lottes shaders in action
https://imgur.com/a/pyDEm0w
https://imgur.com/a/4FipjSj

Reply 3 of 67, by tyrells

User metadata
Rank Newbie
Rank
Newbie
KainXVIII wrote on 2020-03-22, 07:26:

Great thread!
Can you port pixellate.glslp shader from retroarch? Dunno which difference between this and sharp shader, but i want to compare them..

Hi KainXVIII,

I have attempted a port of the Pixellate shader. It can be found here: https://github.com/tyrells/dosbox-svn-shaders. Would you be able to test it for me and see if it is working? Unfortunately I don't have enough experience with this shader to tell.

Reply 4 of 67, by KainXVIII

User metadata
Rank Member
Rank
Member

Thanks! Here are zoomed examples for comparing (from Conquest of Camelot), they looks slightly different, i don't even even know which is better 🤣
Sharp

Filename
sharp.png
File size
4.04 KiB
Downloads
No downloads
File license
CC-BY-4.0

versus pixellate

Filename
pixellate.png
File size
4.21 KiB
Downloads
No downloads
File license
CC-BY-4.0

Reply 5 of 67, by Delfino Furioso

User metadata
Rank Newbie
Rank
Newbie

it seems to me that the pixellate example shows less color-bleeding

@tyrells - feel free to add my shader ports to your repo I've just forked your repo and created a pull request for including my ports

Reply 6 of 67, by KainXVIII

User metadata
Rank Member
Rank
Member

Uploading fullscreen shots where difference is less noticeable (maybe only in fonts), but yeah less color bleeding with pixellate!

sharp.png
Filename
sharp.png
File size
115.4 KiB
Views
9151 views
File comment
Sharp
File license
CC-BY-4.0
pixellate.png
Filename
pixellate.png
File size
127.51 KiB
Views
9151 views
File comment
Pixellate shader
File license
CC-BY-4.0

Reply 7 of 67, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'm really puzzled. none of those work in plain SVN for me.
First it complains about the version not being supported
Error compiling shader: ERROR: 0:2: '' : version '330' is not supported
ERROR: 0:2: '' : syntax error: #version

and if I delete that line it complains about other things (e.g. with CRT-Lottes):
Error compiling shader: ERROR: 0:38: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:39: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:44: Invalid storage qualifiers 'out' in global variable context
ERROR: 0:52: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:61: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:72: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:81: Use of undeclared identifier 'scal

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 8 of 67, by tyrells

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote on 2020-04-10, 08:21:
I'm really puzzled. none of those work in plain SVN for me. First it complains about the version not being supported Error comp […]
Show full quote

I'm really puzzled. none of those work in plain SVN for me.
First it complains about the version not being supported
Error compiling shader: ERROR: 0:2: '' : version '330' is not supported
ERROR: 0:2: '' : syntax error: #version

and if I delete that line it complains about other things (e.g. with CRT-Lottes):
Error compiling shader: ERROR: 0:38: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:39: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:44: Invalid storage qualifiers 'out' in global variable context
ERROR: 0:52: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:61: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:72: Use of undeclared identifier 'scaleInLinearGamma'
ERROR: 0:81: Use of undeclared identifier 'scal

Hi @Dominus.

That's strange. What version of SVN are you using? I've only tested these in r4334, using the vanilla SVN build from Yesterplay80.

Reply 9 of 67, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Jmarsh informed me on irc that the shaders are "compiled" in by the video driver of the system and apparently mine is missing support for these functions. This is on macOS 10.15, the latest and greatest (?), so definitely an issue with getting shaders to run on macOS.
SVN revision 4335, but it is not related to that 🙁

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 67, by tyrells

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote on 2020-04-10, 16:27:

Jmarsh informed me on irc that the shaders are "compiled" in by the video driver of the system and apparently mine is missing support for these functions. This is on macOS 10.15, the latest and greatest (?), so definitely an issue with getting shaders to run on macOS.
SVN revision 4335, but it is not related to that 🙁

Thanks for the feedback. Some other systems (e.g. libretro) include specific #defines in the shaders to correctly handle multiple versions. I will look at refining these shaders to include this.

Reply 11 of 67, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Thanks, that will help, especially when others do more work on shaders...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 12 of 67, by tyrells

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote on 2020-04-10, 17:14:

Thanks, that will help, especially when others do more work on shaders...

@Dominus, I've updated the shaders in the repository. Would you be able to test these new versions please?

Reply 13 of 67, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

All work now. The pp shader has a black border but I guess that is there to maintain aspect correction?
Thanks, that was fast!

now I want the xBR scalers etc 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 14 of 67, by tyrells

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote on 2020-04-10, 19:19:

All work now. The pp shader has a black border but I guess that is there to maintain aspect correction?
Thanks, that was fast!

now I want the xBR scalers etc 😀

Had some time, so added the 4 xBR shaders that don't require multiple shader passes. The others require multiple passes, and I'm not sure if that is currently supported by DOSBox SVN...

The shaders can be found in the 'xbr' sub-directory.

Reply 15 of 67, by almeath

User metadata
Rank Member
Rank
Member

All the xBR shaders are giving me this error, in macOS Mojave:

Error compiling shader: ERROR: 0:1: '' : version '130' is not supported

SDL:OPENGL:Failed to compile shader, falling back to default
Error compiling shader: ERROR: 0:1: '' : version '130' is not supported

SDL:OPENGL:Failed to compile shader, falling back to default

DOSBox SVN for macOS (x86-64) - customized with Munt MT-32, Nuked OPL3, 3dfx Voodoo, Extra RAM, Large HD, and more.
https://github.com/almeath/DOSBox-SVN-64-bit-for-macOS

Reply 16 of 67, by almeath

User metadata
Rank Member
Rank
Member

And if I take out the version line:

Error compiling shader: ERROR: 0:211: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:212: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:213: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:214: Use of undeclared identifier 'b'
ERROR: 0:215: Use of undeclared identifier 'b'
ERROR: 0:216: Use of undeclared identifier 'c'
ERROR: 0:217: Use of undeclared identifier 'b'
ERROR: 0:218: Use of undeclared identifier 'c'
ERROR: 0:220: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0
SDL:OPENGL:Failed to compile shader, falling back to default
Error compiling shader: ERROR: 0:211: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:212: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:213: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0:214: Use of undeclared identifier 'b'
ERROR: 0:215: Use of undeclared identifier 'b'
ERROR: 0:216: Use of undeclared identifier 'c'
ERROR: 0:217: Use of undeclared identifier 'b'
ERROR: 0:218: Use of undeclared identifier 'c'
ERROR: 0:220: Invalid call of undeclared identifier 'mat4x3'
ERROR: 0
SDL:OPENGL:Failed to compile shader, falling back to default

DOSBox SVN for macOS (x86-64) - customized with Munt MT-32, Nuked OPL3, 3dfx Voodoo, Extra RAM, Large HD, and more.
https://github.com/almeath/DOSBox-SVN-64-bit-for-macOS

Reply 17 of 67, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

replace the version with 120 then they work. I don't notice an effect with the noblend or 3d one, though.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 18 of 67, by almeath

User metadata
Rank Member
Rank
Member
Dominus wrote on 2020-04-12, 21:30:

replace the version with 120 then they work. I don't notice an effect with the noblend or 3d one, though.

Thanks, I am noticing the same thing. However, I am quite happy with CRT-Lottes for now. My wishlist includes CRT-Royale but there is no indication if SVN supports multi-pass filters?

DOSBox SVN for macOS (x86-64) - customized with Munt MT-32, Nuked OPL3, 3dfx Voodoo, Extra RAM, Large HD, and more.
https://github.com/almeath/DOSBox-SVN-64-bit-for-macOS

Reply 19 of 67, by Diduz

User metadata
Rank Newbie
Rank
Newbie
tyrells wrote on 2020-04-10, 21:31:

The others require multiple passes, and I'm not sure if that is currently supported by DOSBox SVN...

Thanks for your work Tyrells, lottes and pp are much appreciated. 😀
As far as single pass shaders go, I'd suggest CRT-Geom: I've always liked that, because it's not particularly eye-straining and you can easily decrease the size of its output with the "overscan" parameter. One of the issues with other CRT shaders for me is getting gigantic 20+ inches "old monitors", when I remember my real old monitors around the 14-17 inches diagonal size. Of course Retroarch allows fiddling with overscan parameters, but getting that option in standalone Dosbox would be great.