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

► Texture Adjustments ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, May 20, 2015.

  1. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Hey. Using 2018.3.0f2 in a Mac I'm getting...

    Code (CSharp):
    1. [Warning] Unable to find style 'TL SelectionButtonName' in skin 'DarkSkin' Layout
    2. VacuumShaders.TextureAdjustments.TextureAdjustments_Resources..cctor()
    3.  
    4. TextureAdjustments_EditorWindow.Load_Resources()
    5.  
    6. TextureAdjustments_EditorWindow.OnGUI()
    7.  
    8. GUIUtility.ProcessEvent()
    9.  
    and

    Code (CSharp):
    1. [Warning] Unable to find style 'TL SelectionButton' in skin 'DarkSkin' Layout
    2. TextureAdjustments_Resources.GetGUIStyleIncludeChannelOn()
    3.  
    4. TextureAdjustments_EditorWindow.DrawIncludeChannel()
    5.  
    6. TextureAdjustments_EditorWindow.Draw_ColorOverlay()
    7.  
    8. TextureAdjustments_EditorWindow.Draw_Adjustments()
    9.  
    10. TextureAdjustments_EditorWindow.OnGUI()
    11.  
    12. GUIUtility.ProcessEvent()
    13.  
     
  2. Arkhivrag

    Arkhivrag

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



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    transat likes this.
  3. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Is there an easy (one click) way to compare the currently adjusted texture with the original? A before/after slider would be even better, if you could consider adding that. :)
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Already added in the coming update.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    transat likes this.
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    New update v2019.1 is now available:

    Texture_bombing.gif
    upload_2019-1-3_12-46-46.png


    Improved:
    -----------------------------------------------
    • Compatible with Unity 2018.3
    • Inside editor it is possible to compare original and generated adjusted textures with mouse move slider (hold Left Control inside texture preview area)
    • All procedural generators support mask and per-channel blend
    • Improved Channel Swap
    • Added Hue, Saturation, Color and Luminosity blend modes to Color Overlay
    • Reduced shader keywords
    • From Editor window tools menu can be created new empty texture with any resolution and fill color
    • Various other improvements and bug fixes


    Compare.gif



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    jGate99, Duffer123 and transat like this.
  6. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Arkhivrag ,

    This may have been asked before, but could I use this Asset in Runtime to change specific colours (within a threshold) in (icon) Sprites and on 3D Models?
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Yes, in editor and runtime.




    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    Duffer123 likes this.
  8. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Arkhivrag ,

    Thanks for responding so quickly.

    For Sprites and Meshes in Runtime?

    Presumably, in Runtime, the original asset (texture, sprite) is left as-is but the runtime version in the Sprite or Mesh has a colour changed? Can it change more than one specific colour in runtime?

    Is there a manual or documents I could review before purchase?
     
    Last edited: Jan 4, 2019
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Editor tutorial:



    All editor tools work in run-time:




    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    Duffer123 likes this.
  10. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
  11. MrWolf

    MrWolf

    Joined:
    Jun 9, 2013
    Posts:
    11
    Is this asset mobile friendly (iOS / Android)?
     
  12. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    you have some plugin that loads images by bytes [] faster and without lag.
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    No.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  14. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    Hi @Arkhivrag,

    Loving the asset. Its helped me quite a bit in my projects.

    I have one question.

    I am trying to edge pad a 64bit rendertexture at run time (Its a depth map made from a shader). But the returned texture from Texture adjustments is 32 bit as far as I can tell. So it looses a lot of its colour range.
    Is there a way around this or am I missing something?
    If its not possible can anyone think of a way to edge pad a regular depth render texture? (As they don't have alpha channels)

    Cheers!
     
    Last edited: Sep 4, 2019
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    64bit texture - you mean 16bit per-channel.
    Texture Adjustments does not support 16bit channel textures, only regular 24bit and 32bit (8bit per-channel) textures.
    Bookmarked for the next update.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  16. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    Yep, thats what I meant (16bit channel textures).

    Thanks, good to know!
     
  17. helloworldgames

    helloworldgames

    Joined:
    Mar 16, 2017
    Posts:
    60
    It'd be really great if you can an alternate version that uses ShaderGraph.
    Thanks
     
  18. newgaze

    newgaze

    Joined:
    Oct 27, 2012
    Posts:
    13
    Hello!

    I stored the frames from the webcam to Texture2D Array.
    After adjusting the Brightness (Image Processing) of Texture2D,
    I will save Texture2D Array to mp4 video.

    If I use this asset, can I save the change of brightness in Runtime to Texture2D?
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Tool works in editor and run-time.
    But if you need to use it in every Update() method, take note - reading texture data from GPU into Texture2D object requires some processing time and you may have some delay depending on hardware and texture size.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  20. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    Hi, I am working on a Unity 5.66 project with a version of texture adjustments that is obviously a bit older, but I am only now really implementing it into the project (which is frozen in 5.66, no way of updating it to a newer one).
    I cannot get my head around how to pass a mask at runtime to i.e. an color overlay--

    In Editor you just drag a Texture into the slot and it works fine, but the Api for mask does not accept Texture2d --- How does the code look that assigns a new mask at runtime to an
    Adjust_ColorOverlay?

    Thanks for your time, awesome asset so far.
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Create Mask object:
    Code (CSharp):
    1. public Mask myMask = new Mask();

    Set its parameters:
    Code (CSharp):
    1. public bool isEnabled;
    2. public Texture texture;
    3. public Vector2 textureTiling;
    4. public Vector2 textureOffset;
    5. public TextureWrapMode textureWrapMode;
    6. public bool invert;
    7. public float strength;
    8. public MASK_CHANNEL channel;


    Pass it to adjustment mask property:
    Code (CSharp):
    1. colorOverlay.mask.Copy(myMask);
    or
    Code (CSharp):
    1. colorOverlay.mask = myMask;


    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  22. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    Great, Thanks for the mask code. That helps me very much:)
     
  23. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    I have applied the mask via script and basically it works. The mask is constructed and can be assigned to the color overlay.

    But for some reason it behaves differently from when I assign the mask and color overlay in the Non-Game Texture Adjustment window.

    In the regular dialogue (from the Unity Window menue) if the mask is applied in Color Overlay using a flat color red and the mask will see red wounds (Blood in this case) in red on the skin texture as wanted.

    In my in-game setup exposed on the component when I assign the exact same mask, even when not assigning it by script but in the component per drag and drop,
    the Color Overlay will only add white to the texture, not the red color. No matter what blend mode I choose, the color overlayed through the mask is always white.
    What am I overlooking here?
    The mask and texture when I try it in the non-game Inspector window is the same and there it works properly. All settings as far as I can tell are identical.
    I am using white images with black art for wounds, in Unity I make those to alpha via greyscale on import (I also tried using the cannnels, same problem), I invert the mask for proper usage in the Texture Adjustment. Nothing fancy. Textures are read/write. No Mipmaps for the masks

    Is that a known bug in the 5.66 version I use?

    When I do NOT use the mask but apply a red png file with transparency in the Color Overlay component it works as expected btw, so that could be my workaround.
    Just wondering why my masks won't work as expected.
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    You have to include all used adjustment shaders into build. The easiest way is selecting "gear" menu icon in component and choosing "Include Shader in Build".
    upload_2019-10-15_14-11-23.png



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  25. AdamKane

    AdamKane

    Joined:
    Dec 3, 2012
    Posts:
    134
    Hello,

    When I resize a normal map texture, it goes from purple to red (and looks funny in the material):



    Any ideas?

    Thanks,
    Adam
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Normal Map textures are not "common" textures, but encoded by Unity. You can check more info here:

    The RGB color values are used to store the X,Y,Z direction of the vector, with Z being “up” (contrary to Unity’s usual convention of using Y as “up”). In addition, the values in the texture are treated as having been halved, with 0.5 added. This allows vectors of all directions to be stored. Therefore to convert an RGB color to a vector direction, you must multiply by two, then subtract 1. For example, an RGB value of (0.5, 0.5, 1) or #8080FF in hex results in a vector of (0,0,1) which is “up” for the purposes of normal-mapping - and represents no change to the surface of the model. This is the color you see in the flat areas of the “example” normal map earlier on this page.




    Texture Adjustments does not "know" what type of Texture2D object it is working with, it just reads RGBA data stored there.
    In your case just change texture type to be Default inside texture import settings, do required adjustments and after saving it change type again to Normal Map.



    VacuumShaders - Facebook Twitter YouTube
     
  27. oldcloud

    oldcloud

    Joined:
    Apr 15, 2019
    Posts:
    6
    Can it support HDR files?
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Currently - no.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  29. Jayme65

    Jayme65

    Joined:
    Dec 11, 2016
    Posts:
    94
    Hi,
    Is it possible to do the inverse of 'Crop by Alpha"...so actually extending the canvas with an amount of transparent pixels? Thanks
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Currently no. Try to implement.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  31. KenneyWings

    KenneyWings

    Joined:
    Sep 29, 2016
    Posts:
    32
    Great asset, honestly fantastic! Small request; an oil paint/kuwahara filter.
     
    Arkhivrag likes this.
  32. Johny-Gull

    Johny-Gull

    Joined:
    Apr 22, 2014
    Posts:
    13
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Yes, you can.
    Package contains Channel Import adjustment. It allows importing individual channels from external texture.

    upload_2019-12-12_15-43-38.png



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
    Johny-Gull likes this.
  34. Mathijs333

    Mathijs333

    Joined:
    May 20, 2014
    Posts:
    15
    Hi!

    Great product, but I think I've found a bug :)

    On Android 4.x the LUT shader crashes and doesn't work at all. We are using Adjust_LUT.
    We are using the latest version (oct 2019?) and Unity 2019.2.14.
    It works from Android 5 and up without any problems.

    We have tested this on 2 devices with Android 4.4 (1 Samsung and 1 Lenovo). Both show an error on started of the app (see attachment). This error isn't there at Android 5 and above.

    Is this a bug indeed? Or are we doing something wrong?

    Regards,
    Mathijs.
     

    Attached Files:

  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Not bug but mobile GPU limitation. Seems LUT function is not supported on it.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  36. Mathijs333

    Mathijs333

    Joined:
    May 20, 2014
    Posts:
    15

    Hi! Thanks for your fast reply.

    If it is GPU based, my assumption that it had a relation to the ANdroid version is not correct.
    Is there a way finding out that those devices doesn't have support for LUT?

    If you use adjust_lut on those devices, simply nothing happens. It doesn't crash the app.
    So, excluding them from some features is ok as well, because they are old and only around 5% of the users, but then we need something to know if the shader is actively working or so. Have you got an idea how to achieve this?

    Mathijs.
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    LUT calculation requires device with Texture3D support. You can use SystemInfo.supports3DTextures method to check it.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  38. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,251
    Is this actually fixed? I have black texture on iOS, not sure how old my version is but only using runtime parts
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Just fixed some problems for iOS. Download new update 2019.5.
    To make sure you are using the latest version: Remove plugin from the project, clear Asset Store cache folder and then re-download package from the store.


    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 24, 2020
  40. oldcloud

    oldcloud

    Joined:
    Apr 15, 2019
    Posts:
    6
    Can it support 16-bit channels?
     
  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Currently no.
    8 bit per channel in PNG, JPG and TGA formats.



    Amazing Assets - YouTube Facebook Twitter
     
  42. oldcloud

    oldcloud

    Joined:
    Apr 15, 2019
    Posts:
    6
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    It would require to rewrite plugin entirely as it is designed and optimized for regular textures and not HDR images.
    Currently not planed. Added to a wishlist.



    Amazing Assets - YouTube Facebook Twitter
     
  44. Jayme65

    Jayme65

    Joined:
    Dec 11, 2016
    Posts:
    94
    Would it be possible to have a 'Average Color' filter, like in Photoshop?
    I have planes with images..and I would like their background to be the average color of the top image.

    Or maybe simply use 'CellSize' at its maximum or even maybe Resize to 1px? (would it achieve the same result?)
     
    Last edited: Apr 16, 2020
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Yes. Update will be tomorrow.



    Amazing Assets - YouTube Facebook Twitter
     
  46. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    Hey @Arkhivrag ,

    I just checked the forums and read this reply to a similar question I asked earlier. Is it the case that 16bit per channel support is not planned anymore?
    The last time I asked you implied you were going to work on it for the next update. If it's not possible without a complete rewrite I understand, just double-checking so I can find another solution (I needed the 16bit per channel edge padding to pad a depth pass).

    Cheers! still a great asset either way.
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Unfortunately 16 bit textures currently are not supported.



    Amazing Assets - YouTube Facebook Twitter
     
  48. HotButton

    HotButton

    Joined:
    Feb 19, 2018
    Posts:
    4
    Hi, love the plugin. I'm having some trouble getting the cropByAlpha to work on Android. I'm calling it in OnPostRender, and it seems to run through the process just fine, but isn't cropping the alpha like it does in the editor. Am I doing something wrong?
     
  49. HotButton

    HotButton

    Joined:
    Feb 19, 2018
    Posts:
    4
    Couple more supporting details...
    Resize works great. Crop doesn't seem to be working at all on Android (Alpha, rectangle). That's the first filter I'm passing it through, and then resizing the result afterwards which is working as I said.
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Some more info will be helpful for me to reconstruct issue at my side:
    1) Unity version?
    2) Color space?
    3) Are adjustments calculated one by one using Apply or all at once using RenderAll methods?
    4) What is initial and final texture types: Texture2D or RenderTexture?
    5) Did you try using CropByAlpha outside of OnPostRender method, for example in Start method?



    Amazing Assets - YouTube Facebook Twitter