Stencyl palette swap9/20/2023 ![]() So back in the day one if the animation tricks was to modify the lookup table if colors. And once 24-bit true color came along it was all over. Obviously with 65536 simultaneous colors it starts to become inefficient to store 2 bytes per pixel plus a huge array of 65536 palette entries, so palettes color displays met their demise. The Amiga was eventually able to refer to a 24-bit color palette with 256 simultaneous colors. Graphics cards started pushing toward 256 colors from bigger palettes, e.g. At first the amount of bits that each color could be represented with was limited, for example you might have 32 simultaneous colors from a 12-bit palette, ie 4096 possible colors. The way it mostly worked you'd have a small list of color values, and then each pixel's value would be an offset into that 'lookup table'. So graphics hardware would start to implement indirect color palettes, ie you were allowed to modify what colors were displayed. The colors you could use were fixed! So there was great demand for two things: more simultaneous colors, and the ability to specify what those colors were with more accuracy. The thing was, when computers were limited to like 16 color displays it was really hard to properly represent a real image or photo without it looking awful. In fact, other computers such as the once popular Amiga (best home computer platform ever -) would work in number of bits per pixel as 'bit-planes', for example 5 bits per pixel giving 32 colors. The thing was, the hardware was so slow by today's standards that it was barely even possible to pull up and display one byte of memory for each pixel. It wasn't until maybe the early 90's that pc's started to have a whopping 256 colors. There was almost no such thing as a dedicated graphics card. Back in the late 80's for example most PC's could only handle 4 or 16 colors. Years ago, true color displays were unheard of. People *could* make a colour effect that looked exactly like old school palette swapping if they wanted, but they simply choose to do other things instead. These days it's simply not necessary, and there are other, far more flexible ways to make effects. I guess it could be considered simple, but it certainly isn't cheap).Īs the guys have said above, palletisation was a technique borne of necessity to minimise memory usage, and once that was done it added relatively little memory usage to animate by swapping palettes. Additionally, because you'd have to modify the texture itself, "reassigning colours" isn't so "simple" (well. Thus there is no pointer to the palette, which means that palette swapping is fundamentally impossible. In modern textures, however, the colour value is stored directly in the texture itself, and is not an index into an external list of colours. Changing that pointer is the actual "palette swap". ![]() When doing that, it's fairly easy to use the same index but pull colours from a different palette just by changing the pointer to the palette used for drawing. Click to expand.In those old games colour values aren't stored in the sprite itself, they are stored in an external list of colours called a palette, from which they are referenced by index. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |