3 ms·
I still use palette indexing! However, I use floating point indexing (which in essence is similar to the smooth cycling you see in these demos). It allows many
by gavanwoolery 10y ago
I still use palette indexing! However, I use floating point indexing (which in essence is similar to the smooth cycling you see in these demos). It allows many of the same tricks, such as cycling, blinking, perceived animation, etc.
You can do a "true" simulation of palette indexing in modern shaders simply as a deferred shading process or even as a step within the main render pass. You simply write a palette entry and an index to the screen (rather than a color), and then you can modify that index over time or by some other variable. In the final pass (or the immediate pass) you can compute a final color from the resulting palette entry, palette index, and shift amount.
- feiss 10y agoVery cool! Do you have any example? It's not very available by hardware nowadays but you can work in indexed by software, or doing the trick you say (that sounds similar to what I do in my library --sorry if I'm wrong, I'm an opengl shaders newbie--, but the workarounds are slower or more complex than traditional indexed mode by hardware, making it less accessible to the newcomers. Maybe my laments are just nostalgia..
- gavanwoolery 10y agoNot the best example, but at about 5 minutes in you can see how I construct palette entries and how those entries automatically get applied to the screen without recomputing the underlying voxels. I construct two dimensional palettes actually, with just a few entries and it blends between those entries. This allows cycling along two axes of the palette - i.e. one axis can be used to represent shading by amount of light, and the other can represent cycling over time or variations in the underlying pattern. https://youtu.be/X7MYf01X1Y4?t=5m https://youtu.be/X7MYf01X1Y4?t=5m If you are using a shader, it takes only one texture lookup (into your palette) to do this, so it is extremely cheap.
- feiss 10y agoCool!! Awesome, thanks for sharing. The bidimensional palette is clever! Congrats for the hard work in your voxel engine.
- gavanwoolery 10y agoThanks :)