Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Substance answers !

Discussion in 'General Discussion' started by Jerc, Apr 20, 2011.

  1. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    You can't for now, however, we added a function to grab the pixels from an output allowing you to save it or converting it to a Texture2D easily in our internal builds, and it will hopefully be pushed in time for 4.0.
     
  2. Clement_Shimizu

    Clement_Shimizu

    Joined:
    Apr 13, 2011
    Posts:
    22
    I am trying to verify the claim that using B2M can reduce the build size before I purchase it. I have downloaded the B2M free demo from the asset store and created two scenes.

    Scene A has three cubes with unity materials with textures( 1024 res compressed).

    Scene B has three B2M substances that used the same textures from scene A ()

    I built Scene A into a web build(excluding scene B) and built scene B into a web build(Excluding scene A).

    My expectition was that Scene A( using image textures) would be much bigger than Scene B (using procedural textures).

    Scene A (Compressed Textures) is 905KB
    Scene B (B2M) is 924KB

    Why would the procedural substances be bigger than compressed textures? On the product web page i read this testimonial

    http://www.allegorithmic.com/content/bitmap2material-0

    and would like know that I can actually reproduce his results before buying B2M.

    Any thoughts on what could be going wrong?

    I can provide my test setup if needed.
     
  3. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Hey, moderators. I clicked on the email link to unsubscribe to this thread but keep getting this error instead: An invalid threadid or forumid was specified. And I can't find a clearly marked link (I'm very ADD) on this page to unsubscribe. So, how do I do it?
     
  4. IMTRIGGERHAPPY9

    IMTRIGGERHAPPY9

    Joined:
    Jul 27, 2011
    Posts:
    35
    awesome! do you guys have a release date for 4.0 yet? or an around this time? lol
     
  5. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    B2M allows you to save on the size if you use normal maps and specular maps.
    Using only the diffuse won't make any difference, however, if you are using a normal map or specular, by using B2M, these maps will be generated at runtime and won't weight a single kb.
     
  6. Clement_Shimizu

    Clement_Shimizu

    Joined:
    Apr 13, 2011
    Posts:
    22
    Thanks for clarifying that. I was really hoping that the generated materials were 100% procedural including creating a procedural diffuse map that doesn't require a example texture. That still remains a computer graphics grand challenge...
     
  7. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    That's exactly what most substances do, generating everything including the diffuse map, B2M can't do that because it's used to go from diffuse to diffuse + many maps, so it needs a diffuse input.
    - Substances can have inputs
    - B2M is a substance
    - B2M turns a diffuse input into diffuse + many (so you need to store the diffuse)
    - You can write purely procedural textures (that don't take a diffuse input) in substance designer / purchase them and ship "just" the few kb substance code with the game.
     
  8. NicolasLIATTI

    NicolasLIATTI

    Joined:
    Jul 7, 2012
    Posts:
    28
    Nope, that depends on Unity :)
     
  9. NicolasLIATTI

    NicolasLIATTI

    Joined:
    Jul 7, 2012
    Posts:
    28
    You can create a substance inside Substance Designer which would be 100% procedural (and thus take only a few kb).
    We cannot however convert an existing bitmap into procedural yet :)

    Nicolas
     
  10. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    In the latest Unity 3.5.x build, I suddenly get totally black output textures from my substances (I'm using input texture nodes if it helps). The weird thing that inside Editor all works fine, it brokes only when I do Desktop or WebPlayer build. Anyone else gets this behaviour?
     
  11. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Nope, all good for me!
     
  12. randyherring

    randyherring

    Joined:
    Feb 9, 2008
    Posts:
    42
    Jerc,
    Thanks for the update. I just upgraded to Substance Designer 3.5. Can't wait to use it on mobile. :D
     
  13. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Where did you get Substance Designer 3.5?
    The latest I've seen is 3.1.
     
  14. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,102
    Does this mean that substances on IOS wont be available in a 3.5.X update and only on a 4.x update? I really hope not as this would be a really annoying for us 3.5.x users.
     
  15. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I really doubt anything beyond support will happen to 3.X now
     
  16. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    It's up to Unity to release updates, but as ronan.thibaudau wrote, any future update will probably be updates to 4.x.
    Anyway, unfortunately substance support for iOs will not be available for 3.5.
     
  17. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,102
    Wel this isn't very good. I've been using substance in my games development on 3.5.6 so when I come to release it on all platforms it's not going to work
    on IOS unless I upgrade to 4. If this feature was made partially available on 3 then surely you have an obligation to fix it and make it complete in 3.x builds.
    Some of us can't afford to upgrade to 4, what do we do? Strip out all our use of substances? meaning you are cutting off potential substance customers? doesn't sound too smart to me.
     
  18. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    On mobile it will bake your substances as bitmaps, so it will work unless you plan on doing runtime changes to the textures. The feature was complete on 3.x. Mobile support can be considered a new feature for 4.x, like shadows on mobile is a new feature of 4.x. Unfortunately, integrating mobile support is much more than just fixing what is already exisitng, it's a whole new generation engine specific to mobile hardware.
     
    Last edited: Dec 9, 2012
  19. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,102
    @Jerc: The Big Plus for Mobile would be to use the very small substances to cut-down the size off the app.
     
  20. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    When I import a model, Unity doesn't include Substances as materials to search for, so it creates a new one for me even though I intend it to use my Substance Material. Is there a way to fix this?
     
  21. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Unity needs to update its FBX importer to add support for substances. Nothing we can do on our side unfortunately.
     
  22. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    It is a bit of a shame we don't get more access to the Fbx importer, like XNA, then third party developers like yourself could simply register a handler. As a work around, I'm looking for an sbsar with the same name as the material and assigning that.
     
  23. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    Hello,

    I hope that I'm posting my question into the right topic. ;-)

    I'm currently writing an editor script in which I'm trying with the following line to create a ProceduralMaterial object (C#):

    Code (csharp):
    1. ProceduralMaterial substance = Selection.activeObject as ProceduralMaterial;
    My problem with this line is if I select the substance root object than it is not retrieving the ProceduralMaterial object. However it works fine if I select the first child object beneath it.

    How can I make my code more dummy proof so that if somebody selects the substance root object it will automatically pick the right child object.


    Kind regards,


    Peter.
     
    Last edited: Jan 6, 2013
  24. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Unfortunately there is no public way of calling the substance root object in the editor, only the ProceduralMaterials inside of it.
     
  25. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    Any update on how a substance I bought from the asset store works on Unity 4 mobile? Last time I tried (Unity 3) it took an extraordinary amount of time to load a scene that uses substances. I see now in the inspector window it states "...Textures will be baked", are they backed at build time or run time? I don't need to change the textures at runtime, but if they are baked at runtime instead of build, it will add time to the scene load time.

    Thanks,

    JL
     
  26. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    I dont have the answer to you question but performance wise and in my opinion for the best mobile graphics results you should use a regular PC/Mac project to texture everything with the substances (Don't get me wrong I'm a big substance fan :cool:). A PC/Mac project has no limitations. If everything is finished just bake it down to textures with the substance exporter function and use the Render to Texel example: http://u3d.as/content/forest-johnson/render-to-texel-baker/3fD or this Bake Material to texture script: http://forum.unity3d.com/threads/114402-Bake-material-to-texture-script. Both have some learning curve to archive the same result but after a while it works pretty neat.
     
  27. mindlube

    mindlube

    Joined:
    Oct 3, 2008
    Posts:
    993
    They are baked at build time. I am guessing be the launch slowness loading you are seeing in Unity3 was by default it would bake all of the texture outputs, so like 5-6 textures including normal map etc... depending on the substance?

    In Unity 4 you have a lot more control over which outputs are baked and at what size and, if you desire, can just make the diffuse only, I think.

    Also the Substance engine for mobile is in an upcoming Unity 4.x release and then you will have even more options for how the Substance is baked or not, like generate at launch, use caching, or generated at runtime, etc.
     
  28. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,031
    I was playing around with your "Pimp Your Hooligan" demo, and I see that there are sliders for jeans ripping, blood, scars, etc. There are no texture sheets for those, so how are those generated? They don't seem to be random since they show the same visual every time the slider is in the same numeric position. Are the textures within your substance files? Is it possible to have procedural generated graphics, so when I move the "Jeans Ripping" slider around I will never get the same rips?

    I'm working on my own character creator, and I'd like to have random changes so no two players would have the same scars for example.

    Thanks!
     
  29. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes the ripping and scars are created procedurally in Substance Designer. You can randomize them with the randomize button at the very top of the list of parameters.
     
  30. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    I recall a while ago Allegorithmic saying they'd provide the sources for the purchasable substances so people with Designer could check them out. I bought 3 on the asset store for this purpose, but they're all .sbsar's!
     
  31. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    Also, how do I query the different graphs in a single substance in code? I want to assign different graphs to different material slots but I can't see how to do that in ProceduralMaterial.
     
  32. stimarco

    stimarco

    Joined:
    Oct 17, 2007
    Posts:
    721
    Not all the Substances on the Asset Store were created by Allegorithmic. Any artist with Substance Designer can release their work for sale.
     
  33. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    Yes but these were created by Allegortihmic.
     
  34. NicolasLIATTI

    NicolasLIATTI

    Joined:
    Jul 7, 2012
    Posts:
    28
    Hi Duke,

    We provide all the sources for all the substances bought on our website. On the AssetStore we didn't update them yet with sources, but we hope to do it (no ETA however).
    Can you contact me via mail so I can provide you with those .sbs files?

    Cheers,
    Nicolas
     
  35. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    Hi Nicolas - I sent you a PM :)
     
  36. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,439
    I have a problem using Bitmap2Material 2.0 on free Unity 4.0.1f2.

    I want to pregenerate normal, specular and height maps from a bunch of diffuse textures. The projects size doesn't matter.

    I switched "Load Behavior" of all the procedural materials inside B2M substance to "Bake and discard". As far as I understand, if I change any parameter of any material, the output maps for that material should be recalculated and placed somewhere inside the project folder. And when I launch the project I expect these maps to be ready for use. The behavior I get is different.

    Normally my project launches and stops within a couple of seconds. When I change any material, it takes more time to launch it (the larger the procedural textures, the longer the pauses). And what is actually strange, all the other materials (except the one I have changed) don't have textures. Here I changed the wood material and hit Play. Other three procedural materials became blue:



    Then it also takes more time to stop the project as if all the maps were recalculated again. Only when I hit Play for the second time the project looks fine and starts and stops fast.

    If a couple of my procedural materials are 2048x2048 and I change something in any other material, then it takes minutes to launch the project and then minutes to stop it as if everything was recalculated from scratch.
     
    Last edited: Feb 18, 2013
  37. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    Say I have a custom shader. Suddenly my substance doesnt generate any textures because presumably my shader property names arent what Unity expects. How do I tap into the process to say what output goes where?

    Edit: I see I already asked this question, but without a response! If I take the substance terrain tool as an example, I'd have to make a special script to attach to any object that references the material, which seems a bit messy, so I'd still like to know if this is doable with, say, the substance importer.
     
    Last edited: Mar 5, 2013
  38. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Right now there is the "generate all outputs" option you can check to make sure all the substance outputs are generated whether they are used or not by the default substance material.
    Then you can drag and drop the substance outputs from the project view to your shader slots like any other bitmaps, but you need to create a new material for that, not use the default one attached to the substance.
     
  39. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Is it possible to export the generated textures and use them like you would normal textures? Using the software purely for creation and generation. This would reduce CPU hit and load times while still providing nice looking textures.
     
  40. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes you can export the substance outputs as bitmaps at any time.
     
  41. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Which tools can do this? I want to make sure I don't buy the wrong software from your site, lol. Can B2M do this?
     
  42. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,102
  43. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes B2M allows you to generate normal and specular maps then save it as bitmaps if you want to.
    But basically every substance file can be saved as bitmap in the same way.
     
  44. PatBGames

    PatBGames

    Joined:
    Mar 28, 2009
    Posts:
    120
    Hello to the Allegorithmic team and thank you for your nice work.

    I use the "Electric_Liquid" from the "Eighteen Free Substances" available on the Asset Store since Unity 3.5

    I'm not sure if it is related to Unity 4, but now I have a problem in my program when I apply the texture with tiling different than 1,1 (30,30 applied on a plane in my case).
    The console display this message when I run my game in the Unity editor :
    "AssetImporter is referencing an asset from the previous import. This should not happen.
    (Filename: C:/BuildAgent/work/812c4f5049264fad/Editor/Src/AssetPipeline/AssetDatabase.cpp Line: 745)"
    And the texture is not applied, only the main color of the material.

    I have reproduced the problem in an empty project with only "Eighteen Free Substances" and the "Electric_Liquid" applied to a sphere. If I change the default tiling to something different of 1,1 I have the same problem.

    With my old 3.5 project, all worked well. Here is the intended result on the acid sea : http://www.aftermoon.net/myproject2011/WIP-Demo.html
    The animation of the flow parameter has no effect on the problem (same bug if I remove my animation script)

    A funny detail : on the empty project, it never works, the texture is always lost when I change the tiling parameters. But with my whole project, it works correctly once every two run of the game :eek:

    Note : I use Unity 4.0.1f2 Pro with Windows 7 64 bits.
     
  45. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    I strongly encourage anyone using substances in their projects to update to the latest 4.1 release, lots of improvements and bug fixes are in there :)
    (I will try to reproduce your bug Pat AfterMoon).
     
  46. ddeaco

    ddeaco

    Joined:
    Jan 17, 2012
    Posts:
    44
    How long does it take to processed textures on iOS, eg one 1024 colour image to a specular and normal map. Also how much extra time is need to compress texture to PVRTC?

    Thanks
     
  47. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    A full 1024 B2M material (diffuse, spec, normal) will take between 1s and 2s to generate depending on the hardware (iPhone5 or Ipad2 for example). This timing includes the PVRTC compression. The generation is done once during the first launch of the game, then the textures are stored on the device.
     
  48. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    I can't update to 4.1 version, more then half of my substances crashes the editor. Do I need to rebuild them with the latest designer or something like that? Anyone else can't update because of it?


    Code (csharp):
    1.  
    2. ========== OUTPUTING STACK TRACE ==================
    3.  
    4. (0x01288DBC) (Unity): (filename not available): fxShader_JPEG_DECODE_SSE2 + 0x12dc
    5. (0x01287D84) (Unity): (filename not available): fxShader_JPEG_DECODE_SSE2 + 0x2a4
    6. (0x0126BE6D) (Unity): (filename not available): cpuShaderThreadKickPending + 0x30d
    7. (0x012AE9AF) (Unity): (filename not available): algThreadJobQueueRun + 0x4f
    8. (0x0126BD20) (Unity): (filename not available): cpuShaderThreadKickPending + 0x1c0
    9.  
     
  49. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    These errors appear when the binary part of a substance file has been manually messed up with (to remove a watermark for example).

    If this happens with substances you created in Substance Designer, then it's a bug and we would be glad if you could send us these for investigation.
     
  50. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Thank you for the answer, I will email few non-working examples soon, they were made long ago maybe that is the problem, all my new substances made with designer are working fine
     
unityunity