![]() ![]() However, in most cases we have no idea who the artists of these pieces of work are because they didn’t sign their names or mark any pieces of work that they created. Most art pieces were discovered from tombs, often of Egyptian nobility. So many exquisite pieces of Egyptian art have made it to this day and age because of the durable substances that they were made of a lot of their art was made of clay or stone and the climate in which they were kept (hot desert air of Egypt) was perfect for preserving them. This specific culture is so interesting because of the many remains left for us to examine and study. Converts the RGB color into the LUT UV coordinates.The fascinating art of the Egyptian culture stretches from 3000 BC to today, as remnants left for us. It takes the reference palette color and uses it as a coordinate to put the color in the edited palette on a LUT. Then I feed the reference palette and edited one to my program which would generate a full 4k LUT texture.I save original palette file somewhere - it will be used as a coordinate reference of our LUT, and then edit a copy of it, changing the colors with ones I want.And in case you already have one (for example you strictly use DawnBringers palette) - you can just as well use it, without that processing step. I take all the images I want to get palette extracted from and feed it to my program.In my case, I do it in 3 steps with a simple program. In fact, we only really need the first formula. Meaning that for each pixels we can calculate a position on a texture and a reverse with the following formulas: // From color to textureīlue = floor(X / 256) + floor(Y / 256) * 64Īs you can see, it's not that hard to do. This is a mock example with 6-bit RGB, producing 64圆4 tables per slice. Leaving us with a 64圆4 combination of slices. If we imagine color space as a 3D cube with 256x256x256 dimensions, we'll get something like that:īut our texture is 2D, meaning that instead of depth, Z-aka-Blue would have to represent an index of the cube slice. Now we have only 2 question to answer: How do we encode the palette onto 4k texture and how do we decode it on GPU in a shader. ![]() Coincidentally, a 4096x4096 (aka 4k) texture fits the exact same amount of pixels. Usually people use 8-bit images, meaning that there's 8 bits per the primary color, meaning that each channel have 256 (0-255) density values, and RGB8 color space gives us exactly 16 777 216 colors (256^3). But what if we could just use a simple lookup table and swap any color we want during the rendering for a fairly cheap price? That is the why this a thing now. Working with various people I've seen that it's often done in an inefficient way of just preparing copy of exact same sprite just to change the colors, or make limited version of palette swap by recoloring only a specific color (like magenta) at runtime. That technology was used for a long time, but with modern pixel-art games using PNGs, it became harder to do so, since those are not indexed colors. But what about doing it at runtime without a need to re-edit them? For example on sprites to make them appear belonging to a specific team. Pixel-art is a palette-limited image that uses strictly specific colors, and those colors can be easily swapped in the editor. Cheap pixel-art color swaps based on LUTs: why, how and alternatives. ![]()
0 Comments
Leave a Reply. |