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

Substance Bitmap2Material

Discussion in 'General Discussion' started by Liatti, Aug 2, 2011.

  1. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    1. You can use GetPixels32 on the ProceduralTexture and then copy these pixels using SetPixels in a new Texture2D to write it down as a PNG.
    There is a good example of that in the package I posted here.

    2. I don't think you can save a runtime created B2M instance. You can however instantiate them offline through the inspector. You could probably create an editor script that takes parameter values from a B2M and copy them onto the others.

    3. There is no command line for the player, but you can save your parameter set using the "Presets" button and then apply them on other textures to semi-automate the process.
     
  2. themipper

    themipper

    Joined:
    Jun 1, 2012
    Posts:
    8
    Hello Jerc,

    thank you for answering.

    You pointed me in the right direction. I already read that ProceduralTextures should have a GetPixels32 method. But I couldn't use it in code, because the compiler was refusing it. As it turns out my Unity was stuck in version 4.0 and was convinced to be up to date :-(. ProceduralTexture.GetPixels32 was introduced with Unity 4.1 so no wonder I couldn't use it.

    After updating to 4.1 I have a GetPixels32 method and it works like a charm. The only thing you have to change in B2M is set the output texture format to RAW. Otherwise GetPixels32 will be all black.

    By the way your Terrain Tool doesn't use GetPixels32. It works with a RenderTexture.

    Then I will have to create instances at level load, copy the presets into them and set the according diffuse textures.

    After getting 1) to work this is fine :)

    Thx
    themipper
     
  3. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    My original terrain script was using RTT indeed but the latest version I posted in the thread has been updated for 4.1 with the GetPixels function, making it Unity Free compliant :)
     
  4. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Hi I was trying yesterday the lite version before purchasing and every now and then Unity crashed completely giving me a "GetThreadContext failed". I'm still in Unity 4.0.1. This happened in a very simple proyect, just a skybox, Bitmap2material lite (imported from the asset store) and two spheres to play with the tool. Any hints?

    Another question, we are a small studio of three people: 1 artist, 2 programmers. I understand from your website that we can install it in two computers with once license. But, what we would like to do is give it to the artist so he uses it in Maya and we just use the models as they come from him with the materials (Bitmap2material) already created. Do we need to have more than one license for this? The artist sends us all the models and textures via ftp and between both programmers we work on the proyect using SVN.
     
  5. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    I have a question about the compression for mobile. I have ETC selected in my build settings but the substance textures are being saved in DXT5. Will that be an issue on devices that don't support DXT??

    Thanks,
     
  6. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    @Stilghar You will only need one license in this case. About the bug, I never heard of that error before, are you sure it is caused by b2m ?

    @Crazy Robot Yes don't worry about it, when you will build your project, it will compress the substances using the right compression format.
     
  7. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Well, I only get the error when playing with the inspector of Bitmap2Material. I will give it another go this afternoon and report back. I'll update to the latest version of Unity to see if that's the problem.

    Also there's nothing else in the project. Just an empty project, Bitmpat2Material and a some texture images that I use on a couple of spheres.

    Regarding the workflow with a single license how that will be? Will our artist need to export the normal and specular maps as textures for us or we can all work with bitmap2material and therefore save also on space?
     
  8. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    You can all use B2M, as it will be part of the assets in the game repository.
     
  9. Stilghar

    Stilghar

    Joined:
    Feb 4, 2013
    Posts:
    82
    Yesterday I updated to the last version of Unity, I also went through a whole lot of Windows Updates that I had been postponing far too long. After that and graphics drivers updates I can say that the issue is gone.

    Our artist is checking out the trial version at the moment if he likes (which I assume will be the case) you'll have another sale pretty soon. :D

    Thanks for the help!
     
  10. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    I recently purchased B2M 2.1 from the asset store, and it works wonderfully overall (very good results aesthetically). However, when I set a platform override for substance materials for "standalone player" while leaving them at the default for the main platform for my current project (mobile), the standalone texture resolution targets are not being applied (example 256x256 as "default", and standalone override target resolution is set to 1024x1024 under the substance material itself, but it still renders at 256x256 once built to a standalone player). It is indeed switching it properly inside of the editor when I switch platforms to standalone, so it's just an issue with the built standalone. How can I fix this?

    I'm probably missing something fairly simple here, but I've spent a couple of hours trying to figure it out already and figure it would be quicker to ask than continuing to fail at google-fu. This is under both Unity 4.1.0 and 4.1.1. Thanks in advance for any help.

    Quick edit just to add, I am using the "mobile" substance as the base, and each sub-material has the settings set inside of it, for both builds (mobile and standalone).

    Second edit to add as well, that often after loading Unity, the first time I press "play" in the editor is resulting in every object in the scene receiving one substance sub-material (which seems to have been random the first time ever and always is the same now). This fixes itself if I just tick "generate all maps" on any submaterial on then off once, until I re-load the editor. It also does not appear to affect builds at all after I have done this on a given load of the Unity editor. While it's a minor annoyance, I am curious why it's happening.
     
    Last edited: Mar 23, 2013
  11. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    BUG??

    So, I'm using B2M Mobile with 14 different substances. I created each one by hitting the "Add substance from prototype" button.

    After I close Unity and then bring it back up, all of my generated textures are wrong. All of the textures I assigned under the "Bitmap Diffuse" are correct, but the textures that each substance is generating is based off of another texture that I assigned under a different substance.

    This is not useable like this.
     
    Last edited: Mar 24, 2013
  12. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377

    That sounds like the second issue I had a question about in my post here (I am able to work around it by simply clicking "generate all textures" then unchecking it right away, which causes all substances to refresh seemingly and it works fine from there). I also am having trouble getting it to regard my "standalone" per-platform target sizes... they work fine in the editor, but build out at the mobile size when I build as PC standalone despite having set the target sizes much higher as a platform override in the materials.
     
  13. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hmm.. I have not tried to build for standalone yet. But I have noticed that when I build it for mobile and run it, it sometimes acts flakey. I have to do more builds to really pinpoint what's happing.


    I closed Unity and reopened it and it seems to be ok now. I'll have to keep an eye on it.
     
  14. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    My issues have been persistent unfortunately.
     
  15. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
    So, with B2M 2.1 on Unity 3.5 Android all the maps still get generated during compile time right? Upgrade to 4 would be necessary to generate them at runtime on mobile?
     
  16. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes, mobile is only supported starting with 4.1.
     
  17. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    Any suggestions on how to fix the problem I am seeing with standalone texture size override above?
     
  18. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    I,ve just purchased B2M 2.1 and when imported into Unity 4.1.5f1 i get this error ..

    Assets/B2M_2.1/Script/BatchApplySubstance.cs(26,33): warning CS0618: `UnityEditor.EditorGUI.ObjectField(UnityEngine.Rect, string, UnityEngine.Object, System.Type)' is obsolete:

    Can someone please tell me how to correct this .. Thank you.
     
  19. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    That's a utility script that can be deleted if you don't like the error and never plan to apply substances in a batch. Otherwise, it won't cause problems if you leave it there.

    I've also experienced Crazy Robot's bug and have mentioned as much in the "Substance answers" thread. It's quite annoying.
     
  20. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Thanks for that ..
     
  21. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi, I have another question, I'm working in Unity Pro 4.1.5f1 in a mobile project, I have a model with 3 moving parts, each share the same material so it costs 3 draw calls, if I then delete the material and make a B2M material with the Bitmap2Material_2_RealTimeMobile.sbsar and apply it to the 3 parts of the model the draw call goes up by 3.

    Can someone please tell me why.

    Thank you.
     
  22. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Oh my goodness this is the worst asset EVER!!!

    I started working on an older project that I had created over 20 materials using B2M Mobile. So, I noticed an update to B2M 2.1.1, so I updated the asset and BANG.... all of my materials are GONE!!!!

    Not cool at all.
     
  23. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Crazy Robot, I've never experienced loss of materials, just more draw calls.
     
  24. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Anyone know what these mean ??

    m_ThreadedObjectActivationQueue.empty()

    ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()

    I get these errors when using the Bitmap2Material_2_RealTimeMobile.sbsar on a model with other shaders that I swap at runtime.
     
  25. ChadH

    ChadH

    Joined:
    Aug 28, 2012
    Posts:
    101
    I am sure that you had a backup of your project, so all is not "lost", but VERY unfortunate indeed that this happened to you :(
     
  26. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    So this happened to me too. I lost all my substances and their assignments after upgrading to 2.1.2. Thankfully I had a recent backup, but, you know, how do I upgrade?
     
    Last edited: Jul 19, 2013
  27. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    I have no idea how to upgrade without losing everything. It's a broken system, I'm not happy with it at all.
     
  28. EricBatut

    EricBatut

    Joined:
    Feb 14, 2012
    Posts:
    8
    Hi

    I'm the Allegorithmic developer working on the Unity integration, and I've been trying to reproduce the error messages below, unsuccessfully :(
    If this still happens with Unity 4.2.0 (recently released), would you mind sharing a small repro project that exhibits this issue ?

    Thanks in advance !
    Eric

     
  29. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi Eric,

    I've just upgraded to Unity Pro 4.2.0f4 and now only get this error -

    m_ThreadedObjectActivationQueue.empty() m_ThreadedObjectActivationMap.empty()

    Also take a look here
     
    Last edited: Jul 28, 2013
  30. EricBatut

    EricBatut

    Joined:
    Feb 14, 2012
    Posts:
    8
    Hmmm, unfortunately I cannot reproduce this warning message locally...

    Is there any chance you could send me a tiny repro case that I could test this with ?

    Also, what hapens if you set your substance materials to "Generate all outputs", so that we know in advance that all output maps are available, regardless of the shader that is attached to the Substance, does the warning go away?

    Thanks in advance!
    Eric
     
  31. Jeremy-Hindle

    Jeremy-Hindle

    Joined:
    Oct 27, 2012
    Posts:
    8
    I'm also having this issue.
     
  32. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    I like the idea of Bitmap2Material, but the latest reviews in the store are not very encouraging. It looks like the latest update was half a year ago, well before Unity 4.3 was released, and it wasn't even working well then according to reports. Is there somebody looking at these crash bugs people mention? It's not $150 nice if it's going to be sheer hell to use.
     
  33. DaneC020

    DaneC020

    Joined:
    Mar 19, 2010
    Posts:
    191
    I wouldn't recommend buying it seeing how their next update will probably required you to rebuy it. I bought it than a month later the "new version" came out and you have to pay an upgrade fee. On top of that the results weren't the greatest... I can't comment too much about it since I am running the new unity and had to drop it months ago make sure my project could continue without issues. I also don't like being stuck with having to pay update fees for a plug-in, so much for feeling secure with buying a plug-in from a known company.

    -Dane
     
  34. Deleted User

    Deleted User

    Guest

    Hm, this thread seems pretty dead. Hopefully someone will reply...

    I am trying to use B2M with Skyshop. Unfortunately, Skyshop doesn't use the typical Diffuse (RGB) Gloss (A) but instead Diffuse (RGB) Alpha (A) and Specular (RGB) Gloss(A). How do I setup the generated outputs so that they fill the correct channels? I guess that under the "Generated Outputs" I have to select the right channels from the drop down list which includes:

    Source (A)
    Diffuse (A)
    Normal (A)
    Height (A)
    Emissive (A)
    Specular (A)
    Opacity (A)

    Honestly, I never really figured out what is meant with "Source (A)" and why this list only let's one choose the (A) channel, but not (R) (G) and (B). Can someone explain this list to me and how to properly use it?

    Thank you very much for any help!! :)

    Sean
     
    Last edited by a moderator: Feb 3, 2014
  35. rashid

    rashid

    Joined:
    May 14, 2013
    Posts:
    3
    Hi, Its almost a year and there's no B2M update for working in Unity 4.3 and above. Seems like we need to have a dedicated machine running Unity 4.1 just for using B2M 2.1 and export textures from it to work in Unity3d 4.3 with another shader.
    As most comments on it would be suggesting i already admit that I think its my fault that i have updated to Unity 4.3.

    I will be very careful in buying anything from Allegorithmic next time.
     
  36. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    What is it that's not working? I'm exporting textures fine using 4.3.4

    Also, you can run multiple version of Unity on the same machine, so you don't need a dedicated machine.
     
  37. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi,

    I've got the latest version of B2M, 2.1, and Unity 4.3.4f1, I'm using it on mobile so using "Bitmap2Material_2_RealTimeMobile"

    My problem is sometimes it works sometimes it don't, the church walls in the picture below work and look good in game, but the arch using the same "Bitmap2Material_2_RealTimeMobile" does not work or show relief, in the inspector it looks fine, setting the same as the church walls, but just looks flat, I've tried all the setting but still no luck, anyone know why this would happen?

    Cheers.

    $Pic_01.jpg
    $Pic_03.jpg
    $Pic_02.jpg
     
  38. mindlube

    mindlube

    Joined:
    Oct 3, 2008
    Posts:
    993
    I would check the shader selection on the arch and make sure it's set to mobile/bumped specular!
     
  39. mindlube

    mindlube

    Joined:
    Oct 3, 2008
    Posts:
    993
    Hi all, I have a question about optimization. I have a field of ProceduralMaterial[] in a script. This is like a texture switcher. So only 1 is being rendered any one time. Is b2m going to generate and load all of the bitmaps at startup? Or only the 1 that is being displayed currently? See attached for what my inspector view looks like (all the slots would be filled with other procedural materials). I want to make sure I'm not wasting memory usage if this is something that should be done via loading from Resources/ or something, rather than how I'm doing it.

    public void UpdateMaterial (int index, bool regenerate=false)

    {

    var checkedIndex = Mathf.Clamp(index, 0, materials.Length -1);

    var substance = materials[ checkedIndex ];

    renderer.sharedMaterial = substance;


    if(regenerate)

    {

    var seed = (float)Random.Range(0, int.MaxValue);

    substance.SetProceduralFloat("$randomseed", seed);

    substance.ClearCache();

    substance.RebuildTexturesImmediately();

    }

    }
     

    Attached Files:

    • b2m.jpg
      b2m.jpg
      File size:
      27.8 KB
      Views:
      886
  40. Corymach7

    Corymach7

    Joined:
    Jun 22, 2014
    Posts:
    3
    Is it possible to add in a basketball court as terrain?
     
  41. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  42. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I had to buy the Second One in The store also i bought the first one there too.
    So now i should buy it a Third time i think :(
     
  43. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I hope they will offer an upgrade discount via official website store.

    I hope to have some feedback here from Allegorithmic guys! :)
     
  44. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    The upgrade from the Indie Pack is possible. :cool:
     
  45. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    Hi, when I press play I get the substance watermark on my materials, they export without the watermark from b2m , there is no watermark in the scene window, only when I press play does the watermark appear? Where am I going wrong please?