

This shader is useful for images that use multiple static palettes. Palette indices are encoded in the red channel while colour indices within a palette are encoded in the green channel. It is comprised of two different shaders: Image-Encoded Palette (IEP) Shader Super Jibby 2 uses the palette and colour data encoded in false-colour RGBA textures together with a reference palette texture to determine the final colour drawn. So, if you in the situation described above, start a new pal project import the new, crushed version of the sprite, and your actual palette will represent the new, smaller palettes.A set of shaders designed for GameMaker Studio 2, for palette swapping and drawing index-coloured sprites and images. I worked for awhile to make this better, but ultimately it was a ton of work, and I'll improve this feature in future versions. And, obviously, whatever the sprite was originally named has been lost. Inside: all your sprites with the desired palette.ĭownsides? If you have TON of sprites like this, they must be added to the palette builder one at a time (sorry). pal file for the current project called exported. This feature works for those of you in the above situation, but also those who don't want to actually palette swap anything at run time, they just want to mess with some colors and re-export their sprites with the new palette.Īfter saving your project locally, you can press X to export all your loaded sprites using the currently selected palette so as it would appear in the preview window at the time. then what? The palette itself still has 34 entries or whatever. Okay, now you have a palette with reduced colors but. You may need to modify the resulting colors again just like any palette, but the overall color count should be reduced, sometimes significantly. Every time you use this, a new palette will be added to your project with the new crushed palette. This results in similar colors being combined. What crushing does is it will divide each RGB element by your crush factor, floor the result and then re-multiply them by the factor. What the hell is a crush factor? Think about it like this: Every color is made up of 3 RGB values, each 0-255. A dialog will pop up asking you for a "crush factor". With an active project, press C on the keyboard. So what are these features?ĭoes your art have too many colors that are just too similar to one another that it's driving you crazy and your artist doesn't seem to understand that #45B292 & #45B192 shouldn't both be used in the same sprite, then this feature is for you.
#GAMEMAKER PALETTE SWAP FULL#
I was planning on doing all sorts of crazy stuff, but decided to save it for 4.0 (which will be a full rebuild from the ground up in WPF instead of GML. I fixed a crash when trying to interact with the preview box without loading any sprites (Thanks for reporting, Adam!)
#GAMEMAKER PALETTE SWAP UPDATE#
In addition to updates to the shader itself, I've add a minor update to the Palette Builder. So, really, can't emphasize enough for HTML users to double check the Actual texture page size. It was a suggestion by Sidorakh (fellow GM Discord Admin) to export it and see the ACTUAL size. I set my texture page to 2048 but it just would not work. This actually tripped me up for awhile while developing the shader for HTML. Turns out, that no matter what you have it set to, if you have a single page and GM can fit it in something smaller than you set it to, it will export it at that smaller size. But if it doesn't seem to be working at all or very inaccurately, try going back into your global game settings and previewing your texture page. In most cases, this will be the resolution you selected in your global game settings. If you open up either of the HTML5 shaders, you will find a #define for "TexturePageSize". Speaking of which, I think I need to re-iterate one of the new requirements for HTML5. These constants are available in all 3 pal swap shaders.

In most cases, I recommend leaving it at.

If you feel it's not matching colors it should, increase this number until it feels right. Modifying the tolerance value will affect how accurate palette swapping is. However, if you were digging the more lenient color swapping, I have made it available for you to customize. Swapping has now returned to the previous level of accuracy that I had in version 1.x.Ģ. Especially if you are using some clever way to prevent specific parts of the sprite from drawing with an alternate palette, as Ajmal was.ġ. So, in the previous 2.0, when using an alt palette every single pixel you draw WILL use a color from the alt palette. Alright, so, after working with Ajmal who is using the asset in his recent game jam game, I realized that my idea to make palette swapping "more lenient" was probably a bad idea.
