VOGONS


First post, by xythen

User metadata
Rank Newbie
Rank
Newbie

Can anyone explain the exact steps taken by the rgbNx scaler? Looking at the Doom face it seems like it's trying to simulate a shadow mask CRT screen, but the image contains more than just red, green and blue dots (it seems to have yellow/orange ones as well, in a square pattern instead of a triangular one).

Are there any details about this algorithm elsewhere on the net, or was it made by the DOSBox team?

Thanks for the help!

Reply 3 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
#define SCALERNAME              RGB2x
#define SCALERWIDTH 2
#define SCALERHEIGHT 2
#define SCALERFUNC \
line0[0]=P & redMask; \
line0[1]=P & greenMask; \
line1[0]=P & blueMask; \
line1[1]=P;

So it is just like normal2x (e.g put the same value in 4 pixels), but here 3 of the pixels only show the component in a certain colour. A bit like how an old TV works.

So one pixels shows how much red there is, one how much green and one how much blue.
and one shows the original

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 10, by robertmo

User metadata
Rank l33t++
Rank
l33t++

I think RGB3x should be this way:
GWB
RBW
WRG
Cause right now green pixeles are next to each other actually making one 2x larger pixel.

Or even:
GRB
RBG
BRG
as in 3x all pixels can be used unlike in 2x where there is one pixel that cannot be neither R nor G nor B (unless you would like to reduce its intensity by half).

Reply 6 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

this the current

        line0[0]=P;                                                     \
line0[1]=P & greenMask; \
line0[2]=P & blueMask; \
line1[0]=P & blueMask; \
line1[1]=P; \
line1[2]=P & redMask; \
line2[0]=P & redMask; \
line2[1]=P & greenMask; \
line2[2]=P;

Water flows down the stream
How to ask questions the smart way!

Reply 9 of 10, by robertmo

User metadata
Rank l33t++
Rank
l33t++

Actually after rethinking my both suggestions were worse.

But this one is better:
WRG
RBW
WGB

with Harekiet's version if you make a green line like this / green pixels will have a gap of two subpixels width. While such a green line \ has no gap at all. You can also see it with letters for example: O, D U.

With my suggestion there will never be such a large gap with every colour and every direction.