Warheck wrote
I replaced with a hard-coded colour value, sort of a dark grey. Identical RGB values give colours that appear along the grayscale, the darker end of which I would like to exploit to turn the pixels to a charcoal colour. It is just a bit of mathematics to finish the last step, and there are a multitude of ways of doing it, so I'm just letting my subconscious think of a way for me. Basically it is the problem where I have a material which has a particular colour, and I need to change a random colour to dark grey. There is a variable, Index, in the relevant part of the function which represents the intensity (so whether it is a light shade or a dark shade). I think I will normalise the colour to a known shade of gray and use the intensity to scale the brightness within a small range of values. I think this is your suggestion right?
Close.
I was thinking more like taking the random colour you find and "dulling" it down to equivalent, yet much lower RGB values so the pixel on the object does appear burnt yet retains a little of its original colour. This way the burns will look more dynamic than having the object turn into a mass of identically coloured dark pixels.
What you've mentioned with the Index variable seems like it'd do this by itself if you just set it really low, though I wouldn't know how it'd actually look in-game.
Or, is it not possible to retrieve the actual RGB values from a single pixel in the object's bitmap? (e.g. is the way IVAN "shades" its objects making this more complex?)