Screen Tone change without blending [+/-]

Started by Stray, November 17, 2012, 08:53:12 am

Previous topic - Next topic

Stray

November 17, 2012, 08:53:12 am Last Edit: November 17, 2012, 08:54:59 am by Stray
If the screen tone is changed ingame by the "Change Screen Tone"-Command, the screen has an 'add' or 'subtract' effect (I'm not sure). It's this blending effect which makes the contrast of the screen higher.
But I think it looks very odd in this way.
Example: ShowHide


Left: Normal pic without any changes.
Middle: RMXP - Making everything darker + keeping the colours.
Right: How I think it looks normal + everything gets darker. RPG Maker 2k(3) works this way.

I don't find good words for it. The rmxp-version looks so... 'rusty'.
I'm very grateful to you all for your great help.

Blizzard

November 17, 2012, 09:46:02 am #1 Last Edit: November 17, 2012, 09:48:02 am by Blizzard
The RMXP version decreases the intensity of the color channels, it does not reduce the saturation of the colors. If you want to reduce the saturation, you also have the "Tone" color component for that. Keep in mind that saturation/tone works on all 3 colors channels together, not just a single one. It's actually a somewhat weird cross-implementation for the HSL color model mixed with classic additive RGB. I'm too lazy to explain the details.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Stray

Spoiler: ShowHide


Isn't there a way to get rid of this effect?
The screen toning in RMXP darkens everything much earlier.
I know the trick with laying a black picture over the screen, but that isn't very helpful everytime.
Sometimes I need a tone with more different colours. Then it would be quite difficult to find the right picture tone.
I'm very grateful to you all for your great help.

Blizzard

November 17, 2012, 02:53:59 pm #3 Last Edit: November 17, 2012, 03:02:38 pm by Blizzard
Nope, it can't be done, it's how it's done internally. And frankly RMXP is actually the one that does it correctly. You can try experimenting with (-64, -64, -64, 128) or values like that. There should be a way to get a similar result. If you overlay a black picture, it uses simply alpha blending. But if you use the screen toning, it uses color multiplication which is done in a different way.

Quote from: multiplicationRGB = RGBd * RGBs

Quote from: screen toning (linear interpolation)RGB = RGBd * (1 - As) + RGBs * As


s = source
d = destination, the color of the underlying pixel
RGB = red, green, blue components of the color
A = alpha component of the color

As you can see, it's not really the same formula. Sure, you can get similar results, but overall it's not really possible the reproduce the same color.

EDIT: If you want, you can try to cross-reference both formulas to get the closest possible result. (I am substituting the 1 - As for RGBs here.)

QuoteRGB = RGBd * RGBs + RGBs * (1 - RGBs)

QuoteRGB = (RGBd - RGBs) * RGBs

Quote from: or this, whatever you feel more comfortable working withRGB = RGBd * RGBs - RGBs2

Quote from: this is actually also a possibility if I had used a different substitutionRGB = RGBd - RGBd * RGBs + RGBs2


So using a black overlay picture is what you should actually use.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Stray

So i'll still have to do my fades with a black picture.
For toning with various colours I'll try it with your recommendation.

Thanks for your advice.
I'm very grateful to you all for your great help.