Topic was automatically imported from the old Question2Answer platform.
Asked By
MDuck06
I am working on a game centered around color. The BBEG has stolen the color from the world, and you have to beat the different bosses to restore it all. My initial plan was to make a shader that starts out completely grayscale and adds more color to the world whenever you beat a boss, but I can’t get anything to happen other than total grayscale, no grayscale, and burning your retinas from accidentally multiplying all my rgb values.
Please define
cut off
as with rgba values you can use discard.
uniform float step = 0.2;
if color.r > step:
discard;
Wakatta | 2022-12-16 22:02
By cut out color I mean I want to desaturate (I think that’s the word) the game world by different degrees depending on how many bosses you’ve beaten, so one boss would be barely any color in the world, but still more than the start of the game, and each consecutive boss adds more and more color.
Does that help? Or did I type a paragraph for no reason?
An alternative to Wakatta’s excellent answer might be ColorN (documentation link below).
With this method you should be able to add colours according to your gameplay logic but you would have to work out which ones to use. It can take any of the colours on this doc page as an argument.