![]() I just wanted to share in case any one else could get any value out of this. There are a few places it could be better, like the currentpalette/15.0 in the draw event should be in the shader, but I figured you can fix that stuff on your own. In your game just change the currentpalette value to something within your palette sprite's bounds and make sure it is a float with. Shader_set_uniform_f(currentcolumn,currentpalette/15.0) ĭraw_sprite_ext(sprite_index, image_index, floor(x), floor(y), image_xscale, image_yscale, image_angle, image_blend, image_alpha) Īnd in the create event i have this palette = shader_get_sampler_index(shd_paletteswap,"palette") Ĭurrentcolumn = shader_get_uniform(shd_paletteswap,"currentcolumn") Texture_set_stage(palette,sprite_get_texture(sPlayerPalette, 0)) I did it this way in the draw event i have shader_set(shd_paletteswap) Do you know any way to fix that, and make it faster There are only 8 colours, but I still dont want to copy so many costumes. Just create a sprite with your palettes starting top left and going down and the next palette to the right of the first and so on.įeed the shader the palette and the maximum amount of colors in your palettes In this project, it takes 263.9 seconds to load, even though it should be a quick palette swap. Test_color = texture2D( palette,vec2(0.0/maxcolors,x_x/maxcolors)) New_color = texture2D( palette, vec2(currentcolumn,x_x/maxcolors)) Vec4 new_color = texture2D( palette, vec2(0.0/maxcolors,0.0/maxcolors)) Western Animation - palette swap Like us on Facebook Pin Tweet PROTIP: Press the and keys to navigate the gallery, 'g' to view the gallery, or 'r' to view a random image. Vec4 test_color = texture2D( palette, vec2(0.0/maxcolors,0.0 /maxcolors)) Vec4 base_color = texture2D( gm_BaseTexture, v_vTexcoord) Vec2 newcoords = vec2(currentcolumn, 0.0 ) I figured I would share it here and other people could tear it down and make it better if need be. I'm not really sure if what I got here is any good performance wise or anything like that. There were several great shaders, an awesome looking one by u/pixelatedpope especially, but none of them were simple enough for what I wanted. After searching up all the ways other people have accomplished this I couldn't find a simple solution. I am working on a Megaman clone project to learn Gamemaker and I wanted to work on the palette swapping from the original game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |