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

Assets [RELEASED] Palette Modifier - Change the colors of Low Poly models directly inside Unity

Discussion in 'Works In Progress - Archive' started by Nicrom, Oct 4, 2019.

  1. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Palette Modifier

    Asset Store Link
    Discord | Twitter

    Hi everyone.

    If you work with low poly models (for example, those created by Synty Studios) you probably noticed that most of the models use a single material and a texture atlas with a series of color palettes arranged in a grid like pattern. If you want to change the colors of a model, first you have to import the model in a 3D application (3DS Max, Maya or Blender) and find which texture colors are used by that model, then you have to import the texture atlas in an image editing software like Photoshop or GIMP. The next step can take a considerable amount of time as you will most likely have to change the colors and export the texture multiple times before you get the result you want.

    To reduce the time needed to change the colors of a texture atlas, I created an editor extension called Palette Modifier, that allows you to do that directly inside Unity.

    Main features:
    • Per object colors
    • Break color sharing.
    • Texture pattern tint.
    • Color gradient.
    • Save color changes as a new texture atlas.
    • UV Inspector.

    Other features:

    • Color groups.
    • Color highlight.
    • Reorderable list of colors.
    • Foldable list of colors.
    • Non destructive workflow.
    • Reset single color to its original value
    • Reset palette colors to their original values.

    Per object colors
    Palette Modifier finds and displays in the inspector only the colors that are used by the selected game object.

    Break color sharing.
    PM creates a copy of an objects mesh and moves the UVs to a section of the texture that is unused by other objects. This feature is useful when you want your object to have unique colors that are not shared with other objects.

    Texture pattern tint.
    Palette Modifier allows you to apply a color tint to segments of the texture atlas that have texture patterns on them.

    Color gradient.
    You can apply a color gradient to all the object colors or to just a few.

    Color groups.
    If your model has many colors you can arrange them in groups and give the color groups distinctive names.

    Color highlight
    The color selected in the inspector can be highlighted. This makes it easy for you to know where this particular color is used on the object.

    Reorderable list of colors.
    The object colors are displayed in the inspector as a reorderable list.

    Foldable list of colors.
    The colors list can be collapsed to make the list more compact in the inspector.

    Non destructive workflow.
    The changes you make to the texture atlas are not automatically saved to HDD. This means that you can experiment with different colors without being worried about destroying your original texture atlas.

    Save color changes as a new texture atlas.
    If you changed some colors, but don’t want to lose your original texture, you can save the color changes as a new texture atlas.

    Below are some GIFs that showcase Palette Modifier features.

    UV Inspector


    Per Object Colors & Color Highlight


    Texture Pattern Tint


    Break Color Sharing


    Color Gradient


    Palette Modifier is now available on the Unity Asset Store.

    Please let me know what you think of this editor extension. Thank you.

    Best regards,
    Nicrom.
     
    Last edited: Feb 11, 2020
    Magnitude9 and JoJa15 like this.
  2. Kekoss

    Kekoss

    Joined:
    Mar 12, 2019
    Posts:
    1
    This looks so useful and timesaving, can't wait to try it out.
     
    Nicrom likes this.
  3. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    The coding is all done, now I just have to make a tutorial, promo materials, and the documentation, than I can submit it to the Asset Store for review.
     
    Last edited: Oct 5, 2019
  4. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update.

    Hi.

    In the past week I made some changes to Palette Modifier code as well as added new features.

    In the video bellow you can see how the Texture Grid asset is created. PM uses the Texture Grid asset to find the texture colors that a model uses.



    Previously you could only change the flat colors of a model, but now you can also apply a color tint to parts of the texture atlas that have texture patterns. Color tint works the same way as the material color, but instead of it being applied to the entire texture, it is applied only on the parts of the texture used by the current object.

    Another thing that changed it how you break color sharing between models. Previously if you had several models that shared the same texture colors and wanted to have a model with unique colors, you had to open a Palette Modifier window. In that window you had to provide a reference to the object with the PM script, a reference to the Texture Grid and the color of the unused space on the texture. Now you only need to press a single button.

    The video bellow showcases the color tint and how you break the color sharing between models feature .

     
    Last edited: Oct 23, 2019
  5. Magnitude9

    Magnitude9

    Joined:
    Jul 11, 2017
    Posts:
    11
    Hi just checking in on this. When will this be available on the asset store?
     
  6. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. Yes, it will. I'm currently doing a beta testing of PM with a small group of people, to make sure there are no major bugs.
     
    Magnitude9 likes this.
  7. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update 2
    Hi. It's been a while since the last update. I'v added a couple new features as well as improved the user experience.
    • When you add the Palette Modifier script to a GameObject, you no longer need to assign a Texture Grid asset. You still have to create it, but the task of assigning it is now done automatically by PM.
    • If you select a texture atlas, right click it and create a Texture Grid asset, the selected texture atlas will be assigned to the Texture Grid asset. The Texture Grid asset will have the same name as the texture atlas plus the TG_ prefix.
    • The PM settings in the objects inspector are now displayed in tabs.
    • When you create a Texture Grid asset, you don't want to have overlapping Flat Color Grids or Texture Rects, but there was no way to know if you had any overlapping grids on the canvas. Now if the Texture Grid Editor detects that there are overlapping grids, they will be colored in red.
    • I added the ability to copy and paste a Flat Color Grid or Texture Rect.
    • I added the ability to reset a color field to its original value.
    • I added the ability to reset the colors of a palette to their original values.
     
  8. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    If this works as intended you've created something great man. Any timeline for when it will come to the store?
     
    Nicrom likes this.
  9. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Thank you :). I plan to submit PM for review by the end of this week.
     
    Last edited: Nov 11, 2019
  10. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    Great to hear, thanks for the reply.
     
    Nicrom likes this.
  11. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update 3

    Hi. I made a video tutorial for Palette Modifier. This should give everyone a better idea on how Palette Modifier works.

     
    shininguri likes this.
  12. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    Nice, thorough explanation video. Looking forward to the asset
     
    Nicrom likes this.
  13. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update 4
    Hi. Palette Modifier is now Pending for Review on the Unity Asset Store.

    Palette Modifier Trailer
     
    Last edited: Jan 17, 2020
    shininguri likes this.
  14. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    Let us know when review is done you will have a day one buy from me.
     
    Nicrom likes this.
  15. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    I'll make a post on this forum thread when it is available on the Asset Store.
     
    shininguri likes this.
  16. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Last edited: Jan 29, 2020
    shininguri likes this.
  17. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Palette Modifier is now part of the Cyber Week Mega Sale with a -50% discount.
     
    Last edited: Jan 17, 2020
  18. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Palette Modifier v1.0.1 is now live on the Asset Store.
    This update contains a fix for a bug that caused errors to be generated when you tried to build the game and Palette Modifier script was on an object.
     
    Last edited: Jan 29, 2020
    shininguri likes this.
  19. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Palette Modifier v1.1.0 is now live on the Asset Store.

    This update adds a new feature to PM. The UV Inspector. You can use it to find which texture colors are used by a particular model and build the Texture Grid gradually.
     
    Last edited: Jan 29, 2020
    shininguri and Acissathar like this.
  20. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    I think you should readjust the name of the asset to have "color" in it. That way you would get more pings on the store search. Or at least add a tag. Because this thing is pretty cool.
     
    TextusGames and Nicrom like this.
  21. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Its a little too late to change the name now. If I change the name, it will create an incompatibility with the Texture Grids created in the previous version.

    When a publisher submits an asset to the Asset Store, he has the option to include Related keywords that function as tags. I included "color" in that list, but the tags have secondary priority. This means that if for example someone searches for "color", the assets that have "color" in their name will be displayed first than those that have the tag "color".
     
    Last edited: Jan 29, 2020
    shininguri likes this.
  22. shininguri

    shininguri

    Joined:
    Nov 25, 2015
    Posts:
    27
    Well looks like you were already one step ahead of the game lol. Well Im glad to hear it. Wishing you success.
     
    Nicrom likes this.
  23. j0hnbane

    j0hnbane

    Joined:
    Jul 2, 2014
    Posts:
    20
    Do you have API to use this at runtime? To shift to other colors?
     
  24. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. I'm sorry, but Palette Modifier can be used only in the Editor.
     
  25. Swyfft

    Swyfft

    Joined:
    Mar 14, 2019
    Posts:
    55
    Just wanted to say am really liking this Palette Modifier :)
     
  26. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi @Swyfft. I'm glad you like it :).
     
    Swyfft likes this.
  27. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Hey there ! Really like the addon here :) . But i would like to have one crucial feature added : Would be super cool to have the option to move the uvs for certain colors / textures to other ones. From what i understand currently the option is to either change the texture or move the uvs to a new space and make new color fields for them. For Optimization reasons it would be beneficial to use the smallest amount of unique textures as possible, and still have the option to change the coloring of the meshes quickly in Unity. I am working on mobile VR games and there's not single optimization that i can neglect in favor of convenience - every last little bit counts. Any chance that you will add this ? I think this shouldnt be too hard to make as you already got a function that adjusts uvs of the mesh implemented. Also would be cool to have the option to save the uv adjustments directly to the source file OR create a duplicate of it with the adjusted uvs (just duplicate the source file and not save it as a new .asset file would be the superior solution). Thanks for including the source code - there's nothing more frustrating then not being able to adjust extensions to the projects needs :)
     
  28. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi @DonCornholio. I'm glad you like Palette Modifier :).

    The option to manually move the UVs, is not something that can be easily implemented. Currently you can indirectly move the UVs, by using Break Color Sharing feature. When this feature is used Palette Modifier creates a copy of the objects mesh and moves the UVs of the copy to a section of the texture that is unused by other objects, than saves the new mesh and assigns it to the game object. One of the downsides of this is that you no longer have acces to the import settings of your model, so you can't enabled things like Lightmapping UVs or change how the normals are calculated. I tried to find a way to edit the original model, but was not able to make it work correctly.

    I want to eventually add more advanced UV editing features to PM, but I'm not sure when that will happen.
     
  29. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Allright. Good to know that you have it on your radar ^^
    If i am quicker than you implementing that feature, i'll send you a message with the code. Don't count on it though, my current project uses a different workflow, so i have other priorities atm. But in general this is a great workflow for more low end devices, and there will be certainly projects in the future that will resort to using this.
    Excited to see how this Addon evolves :) ! Keep up the good work !
     
    Nicrom likes this.