Gradients with Multiple Points

Moderator: GZDoom Developers

Post Reply
User avatar
torridgristle
Posts: 684
Joined: Fri Aug 23, 2013 9:34 am

Gradients with Multiple Points

Post by torridgristle »

Unless I've managed to overlook some features in the wiki, gradients are only two points. This is very limiting for Powerup.Colormap and Translation, especially with the blue range.

Image

Currently if you want a screen or translation to be blue you set the gradient to be #000000 to #0000FF. Blue is a very dark colour so the palette has brighter shades that go from #0000FF to just shy from white, but you can't use those in a basic two-point gradient. If you try to make a gradient from #000000 to the brightest blue in the palette, you'll get pretty much grey. But, if you were to add a third point you could go from #000000 to #0000FF to #FFFFFF and get a much wider range of the palette and of luminosity. Ideally you would be able to set the position of each point with 0 to 100, like in Photoshop or GIMP's gradient editor.

This would also allow for some more exotic gradients.

Image

Orange doesn't go to black, but if you can have multiple points in a gradient then you can include black and brown in the dark range. You can also go nuts and go black to purple to yellow to white just for fun.

I propose that the 0 to 100 number used for each point's position be tacked onto the RGB triplets like so: Translation "original_start:original_end=[rs,gs,bs,0]:[re,ge,be,33:[re,ge,be,100]" and Powerup.Colormap 0.0, 0.0, 0.0, 0 0.0, 0.0, 1, 33 1.0, 1.0, 1.0, 100 Also perhaps an alpha value for each point so that gradients that only affect sections of ranges on the screen can be made, for example red tinted shadows with an unaffected midrange and yellow tinted highlights. The alpha value could also just be tacked onto the end.

I also propose that Powerup.Colormap should use integer values between 0 and 255 like Direct Color Translations for the sake of human comfort.
User avatar
Blox
Posts: 3728
Joined: Wed Sep 22, 2010 9:35 am
Location: Apathetic Limbo

Re: Gradients with Multiple Points

Post by Blox »

Mmh, yes. This would be much appreciated.
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Gradients with Multiple Points

Post by NeuralStunner »

This would be nice to tinker with, yes. A gradient of black to full-color to white is the only way to make bright colormaps.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Gradients with Multiple Points

Post by Graf Zahl »

For translations this should already be doable with proper values - for fullscreen colormaps it is simply not doable due to how they get used internally.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”