Re:Graveyard Keeper: How the graphics effects are made
by gavanwoolery on Thursday November 01, 2018 @04:43PM
(#18358234)
Note on the usage of lookup tables:
Color transitions are hard - their example here looks pretty good but in general tweening between two color spaces in a linear manner can produce unwanted "washing out" or dull in-between states. The problem is not just within the transition of individual colors, but how the relative values of nearby color affect our perception. For example, see this illusion in action:
https://twitter.com/AkiyoshiKitaoka/status/10284735661933158...
[ Parent
| on HN ]
Re:Graveyard Keeper: How the graphics effects are made
by pistachiopro on Thursday November 01, 2018 @06:59PM
(#18359243)
Color transitions are hard, and that illusion is pretty trippy. Beyond that, my sense is another big problem most people run into when they try to light pixel art (or any hand-painted asset) is that the asset is almost always "pre-tonemapped" by the artist. By first inverse-tonemapping the asset before applying any lighting, and then re-tonemapping afterwards, you can get pretty good results (assuming you can work out your artist's intuitive tonemapping function). Here's a fun article which explores the idea a bit more: http://www.codersnotes.com/notes/untonemapping/
Re:Graveyard Keeper: How the graphics effects are made
by garaetjjte on Friday November 02, 2018 @06:12AM
(#18361855)
I think cause of this article problem is not that textures require some "untonemapping", but that they are typically stored with sRGB gamma, and thus should be converted to linear for lighting, and converted back to sRGB gamma in final pass. (either by explicitly using 2.2 gamma in shaders, or graphics API conversion, eg. in GL using GL_SRGB8_ALPHA8 format and sRGB framebuffer with enabled GL_FRAMEBUFFER_SRGB)
Re:Graveyard Keeper: How the graphics effects are made
by Ezku on Friday November 02, 2018 @02:18AM
(#18361032)
That’s a really cool idea. Thanks for the article too, it provided for some excellent illumination. (Badum-tish. Sorry.)
Re:Graveyard Keeper: How the graphics effects are made
by gavanwoolery on Thursday November 01, 2018 @09:52PM
(#18360096)
Thanks, I will take a look :)
Re:Graveyard Keeper: How the graphics effects are made
by tvanantwerp on Thursday November 01, 2018 @09:43PM
(#18360066)
I find that RGB color space has lots of washed-out colors with linear interpolation, but other color spaces like HSV or HCL don't have the same issue. I tend to use those color spaces for creating gradients for charts with D3. I don't know if any games make use of them.
Re:Graveyard Keeper: How the graphics effects are made
by gavanwoolery on Thursday November 01, 2018 @09:52PM
(#18360093)
Agreed, here is one good comparison of color spaces:
http://davidjohnstone.net/pages/lch-lab-colour-gradient-pick...
Things like CIELAB are also interesting in that they provide more perceptually uniform color spaces, but at a greater computational cost.
Re:Graveyard Keeper: How the graphics effects are made
by slavik81 on Friday November 02, 2018 @12:16AM
(#18360662)
There's also a good discussion of colorspaces and perceptual linearity in "A Better Default Colormap for Matplotlib":
https://bids.github.io/colormap/
Re:Graveyard Keeper: How the graphics effects are made
by viggity on Friday November 02, 2018 @09:54AM
(#18363007)
Agreed. I found the YIQ color space for perceived luminance to be extremely useful for foreground/background color readability. http://blog.nitriq.com/BlackvsWhiteText.aspx
There are other tricks you can use like stroking/bordering the text with the opposite color as it provides contrast when white is on a light background or black is on a dark background. You can also have the text "glow" or some use a drop shadow. But these don't work that great when your text is small. However you have to use these tricks when you are putting text on top of a gradient.
Re:Graveyard Keeper: How the graphics effects are made
by MrLeap on Friday November 02, 2018 @08:57PM
(#18368000)
HSV has been my color space of choice when I made simulators for government and industry. That's been my technique since 2007. Lerping through colors that way always looks atleast fine.
Re:Graveyard Keeper: How the graphics effects are made
by on_and_off on Friday November 02, 2018 @01:16AM
(#18360858)
I faced what I think is a similar issue on Android : colors in RGB are gamma encoded; which make linear animations between 2 RGB values not linear at all.
There I solved it once I realized what was going on by converting the start and end colors to linear sRGB values and then interpolate between these two.
Would this work here too ?