Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

New Asset Store Package for Retro Sprites with Palette Swapping

Discussion in 'Assets and Asset Store' started by figs999, May 21, 2013.

  1. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Have you ever wanted to have more sprites in your game, but didn't want to create more assets or take up more memory? This was a common issue back in the early days of game development and savvy developers got around it by using palette swaps. This "lost art" is rarely used any longer, but it is still incredibly useful for developers on a budget.

    On top of that this tool can be used as a clever way to save on texture memory without losing color quality, by using the Alpha8 mapping mode.

    Only 40$ on the Asset Store:
    OldSkool Palette Sprites in the Asset Store



    I made this palette sprite tool when I encountered a need for this type of functionality that was not being addressed, I wanted something that did this myself and was somewhat shocked when I couldn't find anything like it in the asset store. If you aren't familiar with shader programming you may not even know where to start to accomplish this type of feature in Unity; and even knowing how to do it, it can be a daunting task to implement it in a way that integrates well with existing art assets.

    Facing exactly this problem I made a system that will convert any image with 64 or less colors and a power-of-2 size into a palettized sprite. Each image gets turned into two textures: one that is a palette and the other a "map" that is combined with the palette (using the included shader) into a complete image. Once you have converted an image you can take the palette and switch some of the colors around in your favorite image editing program and import the new version into Unity to give your image a fresh new look.

    The instructions included should give you a good idea of how to use this tool, but if you have any questions I'll try and answer them ASAP.

    *UPDATE*

    A new version of this tool is now available on the Asset Store that will allow you to compress up to 256 color images with lossless color into an Alpha8 image, which can potentially save you several MB of texture memory, even if you're not using palette swapping.

    To see how to use this tool check out the youtube tutorial:


    *UPDATE*

    A new version of the tool is now available that makes it easier to integrate with Unity2D Sprites.
     
    Last edited: Nov 23, 2014
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Sounds cool. I suggest making it 256 colors by default, or some other version or subset of shader(s) that are made for 256, mainly because there are some graphics tools out there for building paletted images that work at 256 colors.

    Also once you've turned your sprite into a paletted sprite with your colormap lookup shader, what is the process for keeping the sprite but switching out the palette for a different one at runtime? And does that allow you to take say the same sprite and apply several different palettes to it as different sprites on-screen?

    Maybe you can also elaborate on the benefits of using palettized sprites in Unity. Is the sprite stored in an RGBA 32-bit texture, ie with no memory savings? Is it purely to let you swap palettes on the sprite and not so much to save memory or increase speed or anything?
     
    Last edited: May 21, 2013
  3. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    The 64 color default is easily changed in the palettizer script, its just a default I chose for "sanity". Manually managing a 256 color palette can become a headache, since it is easy to lose track of which colors are used in what area of the sprite. Since the tool is meant to emulate a "retro" style 64 colors is actually overkill as most older consoles only had a handfull of colors available at any given time.

    To swap the color palette at run time all you have to do is change the texture that is being used for the palette for the renderer in question via:
    renderer.material.SetTexture("_PaletteTex",textures[index]);

    By default swapping a palette at runtime will only affect the sprite instance you have referenced unless you call SetTexture on the sharedMaterial.

    The memory benefits are potentially imense for both in game memory usage and disk space. When you have a 64 color 256x256 sprites, for instance, with 10 different color schemes stored in a lossless format they can take up over 2 megs of space. Alternatively one 256x256 map and 10 8x8 palettes take up less than 300 kB.

    The savings get progressively more impressive the larger the assets being "palettized" become. If you "palletize" the recolorization of an entire character's animation Sprite sheet (which could include multiple 2048x2048 pixel atlases) you can save yourself hundreds of megs memory.
     
    Last edited: May 21, 2013
  4. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    My current project can serve as a real world example. I am working on a game that is supposed to run on iOS, but the art director wants to include dozens of different cars as props that drive past street the character runs along. The cars are now all implemented as 4 different textures that have been palettized. The palettes have made it so that we can have the dozens of different looking cars that our art director wants while staying within our memory alotment for scenery objects.

    Also, a best practice note that I learned from that implementation: Make sure you distinctly color the areas you want to recolor in your palettized sprites. Our artist initially gave me sprites that used the same color for parts of the car body (which was supposed to be recolored) and for parts of the windows (which were not supposed to be recolored). The palettizer tool mapped those two sections of the sprite to the same palette location when this was the case. Try and paint any sections you want recolored in very bright distinct colors so you can identify the "swap spots" in the palette when you are editing it later.

    I'll probably put out a video about how to do this later if there is enough interest in this tool.
     
  5. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I see, so you mainly save memory by reusing the same texture and swapping out a different palette. Can you possible post your instructions/documentation freely so I can see better how you intend it to be used?
     
    Last edited: May 21, 2013
  6. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Sure thing, I'll post a youtube video tutorial and my instructions document later tonight.
     
  7. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    You can see a video tutorial on how to use the tool below:
    http://youtu.be/KvIGGaKGFJU

    I decided to not upload the text instructions and just covered everything required in the video, so it is a bit verbose.
     
    tosiabunio likes this.
  8. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    I just made an improvement to this package that stores up to 256-color maps in only one color channel. Making it so that as long as you use less than 256 colors you can display an image with lossless colors and take up 1/4 the memory of an RGBA32 image. This ends up being about equal to a PVRTC4 or similar compression, but with perfect color retention.

    My current project is now going to use this shader for most of our characters even when they don't have multiple palettes, since it will save on texture memory.

    This addition has been submitted to the asset store, but has not yet been approved. Previously two color channels were used. Two color palette maps are now only needed if your target device does not support Alpha8 format, or if you want more than 256 indexed colors. The youtube video posted above uses this new version of the tool.
     
  9. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    The updated version of the tool is now on the asset store, including a small bugfix that makes larger palette sizes work better.
     
  10. EightBitNine

    EightBitNine

    Joined:
    Jun 10, 2013
    Posts:
    3
    Aww man! This is just what I need! I have been struggling with color tweaks for my 2d sprite game.
     
  11. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Glad I could help. Let me know if you have any problems using the tool, I'd be happy to assist if you do.
     
  12. masterchafe

    masterchafe

    Joined:
    Oct 2, 2011
    Posts:
    59
    Really glad you've made this, it is such perfect timing with what I have just started prototyping! I ran into a snag however, which I need some help with. I need to be able to use the X&Y Tiling&Offset attributes of the maintex in the material inspector, but when I use the OldSkoolPalette shader they seem to be disabled or ignored. I have no clue when it comes to editing shaders. Can you help restore these for me? :)
     
  13. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Hi Masterchafe,

    I'd be happy to add these back in for you. I left these out because there is the potential that it could cause strange issues if the pixels are stretched and color interpolation occurs. You will have to be carefull to not stretch the image unevenly at all while using the texture tiling and offsets.

    I'll post up a fix for this momentarily.

    Thanks for your interest!
     
  14. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    I am going to post the fix to the AssetStore, but that could take a few days. Anyone who wants to use the fix in the meantime can modify their OldSkoolPalette shaders as follows:

    Add this line under the other variable defines at line 27:
    float4 _MainTex_ST;

    Then replace (line 45ish):
    o.texcoord = v.texcoord;
    with this:
    o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);


    I tested it out and there wasnt any stretching problems afterall. Not if your using point sampling and no-mipmapping at least. I was worried for nothing ;)
     
  15. masterchafe

    masterchafe

    Joined:
    Oct 2, 2011
    Posts:
    59
    Thanks Chance, it works perfectly! Gotta love the fast support! :)
     
  16. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Happy to help. Let me know if you have any other problems or feature requests for the next version.
     
    Last edited: Jun 17, 2013
  17. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    Looks like a great tool. Can you confirm that changing the paletted texture per sprite instance does not add a draw call per instance? Thanks for your help.
     
  18. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Hi PointNineGames,

    The shader doesn't do draw batching intrinsically, so if you are not batching your draw calls somehow then it will add an additional draw call per sprite instance.

    The shader should still work with dynamic and static batching however, and with the various sprite utilities that include batching methods.

    Changing the properties of the material of an instance on the fly (at runtime) will cause a new material to be created, so it will not be batched. But if you create a material for each palette during design and you swap between those, it will allow batching.

    I Hope this answers your question.
     
  19. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    Thanks for the quick response! I'm using a sprite atlas with 2d toolkit. As a test, I created a second material and swapped some character sprites to that material in code. My findings are that it adds 1 draw call per material. This is much better than one draw call per sprite instance, but means I would still add 30 draw calls if I wanted 30 color variations.

    It sounds like you were counting on dynamic batching to get me the rest of the way, but I have transparency in my materials which I'm reading breaks dynamic batching.
     
  20. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    No Problem, I try and get back to support questions ASAP.

    This sounds about like what I'd expect. The primary goal of this tool is to minimize texture memory resource use, not necessarily to minimize draw calls. But 30 draw calls for 30 different materials is correct.

    As far as I know, dynamic batching still does work with transparency, it just works best if the objects share the same z-layer. I've heard that Unity also has some voodoo where it doesn't always get things in the same z-layer, but I've never personally had an issue with that. Unfortunately this is pretty much a hard limit for Unities rendering, proper z-sorting takes multiple draw calls because the objects that are rendered behind need to be rendered first. Unity CAN, however batch some things on different z-layers by doing pre-render logic to determine if things overlap, but this is where the voodoo comes in and what gets batched and what doesn't is unpredictable.

    I've heard that you can "trick" objects into doing batching with transparency on separate z-layers by specifically setting the render queue layer in the shader. But unless Unity does some kind of rendering magic that I'm not privy to, this won't really be properly z-sorted compared with everything else...


    What kind of device are you targeting, may I ask? 30 draw calls isn't terribly many for most modern phones/tablets, you can pretty safely go up to hundreds of draw calls if you're limiting your game to the last couple years devices. If you are worried about performance issues from draw calls, keep in mind that the draw call recommendations for phone development typically are assuming that you are doing something fairly hefty in each one. Although all draw calls have a certain amount of overhead, a draw call that renders 12 tris for a few sprites is less weight than a draw call that renders 100,000 tris for a bunch of models.


    This said, you have brought up an intriguing concept. I may look into seeing if I can make this package more friendly to people who want to have far more color variations on screen at once than they do draw calls.
     
  21. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    My plan now is to get your package from the asset store and try my luck with dynamic batching, and if I hit a wall there I will just limit the number of color palettes that I'm using. In my test, my sprites were on the same z-layer, but its worth noting that during gameplay they can change their z to get in front of or behind other objects.

    I'm targeting iphone 3GS as a base.

    Since you've showed an interest in a solution to using multiple palettes in one draw call, I'd like to point your attention to this thread: http://unikronsoftware.com/2dtoolkit/forum/index.php?topic=1899.0. The suggested solution is to make one master palette texture where each palette is one line of pixels on the x axis. I thought that might be helpful.

    Thanks again for your insights and I look forward to trying out your tool. :)
     
  22. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Yeah, I think the 3gs is fairly limited, but you should be able to go to almost 100 draw calls and still hit 30fps from my experience. I think it depends on the version of Unity you are using as they have made it more efficient in recent releases.

    Thanks for the link, I'll start my investigation there.
     
  23. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    A question for you sir. Is there anything about your OldSkoolPalette_Alpha8 shader that is not compatible with iOS? Everything is working great in editor but on the iPhone I am only seeing the pixels that are black in the source art. If I use the standard 2d toolkit BlendVertextColor shader there is no issue. Any help is greatly appreciated!
     
  24. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    One possibility is that you have the texture compression settings for your project set to automatically compress all image files to a mobile optimized format / filtering. You need to make sure that the files you use for Old Skool Palettes save their original compression settings.

    If that's not it then I will will have to look deeper into the matter. Other people have used this with iOS fine, so it's not a hard compatibility issue.
     
  25. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    Thanks for the quick response. As far as I can tell I'm not having any compression issues. My world art is using a standard shader and appears to be pixel perfect. I can also turn on heavy compression and see that the palette shader still works in the editor. Even though it is a mess, there is still color. On iOS all non-black pixels are alpha=0 however.

    As a test I replaced all alpha=0 (i.e. unused) pixels on the palette map with a bright blue, and on iOS I did see blue for all the non-black pixels. This leads me to believe that the pixels are mapping incorrectly on iOS. Can you think of what might cause that?

    $atlas0_palette.png

    $atlas0_palette.png
     
  26. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    The only other thing I can think of is that there is a bug in the iOS graphics drivers that is making it so that the math functions I used in the shader are clamping to 0 or 1 instead of interpolating between them smoothly.

    Try changing the color of the top left corner and bottom right corner. If those colors then cover the object in the iOS build that will confirm my theory. Once we can figure out why it's happening I can find a work-around for you ;)
     
  27. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    It is mapping completely to the left column. I've attached the source image, what I see on iOS, and my modified palette. I also attached the correct palette in a previous post.

    $atlas0_palette.png $Guard2_Idle_3.png $photo.PNG
     
  28. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    In the shader you are using try changing the following for me:

    Switch the queue from:
    "Queue"="Transparent"

    To:
    "Queue"="AlphaTest"


    If that doesnt help try replacing:
    return c2;

    with:
    if(c2.a > 0.5)
    return c2;
    else
    return fixed4(0,0,0,0);
     
  29. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    Both of those tests yielded the same result of using only the left-most column of the palette, on their own and combined together.

    You may already be one step ahead of me, but my own fiddling has led me to the conclusion that setting fixed upper = 0 gives me the same bad results in the editor as I'm seeing on iOS. I've also found that using fixed upper = c.a, gives a crude approximation of the correct colors on iOS, which makes me think that c.a is fine. For example if c.a is .5 in the pmap the upper calculation is 0 when it should be .4775.

    This makes me think the upper calculation pasted below is bad on iOS, but I have not found a fix.

    fixed upper = floor(a256 / 16)/16 + 0.04;

    Also, I tested it on Android and it works fine there.

    I'm still quite stumped and would greatly appreciate any other thoughts!
     
    Last edited: Feb 8, 2014
  30. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    I found that it works on iOS if I replace the fixed/fixed4 with float/float4. What a relief!
     
  31. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Probably works to replace float with half, instead, for better mobile performance.
     
  32. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    That's truly bizarre. I've never been a fan of iOS architecture, so many weird bugs in their driver implementation. It sounds like iOS is defaulting to working with those numbers as integers for some reason, I can't imagine that there is an actual bug in their fixed point mathematics.

    ImaginaryHuman is right, if you have to use floating point numbers instead of fixed point numbers you should go with half type instead. Fixed is used to be friendly to mobile architectures, where floats are not very friendly at all. Halfs will at least get you some of that savings...
     
  33. PointNineGames

    PointNineGames

    Joined:
    Jul 13, 2013
    Posts:
    16
    Sadly, I found that using half did not work either!
     
  34. blacksp1der

    blacksp1der

    Joined:
    Dec 11, 2007
    Posts:
    76
    The shader doesn't work on my samsung galaxy, until I replace fixed with float. I hope there's no complains from users since fragmentation is a problem on android devices.
     
  35. coombsanity

    coombsanity

    Joined:
    Mar 24, 2014
    Posts:
    8
    Getting lots of "Too Many Color" errors despite the source image having only 62 colors (and we really only want to swap 7 of them). Any work around for this?
     
  36. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Please make sure that you do not have any "hidden" color differences. These are minor fluctuations in color that can result from pixel blending in your graphics editing program, or differences in the alpha layer. Even if you have 2 pixels that have the same RGB color, if they differ on A they are different colors.

    If you really do only want to swap 7 colors, another option would be to use two separate sprites overlay-ed on top of each other. Have your sprite that stays the same behind a palette swapping sprite (one that contains only the pixel data that you want to swap). If you know some shader programming, you could also add a static texture to the last step of the palletizer shader's color blending.
     
  37. masterchafe

    masterchafe

    Joined:
    Oct 2, 2011
    Posts:
    59
    when this happens to me, I go back to photoshop and fill the bottom layer with green or some colour not used, then save as a png without alpha, and then after the image is converted in unity I go and erase the green pixel in the generated palette image to add transparency again.
     
  38. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Hello! This is a wonderful tool, both for palette swapping and reducing memory. I admire the elegance of squeezing all of that color info into such a small file.

    I noticed a lack of discussion regarding Unity's own 2D support. I realize this tool was released prior to 4.3, but has it been made compatible with SpriteRenderers? Or could it be, with modest adjustments? I don't have a background in shader programming, and since I'm forced to use SpriteRenderers, this tool may be unusable for me and my client.
     
    Last edited: Jan 11, 2024
  39. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Hi Brian,

    Im glad you like the tool. The shaders should work with the new sprite system. Have you tried applying a material with the Pallettizer shader on it to the SpriteRenderer?

    If that is not working then I will probably need to make a custom shader for the Sprite system, so let me know. I should be able to make the custom shader tomorrow if it is needed.

    Cheers!
     
  40. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    I appreciate the speedy response! I slapped the appropriate materials onto SpriteRenderers, which produced the results in the image below. On the left are 3D planes as demonstrated in your tutorial, while the SpriteRenderers are on the right. It appears the current workflow is incompatible with Unity's sprites.

    Palettes.png
     
    Last edited: Jan 11, 2024
  41. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    Thanks for the image, that's very helpful.

    I'll look into what needs to be done to make the shader compatible with the new 2D system. I anticipate it shouldn't be too much different, so I should have a new version up and ready tonight or tomorrow.

    I'll post again as soon as I have a solution.
     
  42. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I don't really get why the shader would not work with a sprite... pretty much any shader can work with a sprite, it's really just a quad with a texture on it. I guess provided you have the proper texture inputs or whatever?
     
  43. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    @Brian Problem solved! A new release has been submitted to the Asset Store and should be available soon. Send me an email (address is in the readme file in the asset package) and I'll send you a copy of the update immediately.

    @imaginaryhuman Yeah, turns out the Sprite system requires some specific configuration on the shader that makes it pull the main texture from the Sprite object automatically. Not a huge difference, but it does make the shader for the normal version incompatible with sprites and vice-versa.
     
  44. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Awesome! My client's sprites are much more detailed than the old-school games that serve as his inspiration, and I'm sure we'll get a lot of mileage out of this. I'll send the email shortly.
     
    Last edited: Jan 11, 2024
  45. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Hey, Chance. I encountered the same error as coombsanity ("Too Many Colors"). We have multiple spritesheets for each character, and I'm trying to palettize them all at once so my client can hand a single palette to his character artist. I've already set paletteDim to 16, so this issue is pushing the total colors beyond 256.

    I know you explained why this happens, because of small alpha values and variable rgb. However, I'm not aware of a good way to remove these pixels, and even if there is one, we'd have to do it for most (if not all) of our spritesheets. An automatic alpha threshold would be incredibly useful. I've found that all our loose pixels have alpha values of less than 1, something I've had to take into account with TexturePacker as well. So, I changed line 253 in Palettizer.ExtractPalette() to:

    if(!paletteContents.Contains(c) && c.a >= 1/255f)

    This works on the palette, removing all transparent gaps. However, it also breaks the sprites, as seen in the image below. I reverted the line, re-palettized the sprite, and it's back to normal. Is there a practical way to do this?

    Alpha Threshold.png
     
    Last edited: Jan 11, 2024
  46. figs999

    figs999

    Joined:
    Oct 27, 2012
    Posts:
    50
    I was hesitant to add anything to automatically do an Alpha threshold since some people might need fine alpha differences, but if you think it will work out fine for your sprites I am more than happy to help you do it.

    You are on the right track, but What you had done before was making it so that the effected pixels were just ignored during palette creation, which made them contain "junk" colors. What you want to do is make sure that the alpha is clamped to 0 or to 1 before you write to the palette and then once again when constructing the palette map.

    So, instead of adding a check to the conditional that adds a color to the palette, add the following line just after the GetPixel call in both CreatePaletteMapTexture and ExtractPalette:

    c.a = c.a > 0.5 ? 1 : 0; //Clamps values greater than 0.5 to 1, and less to 0

    Feel free to change that 0.5 to wherever you think the alpha cutoff should be.

    It looks like your palette is very sparsely populated in that screenshot, you might be able to get away with setting paletteDim back to 8 after getting this fixed :)
     
  47. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Oh, that's a little misleading. That spritesheet is just one of twelve I want to palettize together. The combined color total for this particular character is almost 128.

    I understand you wanting to preserve alpha granularity, and we do need it for punch effects that fade gradually. What I ended up doing was checking if the alpha value is below my threshold, then wiping both alpha and rgb. The color values seem to be the real culprit here, with alpha being the safety margin in which to wipe them. The final snippet looks like this:

    if (c.a <= 1/255f) {
    c.r = c.g = c.b = c.a = 0;
    }

    Thanks again, for helping me find where this needed to go.
     
    Last edited: Jan 11, 2024
  48. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    If your shader is referencing `data` in the texture, to point it to looking up palette colors in the palette texture, doesn't this mean the main texture has to have `point` sampling and that palletized textures can't support bilinear filtering?
     
  49. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Actually, I was inclined to ask about that. I had to check the YouTube tutorial again, and I noticed a user asked if this can be made to work with bilinear. I switched to it, and bilinear did wreck things. It's a fair trade-off, but any chance of adding support for bilinear in the future? I know it probably wouldn't be as simple as supporting SpriteRenderers.
     
    Last edited: Jan 11, 2024
  50. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Thats kind of what I thought. To do bilinear you have to do it in the shader, sampling 4 nearby indexed colors (after getting their palette values) and combining them on the fly. The texturing hardware can't do it.