Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Channel Packer - Pack your maps in a texture's image channels

Discussion in 'Assets and Asset Store' started by StevenP94, Feb 12, 2017.

  1. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Version 0.85 was submitted to Asset Store and should be available in few days.
    Changelog:
    version 0.85:
    - Added a toggle to manage textures marked as Normal Map.
    version 0.84:
    - Fixed Typo on interface.
    - Increased compatibility to allow working with unity from version 5.0.0 onward.
     
  2. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @StevenP94

    I come from the thread of MegaSplat. You answered me a question yesterday and wanted to inform me about your tool since I am interested in it.
    I said "I developed a little utility to pack textures in the various format used by Megasplat". Also in the normsao format?

    Sorry for my ignorance of all this, but it's new to me since I'm a programmer.

    Another thing I have seen a little your manual but for people like me, who does not understand English well, some video tutorials would come ...

    regards
     
  3. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Hi @ftejada
    The Channel Packer can pack textures in all format used by MegaSplat:
    - Standard: Albedo/Diffuse RGB + Height Map
    - MSEO: Metallic + Smoothness + Emission + Ambient Occlusion
    - NSO: Normal + Smoothness + Ambient Occlusion (also called normsao or nsao)
    - NSM: Normal + Smoothness + Metallic

    The tool is very simple and intuitive to use. I understand that a video tutorial could be nice, but I don't speak english well so I have some problem to make a video and give explanations.

    Regards.

    Stefano
     
    ftejada likes this.
  4. Goodgulf

    Goodgulf

    Joined:
    Jan 12, 2016
    Posts:
    59
    Hi Stefana and @ftejada perhaps this tutorial I have been working on for a few weeks and uploaded a minute ago may help. I used Channel Packer (excellent value for money!) to create MegaSplat textures:
     
  5. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Thanks a lot for sharing the video ;)
     
    Goodgulf likes this.
  6. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks a lot.
     
    Goodgulf likes this.
  7. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    I've been using your tool over the past few days to create my MegaSplat textures, and just wanted to provide some feedback (and bug reports).

    Firstly, the tool does work well - it's a lot quicker and easier than using Photoshop. Now for the bug reports :)

    - Yesterday, all textures I created had some odd banding across them, across all channels. I can't reproduce the problem, and it only started after I had generated lots of textures. The banding was not the same on every texture.
    - If you type an output path that doesn't exist and try to generate textures, the tool will hang. I needed to kill & restart Unity.
    - It would be nice if it remembered any changes you made to the Output Texture Suffix or the filename selectors. I found myself switching from Standard to NSO a lot, and eventually just changed the code to match my textures' naming.
    - If I drag in loads of files containing, for example, Albedo, Height, Normal, Smoothness & AO, I should be able to switch the packing mode from Standard to NSO and generate the next set of textures. This doesn't work. After the packing mode is changed I need to clear and re-add the textures.
    - A button to clear all textures would be convenient.
    - Maybe an option for an additional suffix for different output sizes would be good. For example, I want to add "_4k" when setting the output size to 4096.

    That's about all - keep up the good work!
     
  8. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    One more for you ;) I just got this error when processing some Standard textures.

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[holoGames.ChannelPacker.SelectedTexture].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    holoGames.ChannelPacker.CpUtils.DoBatchCombine (holoGames.ChannelPacker.CpRecipe recipe, Int32 textureSize, System.String pbTitle, Int32 textureIndex, Int32 maxStep, Int32 maxOut) (at Assets/ChannelPacker/Editor/CpUtils.cs:78)
    holoGames.ChannelPacker.CpUtils.DoBatchPacking (holoGames.ChannelPacker.CpRecipe recipe, Int32 textureSize, Int32 outputType) (at Assets/ChannelPacker/Editor/CpUtils.cs:35)
    holoGames.ChannelPacker.CpInterface.DrawBatchInterface () (at Assets/ChannelPacker/Editor/CpInterface.cs:285)
    holoGames.ChannelPacker.CpInterface.DrawModeSelection () (at Assets/ChannelPacker/Editor/CpInterface.cs:474)
    holoGames.ChannelPacker.CpInterface.OnGUI () (at Assets/ChannelPacker/Editor/CpInterface.cs:126)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  9. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    hi @SyGem
    I'll take a look on all your suggestions and bugs report.
    Can you please specify some other info on your system like unity version, o.s., etc. ?
    For the banding problem it will be hard without reproducible steps. For all other problems you found, I'm working to solve them.
    Thanks for your report.
     
    SyGem likes this.
  10. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    Sure - I'm using Unity 5.6.0f3 on Windows 10, DirectX11. The banding problem has occurred twice now, but I still can't reproduce it :(. Once it starts happening it seems to affect all created textures until Unity is restarted.
     
  11. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    This can happens only during batch processing mode if some texture is missing in one or more channel.
    This will be fixed in the next version that is coming soon.
     
  12. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Version 0.86 development log:
    - Fixed Argument out of range error when starting a batch processing and some texture is missing in one or more channels.
    - Added output path check for non existent folders and ask for create a new one.
    - Now when you change the packing mode and then return to a previous one, all related parameters are recovered.
    - Forced reapply of file selectors when changing packing mode.

    Still to do before release:
    - Add a button to clear all textures dropped in (batch mode)
    - Add another suffix for resolution as suggested (still evaluating if really needed)
     
    ftejada likes this.
  13. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Version 0.86 was submitted to Asset Store and should be available in few days.

    Changelog:

    version 0.86:
    - Fixed Argument out of range error when starting a batch processing and some texture is missing in one or more channels.
    - Output path: Added a check for missing path. If the specified path is not found, Channel Packer asks to create it.
    - Changing packing mode and then returning to a previous one recovers all parameters.
    - Batch mode: Changing packing mode now force file selectors application.
    - Batch Mode: Added the Clear Worklist button to remove all textures from the Worklist itself.
     
    wood333 and ftejada like this.
  14. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    Just purchased and am pleased with the product. Would it be possible to add a option in the batch mode for Albedos without a post fix? I have a pretty large texture pack but all the albedos have no special name so I still have to batch this one at a time.

    Also I'm have a "Index Out Of Range" Exception problem on batching files.

    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. holoGames.ChannelPacker.CpTargaSave.EncodeRle (System.Byte[] buffer, UnityEngine.Color32[] pixels, Int32 width) (at Assets/ChannelPacker/Editor/CpTargaSave.cs:266)
    3. holoGames.ChannelPacker.CpTargaSave.EncodeToTGA (UnityEngine.Texture2D image, Nullable`1 forceEncoding) (at Assets/ChannelPacker/Editor/CpTargaSave.cs:91)
    4. holoGames.ChannelPacker.CpUtils.DoBatchPacking (holoGames.ChannelPacker.CpRecipe recipe, Int32 textureSize, Int32 outputType) (at Assets/ChannelPacker/Editor/CpUtils.cs:48)
    5. holoGames.ChannelPacker.CpInterface.DrawBatchInterface () (at Assets/ChannelPacker/Editor/CpInterface.cs:285)
    6. holoGames.ChannelPacker.CpInterface.DrawModeSelection () (at Assets/ChannelPacker/Editor/CpInterface.cs:474)
    7. holoGames.ChannelPacker.CpInterface.OnGUI () (at Assets/ChannelPacker/Editor/CpInterface.cs:126)
    8. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    9. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    11. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    12. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
    13. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
    14. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:232)
    15.  
     
    Last edited: Jul 6, 2017
  15. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Hi, thanks for purchasing Channel Packer.
    Can you please explain better the Albedos option you need ?

    About error: are you using latest version of Channel Packer ? Which Unity version ? Can you give me more info to reproduce the problem ?

    Regards
     
  16. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    Whoops completely missed your response, sorry for the delay!

    I modified some of the code for a quick workaround ,just threw in some extra out of range checks and made some loops break if something went out and it seemed to work fine after. Unfortunately I re-imported the asset to get the exact error but now can't seem to reproduce the problem and I forgot what changes I made. If I come across it again I'll make sure to send it to you before tampering with stuff haha.

    As for the Albedos... I am using channel packer to pack for Megasplat in the NormalSO option, and I am packing these texture packs: https://www.assetstore.unity3d.com/en/#!/content/29432 and https://www.assetstore.unity3d.com/en/#!/content/32868 .

    The problem is the authors naming convention. example, Ground_N = normal and Ground_H = height. This is fine until the albedo texture which is just named Ground with no "_diff" or "_Albedo" or any type of post fix label. So what ends up happening is I throw all the textures in both packs into the batch mode list (albedo, normal, smooth, ao and height) and batch the Normal textures. Then after I switched the setting to albedo to pack them.Problem is I am unable to have the albedo's automatically selected for batching because they have no defining label. If I try to set the selector to blank or "**" then every texture in the batch list gets selected as a diffuse. I ended up having sort through all the 200+ textures and add a "_diff" to each albedo texture to make it selectable. It would be nice to have some sort of way to have a texture type be selected if it has no label as well. Maybe a toggle "Has No Selector", so every texture that does not have a "_somethingSomthing" format at the end of its name gets selected.
     
    Last edited: Jul 11, 2017
  17. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Ok, I'm thinking about the 'no selector' option and looking for a workaround.
    Regarding the out of bounds, I see from your errorlog that it comes from the RLE encoding inside the 'save as targa compressed' code. This is weird and maybe depends from the texture too. I think that to reproduce that error I need the exact textures and params you used. So maybe is better to wait and see if it comes up again.
     
    wmpunk likes this.
  18. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Just submitted version 0.90 of Channel Packer that introduce a new tag (available when in batch mode) to put all unselected textures in a channel.
    Please delete the previous version before upgrade!
     
    wmpunk likes this.
  19. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    Awsome thank you!
     
  20. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @StevenP94 !!!

    I am generating Standard Packed Textures with your asset. I add albedo and height. Within of the "Input channel selection" , active height the box "Alpha"
    The problem I encounter is that alpha channel data is not stored when the texture is generated

    what am I doing wrong? Has anyone reported a similar problem?

    I am looking forward to your response. a greeting
     
  21. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    @ftejada Hello, your height image appears grey ? If so, just use the default setting (use red channel as input for the height) and all should be fine.
    If I understood your problem, you are using the Alpha channel of the height map to generate the standard output and probably the Alpha of the source map is empty.
    Let me know if it works.

    Cheers ;)
     
    ftejada likes this.
  22. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks for the reply !!

    Yes. This solves the problem.

    Another question ... What do you mean when you asked me if the color of my heimap is gray?
    I have seen in this videotutorial that the person drags smoothness to Height and the "Input Channel selection" puts it in Alpha.


    I'm a bit confused as to how the texture is generated correctly. And in what cases should I do what the boy does in the video or when what you indicate me.

    I have looked at the manual but that is not explained, (or I have not seen it).
    I use MegaSplat and I bought your asset when you advised me on a message from the MegaSplat forum ...

    We would appreciate some tutorial or manual with more detailed explanations ...

    Anyway I think your assets are very good, but if I do not know what I should do I can not get the best results.

    a greeting
     
  23. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Hello, I'm glad that you have solved your problem.
    I'll try to explain further how channel packing works:
    We can use Standard Mode as example. In this mode the output map will contains Diffuse + Heigh, Diffuse in RGB channels and Heigh in A channel. To obtain this we need to have 2 maps used as sources: A Diffuse map and a Heigh map. Now both input maps have RGBA channels so we have 8 input channels to be mapped into 4 ouput channels; to do that we must choose channels to be used as input. Taking the RGB from Diffuse map (the grass in the video tutorial) and the R channel from the Heigh map is what the default settings do in the Channel packer. Channel Packer uses the R because, if the heigh map appears in black and white, this means that all the RGB channel have the same values and Channel Packer can use the R, G or B without problems. In the video tutorial, he use the A channel because probably his source image has already the height packed in the Alpha channel. The input channel selectors are provided in the Channel Packer mainly for this.
    I hope this will help you to obtain the best from the asset.
    Greetings.

    Stefano
     
    ftejada likes this.
  24. deuxieme

    deuxieme

    Joined:
    Jul 15, 2015
    Posts:
    19
    Hey, what kind of shaders are people using with this asset? I would like to learn about channel packing but I'm not that aware of what shaders are capable of using different RGBA channels. Any info on where to start learning about this?
     
  25. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @StevenP94 !!!! ChannelPacker works with HDRP ??? I say this to create the textures of "Mask Map" where the color red would be Metallic Map, green -> AO Map, blue -> Detail Map Mask and Alpha -> Smoothness Map

    If you can not do this now, do you plan to add an update for this ???

    regards
     
  26. perholmes

    perholmes

    Joined:
    Dec 29, 2017
    Posts:
    295
    Hi,

    I don't know if this tool is end of development, but if it isn't, let me say that it's the nicest channel packer out there. The batch mode is indispensable when dealing with thousands of textures.

    I have four feature requests, that are just more automation. I think it would make a better tool, but please let me know if the tool is end of development, and I'll take some time to make the changes at least to my own copy.

    1.) It would be great if the found part of the filename is removed. For example, if albedo files end with "_albedo", and height files end with "_displacement", and I'm giving the files the suffix "_rgbh", the final filename becomes "_albedo_rgbh". Since this is now a packed file, keeping the "albedo" part of the original name makes much less sense. It would be great to just be able to cleanly name the new files.

    2.) It would be awesome to be able to process both RGBH and MSEO in one go. That's probably the hardest ask, since it requires UI accommodation, so I understand if you don't want to. But again, doing this on thousands of textures, the manual labor adds up.

    3.) It would be great to be able to straight-up copy normal files directly to the output directory. The goal is for all the packed files to end up in the packed directory. This gets you closer to the final result without having to spend any brain power and human error on it. You can sense that I'm after one-click processing of a whole directory.

    4.) Presets would be great.

    Anyway, thumbs up for the batch mode, it's kind of the only game in town. The above suggestions are for even more automation.

    Thanks,

    Per
     
    hopeful likes this.
  27. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    44
  28. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Hi, sorry for the late reply.
    We had some problems but the project is still alive, so a new, updated version is coming. Thanks for all your support.
     
    ftejada and hopeful like this.