![]() ![]() While this shader was made in GameMaker Studio: 1.4, we’ve confirmed it does work in GameMaker Studio 2. However, no one on the team directly has a copy of GameMaker Studio 2, so we will be unable to provide direct support for anyone using that version of GameMaker. If you have any questions (that aren’t answered in the documentation), comments, suggestions, etc, feel free to shoot us an ask, or discuss with us in our Discord server.īelow the cut is an extended post, written by our lead programmer Faruga, who did about 99% of the work behind the shader, about how we came to write our own shader. “There are a few different ways to approach palette swapping. One way is to separately save recolors of each sprite. This is easy to program in, but not very user friendly if you want to modify the sprites later on, and they take up quite a lot of space. Another option is to store the blue, cyan and black bits of Mega Man separately, and then specifically colour them when drawing. The third option, which is probably the hardest to grasp, is to write a shader.” This takes up less space, but it’s still relatively difficult to modify existing sprites. “Shaders are small functions that run on the GPU. When you draw a texture using a shader, the shader intercepts the texture, and changes how it’s drawn to the screen. Because GPUs contain lots of simple cores, rather than just a few complex ones like the CPU, it can process lots of pixels at the same time. You can pass a shader multiple textures, so one of them can be the sprite you want to draw, and one can be a palette sheet.” You can do a lot with shaders, and this includes palette swapping. “Earlier on in this project, we used the “Retro Palette Swapper”. This used a shader which loops through the pixels on the leftmost column of the palette sheet, and if the color being drawn matches one on the sheet, it uses the sheet to decide which color to draw. The problem with this approach is that when shaders have loops that stop partway through, it doesn’t actually stop the loop. It just discards the results, pretending nothing ever happened. This is so that every core finishes running the shader at the same time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |