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

► Vertex Color Adjustments ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Mar 17, 2016.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    vertex-color-adjustments-big-banner.jpg


    Editor tool and Run-time API for adjusting mesh vertex colors.
    Plugins is already included in the Mesh Materializer and now releasing as an independent tool.

    Plugin works only with Unity mesh .asset files with vertex colors inside.
    Included adjustments:
    • Hue / Saturation / Lightness
    • Brightness / Contrast
    • Levels
    • Color Overlay (19 blend modes)
    • Color Space
    • Invert
    • Alpha Channel
    v2019.1
    • Updated for Unity 2017.4 and 2018.2
    • Fixed preset creation menu
    • Plugin can be placed anywhere inside project and now has no more restriction to be inside specific installation location

    v2018.1
    • Updated for Unity 2018.1

    v2017.2
    • Added Color Replace tool

    v2017.1
    • Unity 5.6 compatible
    • Added Retina display support

    v1.1
    • Unity 5.4 compatible


    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jan 30, 2019
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  4. coward

    coward

    Joined:
    Jan 9, 2013
    Posts:
    21
    Would this work with a standard (new) Unity shader with vertex coloring, or does it require a shader from the pack? I ask as I am working on a game where I also need my code to be able to modify vertex colors in-game (so triangle could be wildly different colors to the original base color).
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    All this tool does - modifies mesh vertex colors. It is not connected or use any shaders.
    So if you have shader with vertex color support you can freely use it.



    VacuumShaders - Facebook Twitter YouTube
     
  6. mnsanchez

    mnsanchez

    Joined:
    Apr 23, 2016
    Posts:
    1
    I've run into the issue where I have a .fbx file that I've vertex painted and inserted into the tool, adjusted the Hue/Saturation/Lightness, then applied changes. When I close and reopen Unity the object reverts back to the original vertex colors before the hue change.

    Would it be possible to use this tool to affect the vertex color of game objects that are not a .asset? Or, would I need to convert the object into one to properly affect the vertex colors?

    Thank you!
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Unity can import many types of mesh files like fbx, obj, etc. But it can not export any of them, excepts its asset format file.
    So, in run-time current tool works with all meshes, but in editor only with Unity mesh .asset files.



    VacuumShaders - Facebook Twitter YouTube
     
  8. devravenio

    devravenio

    Joined:
    Jun 9, 2014
    Posts:
    11
    how is it on mobile?
    i didn't find any description about mobile performance.
     
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Tool calculates color adjustments using script per-vertex.
    It has no difference whether it is used on mobile or any other platform.
    Performance depends on device CPU speed and mesh vertex count.



    VacuumShaders - Facebook Twitter YouTube
     
  10. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    16
    How do I apply a change at runtime - with c#?
     
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Package includes example scene and the simple Runtime_Adjustments.cs script, check it.



    VacuumShaders - Facebook Twitter YouTube
     
  12. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    16
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    You should have used Mesh Materializer forum then. Seems color adjustments example scene has been lost during some of the update, just submitted new version for it (v1.67). Will be available in several hours.



    VacuumShaders - Facebook Twitter YouTube
     
  14. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    16
    ...just submitted new version for it (v1.67). Will be available in several hours.

    Great! Have tried the update and it was indeed very easy to adjust the colors. Thanks!
     
  15. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    393
    Hey
    Hey, does the shader support all types of lightmaps out of the box? (if not, will the source code be available?)
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Package includes Unlit, Unity Legacy and Physically Based shaders.
    Shaders are not compiled and can be modified for your needs.



    VacuumShaders - Facebook Twitter YouTube
     
  17. LilGames

    LilGames

    Joined:
    Mar 30, 2015
    Posts:
    565
    Does this package provide individual vertex color manipulation (as opposed to the entire mesh)?
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Editor tool modifies all mesh vertex colors.
    Run-time API works with color array, and it can be used to modify just one individual vertex color.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Aug 11, 2017
  19. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    Hello,

    At the start of this thread you mention that Unity can not export models except in .asset format and while that's true there are some plugins that allow to export models in obj and other formats. My question is if I used this tool to change colours and then later use one of the other plugins to export the MM model as obj, or other format. Would the color values be stored in that model at that point?

    Does a model have to be imported as part of an asset pack for the color adjustment information to remain? If I just import an FBX model then adjust the colors and save my scene, if I reopen unity will those colors still be applied or will the model look like it was before adjustment?

    Thank You,
    Regards.
     
    Last edited: Nov 12, 2017
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    First of all, there is no any MM mesh or model file types.

    Package includes Editor tool and Run-time API.

    Editor tool works only with Unity standard mesh file (it has .asset extension). Why?
    1) Unity mesh supports vertex color and it is part of the Unity engine.
    2) OBJ file does not support vertex color. In this case it is useless.
    3) FBX file is very closed system and expensive to implement. If this tool had included FBX file exporter then it's price would not be 10$.

    Run-time API works with any vertex color data.
    You can read vertex color from any mesh, adjust it (with included API) and save in any format you want (it's up to you).



    VacuumShaders - Facebook Twitter YouTube
     
  21. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    Thank You for the answers. I've purchased MM.
     
  22. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    Hi,

    I’ve been reading about color pallets and getting a harmonized color pallet throughout a game or subset of game models. In order to be able to do that though I need to know the hue/saturation/brightness of a model so I can adjust it with relation to others. These values always default to 0. Would it be possible to have the VCA display the actual hue/saturation/brightness values? I realize they're probably average anyways but it would be more telling than just 0. This way I could tell roughly where in the pallet the model falls into.

    Also where exactly is color replace feature?

    Regards,
    Tom
     
    Last edited: Nov 27, 2017
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Bookmarked for the next update.



    upload_2017-12-9_20-44-20.png



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Dec 11, 2017
  24. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    Hi,

    Great to hear. Thank You. Just wanted to add about the color info value, saturation, hue, etc. Would it be possible to have an eye dropper tool that could provide information about specific part of the model once it was colorized? I mean once you change the color and want to know a particular value of color on the model using this tool could provide this info. Like colour value in the eye dropper tool that unity has? Just thought I mention it, I think something like that would be really useful if person is trying to colorize different models and make them fit better together.

    Regards.
     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Unity engine already includes RGBToHSV and HSVToRGB methods, so no need to add same thing into this plugin.
    As for adding it to editor tool, I just do not understand what it must display/control? Editor tool adjust all vertex color inside mesh and not particular one.
    As for eye dropper, do not think it will be added.



    VacuumShaders - Facebook Twitter YouTube
     
  26. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    Unity does have the dropper tool , as you said. But if you’re adjusting colours the model reverts from adjusted colour to original unless the colour correction is applied/saved. This would mean the user would have to apply colour, check with dropper then go back to the plugin and do it all again if colour is not correct. Not the most efficient workflow, having to apply the colour each time.

    I’ll describe a use case that perhaps will illustrate how I would see the ideal workflow.
    - You have a bunch of green trees that you’ll be adjusting and you’re working with a pallet so the trees should be within a certain colour range. You start the plugin and select the trees that will be adjusted.
    - Let’s say that the plugin calculates the average colour value for all tree verticies and sets the hue, color etc. info in the plugin as the starting color, not 0s. This way you’ll know where in the pallet the trees are falling into.
    - Now consider a single tree being bigger than others, and you want to use it as an element that will tie the trees with some other models, eg. ground plane. Selecting something like a colour anchor (a vertex on the big tree)would display the color value of that vertex. Now, adjusting the color values of all the trees would update the vertex colour info of the vertex that was selected, representing the colour of the big tree.
    - Once the colour is decided upon, user would apply it to the model.

    Not sure if there would be demand for this functionality by others but I would find it useful in adjusting colours of elements to tie them together using a pallet. Thoughts?
     
    Arkhivrag likes this.
  27. scotih

    scotih

    Joined:
    May 1, 2018
    Posts:
    2
    @Arkhivrag the bundled version of vertex color adjustments in the mesh tool does not have the color replace option
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Update comes tomorrow.



    VacuumShaders - Facebook Twitter YouTube
     
  29. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Hey there ! Does this package still work in 2019 and 2020 Unity ? There hasn't been an update for long...
    Also how do the changes to the meshes get saved ?
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    It works with Unity 2019 and 2020.
    Editor tool saves adjusted vertex colors in the same mesh .asset file.
    Run-time API returns result as Color[ ].
     
  31. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Thanks for the super quick response !
    Can you tell me what maybe disadvantages of using meshes saved as .asset file? Or point me towards some documentation / insightful blog post / etc. ?

    I couldn't really find much information about that, but all i know is that once a mesh is saved in an .asset file, it loses its import options dialog. And when the artists exports their model again it overwrites the original fbx import instead of the .asset obviously (which is not so optimal for workflow).

    But i wonder if there are more technical details that i should know about. We are developing for mobile VR which is why i am concerned that the .asset file format might not be as optimized for performance or has some other obscure culprit.

    Would it be possible to extend the tool, so it uses the unity fbx export package and simply overwrite the original .fbx file?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    .asset format is Unity native mesh file format and it has no performance problems (as I know). No mesh data is loose when saving mesh in .asset format and no other files are overwritten. Yes, it has no import settings window.
    This file format is chosen as it is Unity's built-in format and supports all mesh features, including vertex colors, that is not available in OBJ format.
    As for FBX, it is not free or open source format and I'm not sure Unity's plugin supports its fully and is bug free.