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

An Update on Substance Format Support in Unity

Discussion in 'Formats & External Tools' started by ans_unity, Dec 19, 2017.

  1. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Yeah I also cannot recommend that people who use subtances a lot to upgrade their existing projects to 2018 yet as it seems there is no working upgrade path? All the material links were lost as the plugin seems to only create new materials and pre 2018 materials are destroyed. Also almost all subtance generation settings were also set to defaults. Importing the plugin to project before or after opening in 2018 did not seem to help.

    Importing the plugin afterwards leaves the console spams that plugin should be installed from the store even though it was just a moment ago. Reopening the project does not help. Only right clicking the .sbsar file and using re-import fixes the errors but results in the above missing links and value wipes.
     
    Last edited: May 3, 2018
  2. Deleted User

    Deleted User

    Guest

    @AndersMalmgren
    I'm very sorry to hear about the issues you have experienced and your disappointment. I can completely understand your situation and feedback. We've worked very hard to deliver the plugin with the amount of development time we had for the 2018.1 public release. However, I am not making excuses as we always need to strive to achieve more and we still have much work to do. We are vigorously working on updates to the plugin.

    For the project update, are you using our reflection package to update your projects? We have provided a method for updating 2017 projects to 2018. It's not perfect, but works well in most cases. You can use the update package to update Unity 2017 projects using the native Substance integration to Unity 2018 projects using the new Substance plugin. Here you can find more information. https://support.allegorithmic.com/documentation/display/integrations/Upgrading+2017.x+projects


    @Ostwind
    Just wanted to double check, are you using the reflection update package? This should take care of the issues you have described. https://support.allegorithmic.com/documentation/display/integrations/Upgrading+2017.x+projects

    Thanks very much for your feedback.

    Cheers,
    Wes
     
    radiantboy likes this.
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for the feedback @wesm

    I did not use that tool, it would have been great if the error message in Unity 2018 hinted about that, now I just downloaded the Plugin from the asset store as stated in the error message.

    You guys should look at this asset,

    https://www.assetstore.unity3d.com/en/?stay#!/content/64542

    it has one substance material that does not work well with the 2018 plugin, it hangs the editor plus the mask property does not work, it gives a error when I try to set the property. All works fine in 2017.4 with the built in plugin
    upload_2018-5-3_20-22-3.png

    Also load behavior is grayed out? I was hoping in saving some scene load times by baking the materials.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I have a question on how the new plugin handles generation of textures. I currently have an issue under 2017.3 where I use Substances on Prefabs. These prefabs aren't part of the scene, so their textures aren't generated when the scene is loaded. Instead, the textures are generated the first time the prefab is instantiated in the scene. This results in the prefab temporarily having no material, then a brief lock-up of the game while the texture is rendered. Obviously not the behavior I'm looking for.

    I was wondering how things would work under the new plugin in 2018.1? I read above that there is only one texture generation approach supported: that textures are generated asynchronously when the scene loads. Is there any option to pre-generate textures so that instantiated prefabs have their materials from the first frame they're renderered, without locking up the game on the frame the prefab is first added to the scene?

    Thanks,

    -Dan
     
  5. Deleted User

    Deleted User

    Guest

    For the substance deprecated error, that was added by Unity. It would be helpful if it contained more information such as a link to the Substance in Unity, but unfortunately we don't have any control over that.

    Can you please send me the substance that is not working? You can email me at wes.mcdermott@allegorithmic.com to send the substance file. We definitely want to take a look at this. This is most likely a custom substance.

    We have launched this plugin as open beta and the load behaviors are currently not implemented in this first release. They will be added with the same functionality as the 2017 plugin. Currently the default behavior is build on level load asynchronous. We have detailed documentation on the plugin and cover all this information on the beta information page. Please be sure to check out the documentation. https://support.allegorithmic.com/documentation/display/integrations/Unity+2018

    And of course, please let me know if you have questions and or feedback on the new plugin.
     
    AndersMalmgren likes this.
  6. Deleted User

    Deleted User

    Guest

    Hi Dan,

    At this time, the behavior is going to be the same as what you have in 2017, since we can only load our substance into memory and render it once unity has loaded the object it's attached to.

    With your prefab, you are instantiating via code at runtime? In 2017, what load behavior are you using?

    Cheers,
    Wes
     
  7. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Hi,

    This seems to solve my issues. However I did not see the link to this anywhere or any other type upgrade guide from Unity only perspective so you might want to add it to your post which Unity 2018 blog is linking to, get Unity to add it to release notes substance deprecation section or at least to the asset store asset as a first import popup.

    I had backup of my project but my guess is that not everyone will have one and they can possibly damage their project by trying different things before that package :)
     
  8. Deleted User

    Deleted User

    Guest

    Thanks! Glad to hear this solved your issue. I will have our team add this link to the product page.

    Cheers,
    Wes
     
  9. Deleted User

    Deleted User

    Guest

    I created a video showing how to update the Substance package from the Unity store. This will help if you have issues with importing the package and the engine plugin is not listed.

    Cheers,
    Wes

     
  10. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Yes, I was instantiating the prefab at runtime. An example of the use case is a "dirt" decal to show on the wall as the result of an explosion. The explosion might not occur, so the decal isn't instantiated until after the explosion occurs.

    I'm currently using "Build on Level Load and Cache". However, this doesn't appear to cache for long, and I frequently see the instantiated object render without a texture for a second or two before it rebuilds the texture. I figured that for this kind of use case I might need to use "Bake and keep Substance" instead, but using that approach never resulted in the material showing the right texture.

    I was waiting to see whether the behavior under the 2018.1 plugin would change. If not, I'll probably need to implement some kind of prefab pre-loader on level load to generate any potentially necessary textures when the scene first loads.
     
  11. Deleted User

    Deleted User

    Guest

    Thanks for the info. I checked with the dev team and they mentioned putting the substances needed for the scene into the resources folder of the project and manually loading them when the scene is loading would be the only way around this.

    The new plugin at this time is not adding any new functionality for when the substances are built. We will be adding "Build on Level Load and Cache" along with the other behaviors to the new plugin, but these load behaviors will not address what you need.

    Cheers,
    Wes
     
    dgoyette likes this.
  12. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I sent you a PM wesm, thanks
     
    Deleted User likes this.
  13. Deleted User

    Deleted User

    Guest

    Hi Anders,

    I was able to check the material and it's working for me with the 2018 plugin. The Substance uses an image input. For textures used as inputs, you need to set the compression to none and enable read/write. We detail that information here in the documentation. https://support.allegorithmic.com/documentation/display/integrations/Using+Image+Inputs

    Here is some background on why this is different from the native integration. You need to set the image used for input to no compression because we can't decompress the images in a plugin form. When we had a native integration, the c++ code exposed it. We can't duplicate this in our plugin because dxt decompression is patented.

    However, in your case, you mentioned that Unity was freezing up when trying to use this Substance with the new plugin? I haven't been able to replicate that. Our team is taking a closer look, but we haven't had an issue using this material with the new plugin. Please check the compression and read/write on the mask texture and see if this resolves the issue.

    Cheers,
    Wes
     
  14. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    It did not start well, I just focused the material in the project explorer and it crashed Unity 2018.1

    upload_2018-5-4_19-32-37.png

    You probably have some unmanaged code writing to protected memory.

    I will try more and let you know
     
  15. Deleted User

    Deleted User

    Guest

    Hmm, this is very strange. We can't reproduce this issue at all. I had no problems working with this material in 2018.1 or 2018.2 b2. Are you using 2018.1f1

    Cheers,
    Wes
     
  16. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    haha, I though I was in our private PM :p
     
    Deleted User likes this.
  17. Deleted User

    Deleted User

    Guest

    Haha, that's ok. It's good to discuss this in case other users encounter a similar problem. Our engineers have checked the crash dump and we think the crash you are getting has been fixed this week and will appear in the next update. The substance is indeed slow when you increase the resolution. What resolution are you setting the substance to?

    The substance has a different size output from the parent so when unity is set to 32x32 the substance outputs 256x256. and with 512x512 it outputs 4k x 4k. When you set a high resolution this substance is then generating much higher outputs. Setting the resolution to 4K is causing a crash because internally the substance is outputting 32k. This is why it's becoming unresponsive. In Designer, the Substance graph needs to have the Relative to Parent set to 1 so it's not multiply the resolution based on what you set in the Unity error.

    Does this asset store package contain the .sbs file? If so, you can send it to me and I will fix it.

    Cheers,
    Wes
     
    AndersMalmgren likes this.
  18. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Ah, cool, will try the update when its out, I dont have the sbs file only the sbsar. I will relay your info to the asset author and see what he says. I set it to 2k btw. Thanks
     
    Deleted User likes this.
  19. Morgondag

    Morgondag

    Joined:
    Dec 29, 2014
    Posts:
    35
    Crossway likes this.
  20. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Yeah, I'm also having issues with the normal maps. I'm assuming it's to do with the compression, however, if I turn off compression and use RAW, it still isn't recognised by Unity as a normal map for use in terrains.

    @wesm would you be able to advise as to the best way to handle this? Is it possible to sort it out from the plugin or is it better to use Substance Designer to export the normal maps? The plugin is great btw - great work from the Allegorithmic teams.
     
  21. sskenth

    sskenth

    Joined:
    Sep 23, 2016
    Posts:
    54
    Hi I was getting a bunch of substance errors and your asset really fixed to remove a whole bunch of them.

    So first of all thank you for that :)

    I seem to just have one left, and it looks like more of a scripting reference ProdeduralMaterial. I tried to change the references to Substance.Game an import Substance.Game at the start of the script but that didn't work.

    Sorry but I have no idea what I'm doing when it comes to textures or substances. Is there a way for me to change the ProceduralMaterial to Substance or is the script just no longer useful?

    Thank you!


    P.S. The exact error I get is

    Assets/SFBayStudios/SFB Mushroom Monster/Scripts/mushroom_substanceControl.js(6,43): BCE0144: 'UnityEngine.ProceduralMaterial' is obsolete. Built-in support for Substance Designer materials has been removed from Unity. To continue using Substance Designer materials, you will need to install Allegorithmic's external importer from the Asset Store.



    Code (JavaScript):
    1.  
    2. #pragma strict
    3.  
    4. var subPanels                : GameObject[];
    5. var object                    : GameObject;
    6. var rend                    : Renderer;
    7. var substance                : ProceduralMaterial;
    8. var loadingPanel            : GameObject;
    9.  
    10. var baseCount                : int                        = 6;
    11. var baseTotal                : int                        = 14;
    12. var stampCount                : int                        = 2;
    13. var stampTotal                : int                        = 5;
    14.  
    15. var grungeColor                : GameObject[];
    16. var grunge2Color            : GameObject[];
    17. var groundDirtColor            : GameObject[];
    18. var ceilingDirtColor        : GameObject[];
    19. var waterColor                : GameObject[];
    20. var mossColor                : GameObject[];
    21.  
    22. var mainBody                : GameObject;
    23.  
    24.  
    25.  
    26. function Start() {
    27.     rend         = object.GetComponent.<Renderer>();
    28.     substance     = rend.sharedMaterial as ProceduralMaterial;
    29.     loadingPanel.SetActive(true);
    30.     if (!IsInvoking("CheckLoading"))
    31.         InvokeRepeating("CheckLoading", 0, 0.2);
    32. }
    33.  
    34. function LoadSubPanel(panelNumber : int){
    35.     for (var i : int; i < subPanels.Length; i++){
    36.         subPanels[i].SetActive(false);
    37.     }
    38.     subPanels[panelNumber].SetActive(true);
    39. }
    40.  
    41. function CloseSubPanels(){
    42.     for (var i : int; i < subPanels.Length; i++){
    43.         subPanels[i].SetActive(false);
    44.     }
    45. }
    46.  
    47. function CheckLoading(){
    48.     print ("CheckLoading()");
    49.     if (!substance.isProcessing)
    50.     {
    51.         loadingPanel.SetActive(false);
    52.         CancelInvoke("CheckLoading");
    53.     }
    54. }
    55.  
    56. function RebuildTextures(){
    57.     substance.RebuildTextures();
    58.     loadingPanel.SetActive(true);
    59.     InvokeRepeating("CheckLoading", 0, 0.1);
    60. }
    61.  
    62.  
    63. // BASE MATERIALS
    64. function LoadTop(newMaterial : int){
    65.     print ("LoadTop(" + newMaterial + ")");
    66.     if (newMaterial == 0)
    67.         substance.SetProceduralBoolean("UseDefaultTop", true);
    68.     else
    69.     {
    70.         print ("Do false");
    71.         substance.SetProceduralBoolean("UseDefaultTop", false);
    72.         substance.SetProceduralFloat("TopMaterialNumber", newMaterial);
    73.     }
    74.     RebuildTextures();
    75. }
    76.  
    77. function LoadBottom(newMaterial : int){
    78.     if (newMaterial == 0)
    79.         substance.SetProceduralBoolean("UseDefaultBottom", true);
    80.     else
    81.     {
    82.         substance.SetProceduralBoolean("UseDefaultBottom", false);
    83.         substance.SetProceduralFloat("BottomMaterialNumber", newMaterial);
    84.     }
    85.     RebuildTextures();
    86. }
    87.  
    88. // STEM
    89. function StemHue(newValue : float){
    90.     substance.SetProceduralFloat("MushroomStemHue", newValue);
    91.     RebuildTextures();
    92. }
    93.  
    94. function StemContrast(newValue : float){
    95.     substance.SetProceduralFloat("StemContrast", newValue);
    96.     RebuildTextures();
    97. }
    98.  
    99. function StemSaturation(newValue : float){
    100.     substance.SetProceduralFloat("MushroomStemSaturation", newValue);
    101.     RebuildTextures();
    102. }
    103.  
    104. function StemLightness(newValue : float){
    105.     substance.SetProceduralFloat("MushroomStemLightness", newValue);
    106.     RebuildTextures();
    107. }
    108.  
    109. function StemRoughness(newValue : float){
    110.     substance.SetProceduralFloat("MushroomStemRoughness", newValue);
    111.     RebuildTextures();
    112. }
    113.  
    114. // BUMPS
    115. function BumpsHue(newValue : float){
    116.     substance.SetProceduralFloat("HeadBumpsHue", newValue);
    117.     RebuildTextures();
    118. }
    119.  
    120. function BumpsContrast(newValue : float){
    121.     substance.SetProceduralFloat("HeadBumpsContrast", newValue);
    122.     RebuildTextures();
    123. }
    124.  
    125. function BumpsSaturation(newValue : float){
    126.     substance.SetProceduralFloat("HeadBumpsSaturation", newValue);
    127.     RebuildTextures();
    128. }
    129.  
    130. function BumpsLightness(newValue : float){
    131.     substance.SetProceduralFloat("HeadBumpsLightness", newValue);
    132.     RebuildTextures();
    133. }
    134.  
    135. function BumpsRoughness(newValue : float){
    136.     substance.SetProceduralFloat("HeadBumpsRoughness", newValue);
    137.     RebuildTextures();
    138. }
    139.  
    140. // HEAD
    141. function HeadHue(newValue : float){
    142.     substance.SetProceduralFloat("HeadHue", newValue);
    143.     RebuildTextures();
    144. }
    145.  
    146. function HeadContrast(newValue : float){
    147.     substance.SetProceduralFloat("HeadContrast", newValue);
    148.     RebuildTextures();
    149. }
    150.  
    151. function HeadSaturation(newValue : float){
    152.     substance.SetProceduralFloat("HeadSaturation", newValue);
    153.     RebuildTextures();
    154. }
    155.  
    156. function HeadLightness(newValue : float){
    157.     substance.SetProceduralFloat("HeadLightness", newValue);
    158.     RebuildTextures();
    159. }
    160.  
    161. function HeadRoughness(newValue : float){
    162.     substance.SetProceduralFloat("HeadRoughness", newValue);
    163.     RebuildTextures();
    164. }
    165.  
    166. // GRUNGE
    167. function GrungeBalance(newValue : float){
    168.     substance.SetProceduralFloat("GrungeBalance", newValue);
    169.     RebuildTextures();
    170. }
    171.  
    172. function GrungeLevel(newValue : float){
    173.     substance.SetProceduralFloat("GrungeLevel", newValue);
    174.     RebuildTextures();
    175. }
    176.  
    177. function GrungeContrast(newValue : float){
    178.     substance.SetProceduralFloat("GrungeContrast", newValue);
    179.     RebuildTextures();
    180. }
    181.  
    182. function GrungeRoughness(newValue : float){
    183.     substance.SetProceduralFloat("GrungeRoughness", newValue);
    184.     RebuildTextures();
    185. }
    186.  
    187. function GrungeColor(){
    188.     print ("Color: " + parseFloat(grungeColor[0].GetComponent(UI.Text).text));
    189.     print ("Color: " + parseFloat(grungeColor[1].GetComponent(UI.Text).text));
    190.     print ("Color: " + parseFloat(grungeColor[2].GetComponent(UI.Text).text));
    191.     print ("Color: " + parseFloat(grungeColor[3].GetComponent(UI.Text).text));
    192.     substance.SetProceduralColor("GrungeColor", Color(parseFloat(grungeColor[0].GetComponent(UI.Text).text) / 255,parseFloat(grungeColor[1].GetComponent(UI.Text).text) / 255,parseFloat(grungeColor[2].GetComponent(UI.Text).text) / 255,parseFloat(grungeColor[3].GetComponent(UI.Text).text) / 255));
    193.     RebuildTextures();
    194. }
    195.  
    196. // GRUNGE 2
    197. function Grunge2Balance(newValue : float){
    198.     substance.SetProceduralFloat("Grunge2Balance", newValue);
    199.     RebuildTextures();
    200. }
    201.  
    202. function Grunge2Volume(newValue : float){
    203.     substance.SetProceduralFloat("Grunge2Volume", newValue);
    204.     RebuildTextures();
    205. }
    206.  
    207. function Grunge2Contrast(newValue : float){
    208.     substance.SetProceduralFloat("Grunge2Contrast", newValue);
    209.     RebuildTextures();
    210. }
    211.  
    212. function Grunge2Roughness(newValue : float){
    213.     substance.SetProceduralFloat("Grunge2Roughness", newValue);
    214.     RebuildTextures();
    215. }
    216.  
    217. function Grunge2OffsetX(newValue : float){
    218.     var currentOffset    : Vector2    = substance.GetProceduralVector("Grunge2Offset");
    219.     substance.SetProceduralVector("Grunge2Offset", Vector2(newValue,currentOffset[1]));
    220.     RebuildTextures();
    221. }
    222.  
    223. function Grunge2OffsetY(newValue : float){
    224.     var currentOffset    : Vector2    = substance.GetProceduralVector("Grunge2Offset");
    225.     substance.SetProceduralVector("Grunge2Offset", Vector2(currentOffset[0],newValue));
    226.     RebuildTextures();
    227. }
    228.  
    229. function Grunge2Rotation(newValue : float){
    230.     substance.SetProceduralFloat("Grunge2Rotation", newValue);
    231.     RebuildTextures();
    232. }
    233.  
    234. function Grunge2Color(){
    235.     print ("Color: " + parseFloat(grunge2Color[0].GetComponent(UI.Text).text));
    236.     print ("Color: " + parseFloat(grunge2Color[1].GetComponent(UI.Text).text));
    237.     print ("Color: " + parseFloat(grunge2Color[2].GetComponent(UI.Text).text));
    238.     print ("Color: " + parseFloat(grunge2Color[3].GetComponent(UI.Text).text));
    239.     substance.SetProceduralColor("Grunge2Color", Color(parseFloat(grunge2Color[0].GetComponent(UI.Text).text) / 255,parseFloat(grunge2Color[1].GetComponent(UI.Text).text) / 255,parseFloat(grunge2Color[2].GetComponent(UI.Text).text) / 255,parseFloat(grunge2Color[3].GetComponent(UI.Text).text) / 255));
    240.     RebuildTextures();
    241. }
    242.  
    243. // GROUND DIRT
    244. function GroundDirtLevel(newValue : float){
    245.     substance.SetProceduralFloat("GroundDirtLevel", newValue);
    246.     RebuildTextures();
    247. }
    248.  
    249. function GroundDirtContrast(newValue : float){
    250.     substance.SetProceduralFloat("GroundDirtContrast", newValue);
    251.     RebuildTextures();
    252. }
    253.  
    254. function GroundDirtHeight(newValue : float){
    255.     substance.SetProceduralFloat("GroundDirtHeight", newValue);
    256.     RebuildTextures();
    257. }
    258.  
    259. function GroundDirtRoughness(newValue : float){
    260.     substance.SetProceduralFloat("GroundDirtRoughness", newValue);
    261.     RebuildTextures();
    262. }
    263.  
    264. function GroundDirtColor(){
    265.     print ("Color: " + parseFloat(groundDirtColor[0].GetComponent(UI.Text).text));
    266.     print ("Color: " + parseFloat(groundDirtColor[1].GetComponent(UI.Text).text));
    267.     print ("Color: " + parseFloat(groundDirtColor[2].GetComponent(UI.Text).text));
    268.     print ("Color: " + parseFloat(groundDirtColor[3].GetComponent(UI.Text).text));
    269.     substance.SetProceduralColor("GroundDirtColor", Color(parseFloat(groundDirtColor[0].GetComponent(UI.Text).text) / 255,parseFloat(groundDirtColor[1].GetComponent(UI.Text).text) / 255,parseFloat(groundDirtColor[2].GetComponent(UI.Text).text) / 255,parseFloat(groundDirtColor[3].GetComponent(UI.Text).text) / 255));
    270.     RebuildTextures();
    271. }
    272.  
    273. // CEILING DIRT
    274. function CeilingDirtLevel(newValue : float){
    275.     substance.SetProceduralFloat("CeilingDirtLevel", newValue);
    276.     RebuildTextures();
    277. }
    278.  
    279. function CeilingDirtContrast(newValue : float){
    280.     substance.SetProceduralFloat("CeilingDirtContrast", newValue);
    281.     RebuildTextures();
    282. }
    283.  
    284. function CeilingDirtHeight(newValue : float){
    285.     substance.SetProceduralFloat("CeilingDirtHeight", newValue);
    286.     RebuildTextures();
    287. }
    288.  
    289. function CeilingDirtRoughness(newValue : float){
    290.     substance.SetProceduralFloat("CeilingDirtRoughness", newValue);
    291.     RebuildTextures();
    292. }
    293.  
    294. function CeilingDirtColor(){
    295.     print ("Color: " + parseFloat(ceilingDirtColor[0].GetComponent(UI.Text).text));
    296.     print ("Color: " + parseFloat(ceilingDirtColor[1].GetComponent(UI.Text).text));
    297.     print ("Color: " + parseFloat(ceilingDirtColor[2].GetComponent(UI.Text).text));
    298.     print ("Color: " + parseFloat(ceilingDirtColor[3].GetComponent(UI.Text).text));
    299.     substance.SetProceduralColor("CeilingDirtColor", Color(parseFloat(ceilingDirtColor[0].GetComponent(UI.Text).text) / 255,parseFloat(ceilingDirtColor[1].GetComponent(UI.Text).text) / 255,parseFloat(ceilingDirtColor[2].GetComponent(UI.Text).text) / 255,parseFloat(ceilingDirtColor[3].GetComponent(UI.Text).text) / 255));
    300.     RebuildTextures();
    301. }
    302.  
    303. // SFX
    304. function MossColor(){
    305.     substance.SetProceduralColor("SFXWaterColor", Color(parseFloat(waterColor[0].GetComponent(UI.Text).text) / 255,parseFloat(waterColor[1].GetComponent(UI.Text).text) / 255,parseFloat(waterColor[2].GetComponent(UI.Text).text) / 255,parseFloat(waterColor[3].GetComponent(UI.Text).text) / 255));
    306.     RebuildTextures();
    307. }
    308.  
    309. function WaterColor(){
    310.     substance.SetProceduralColor("SFXMossColor", Color(parseFloat(mossColor[0].GetComponent(UI.Text).text) / 255,parseFloat(mossColor[1].GetComponent(UI.Text).text) / 255,parseFloat(mossColor[2].GetComponent(UI.Text).text) / 255,parseFloat(mossColor[3].GetComponent(UI.Text).text) / 255));
    311.     RebuildTextures();
    312. }
    313.  
    314. function MossScale(newValue : float){
    315.     substance.SetProceduralFloat("SFXMossScale", newValue);
    316.     RebuildTextures();
    317. }
    318.  
    319. function Moss(newValue : float){
    320.     substance.SetProceduralFloat("SFXMoss", newValue);
    321.     RebuildTextures();
    322. }
    323.  
    324. function Snow(newValue : float){
    325.     substance.SetProceduralFloat("SFXSnow", newValue);
    326.     RebuildTextures();
    327. }
    328.  
    329. function Ice(newValue : float){
    330.     substance.SetProceduralFloat("SFXIce", newValue);
    331.     RebuildTextures();
    332. }
    333.  
    334. function WaterLevel(newValue : float){
    335.     substance.SetProceduralFloat("SFXWaterLevel", newValue);
    336.     RebuildTextures();
    337. }
    338.  
    339. function WaterDetails(newValue : float){
    340.     substance.SetProceduralFloat("SFXWaterDetails", newValue);
    341.     RebuildTextures();
    342. }
    343.  
    344. function IceDetails(newValue : float){
    345.     substance.SetProceduralFloat("SFXIceDetails", newValue);
    346.     RebuildTextures();
    347. }
    348.  
    349. function Refraction(newValue : float){
    350.     substance.SetProceduralFloat("SFXRefraction", newValue);
    351.     RebuildTextures();
    352. }
    353.  
    354. function Reflection(newValue : float){
    355.     substance.SetProceduralFloat("SFXReflection", newValue);
    356.     RebuildTextures();
    357. }
    358.  
    359. function ReflectionDistance(newValue : float){
    360.     substance.SetProceduralFloat("SFXReflectionDistance", newValue);
    361.     RebuildTextures();
    362. }
    363.  
    364. function FlowDirection(newValue : float){
    365.     substance.SetProceduralFloat("SFXFlowDirection", newValue);
    366.     RebuildTextures();
    367. }
    368.  
    369.  
     
  22. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Regardless of the substance issue your script is using Unityscript which will be removed in Unity 2018.2 so you should start by converting it to C# with the tools Unity blogged about and continue fixing the subtance support afterwards.
     
    sskenth likes this.
  23. sskenth

    sskenth

    Joined:
    Sep 23, 2016
    Posts:
    54
    I was hoping there was a quick fix, guess not :(

    Well, I appreciate the quick reply!

    Thank you :)
     
  24. Deleted User

    Deleted User

    Guest

    Hi,

    For the normal map, we are using BC5 compression which is a lossless compression and provides a better quality to the normal map when using Substance. We had to switch to BC5 compression because as a plugin, we don't have access to unity's dxt5_nm compression, which is what Unity recognizes as a normal map. The dxt5_nm was only accessible to us with C++ code access that we had in the native integration (unity 2017).

    We opted to go with BC5 compression as this provides a better normal map result than using dxt5. The dxt5 compressed normal maps would look worse than the previous integrations dxt5_nm and BC5 gives us parity, quality wise to dxt5_nm. We will be working with Unity to see if there are options for us to use dxt5_nm as a plugin.

    Cheers,
    Wes
     
    hopeful likes this.
  25. Deleted User

    Deleted User

    Guest

    Hi,

    In the case of scripts, unfortunately it will take some work as we have a new API and the procedural material api is no longer supported. We don't have a method for updating these scripts to the new Substance API. Using reflection to update a 2017 project will not take scripts into consideration for the process.

    Cheers,
    wes
     
  26. OyvindE

    OyvindE

    Joined:
    Feb 1, 2018
    Posts:
    8
    After updating to Unity 2018.1 I can't build my project anymore. Getting this error:

    Built-in support for Substance Designer materials has been removed from Unity. To continue using Substance Designer materials, you will need to install Allegorithmic's external importer from the Asset Store.
    UnityEngine.GUIUtility: processEvent(Int32, IntPtr)

    I have imported the package from Asset store, still no difference. I even tried removing any substance files but still get the same error.
     
  27. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Have a look at the Allegorithmic YouTube channel. Three of their most recent videos are all about upgrading 2017 projects and how to use the new plugin in Unity 2018.
     
  28. OyvindE

    OyvindE

    Joined:
    Feb 1, 2018
    Posts:
    8
    I have looked at the vids, but it seems I have to downgrade the project to 2017, which takes a long time due to the projects size. Will try it when I have time.
     
  29. Deleted User

    Deleted User

    Guest

    Hi,

    Currently we have several steps as we outlined in the docs, but we working to refine this to make it much more streamlined and easy : ) We don't want to have the project break right when you open 2018 if you didn't upgrade the scene with the steps in the docs. The team is working on a solution for this now.

    Cheers,
    Wes
     
  30. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    Hello,

    I just updated my 2017 Project to Unity 2018.1.0.f2.
    Now I can run in Editor, but not create a build anymore, I get the error:

    Built-in support for Substance Designer materials has been removed from Unity. To continue using Substance Designer materials, you will need to install Allegorithmic's external importer from the Asset Store.

    How can I find out, which material(s) oder shader(s) are causing this Problem?

    I installed the "substance in unity" asset but no Change.

    Thanks!
     
  31. Deleted User

    Deleted User

    Guest

    Hi,

    Did you have Substance materials in the 2017 project that you upgraded to 2018? If you used Substance in Unity, you will need to upgrade it in the Asset Store. Please see this video.


    If you have a 2017 project that uses Substance, you will need to upgrade the project using the steps we have outlined here: https://support.allegorithmic.com/documentation/display/integrations/Upgrading+2017.x+projects

    Cheers,
    Wes
     
  32. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    Can I find out what exactly is causing the problems?

    Thanks a lot!
     
  33. Deleted User

    Deleted User

    Guest

    I will do my best to help : ) I'm not exactly sure where you are in the process. Did you have a 2017 scene that already contained substances?

    Cheers,
    Wes
     
  34. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    I had a 2017 Project with 3 Scenes. It contains multiple assets like UMA, Enviro, Golem Collection, Ultimate VFX and Mesh Effects. I was not aware of any substances. I am still not. Must be in one of my materials?

    I have a backup copy, so that's okay. But I deinstalled Unity 2017 and installed Unity 2018 and just simply upgraded my Project (the automatic stuff Unity does).

    Now I could deinstall Unity 2018, install Unity 2017 and get my Project back from my backup.
    But I would prefer to know where exactly the program comes from, maybe it is just one material I do not use anywhere.
    I would like to isolate and remove it to see if it works then...

    Thanks for your help.
     
  35. Deleted User

    Deleted User

    Guest

    It sounds like one of these assets has Substance materials. If you check the 2018 project, on the materials that used Substance you will see the warning as shown in the attached image. You can open the project back in 2017 and update the substance assets so they will work in 2018. You can find out how this works here:


    Cheers,
    Wes
     

    Attached Files:

  36. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
  37. Deleted User

    Deleted User

    Guest

    Hi Anis,

    You should be getting auto completion in visual studio. The auto complete is working for me when scripting. Is the intellisense not showing for you?

    Cheers,
    Wes
     
  38. MrWhiskerz

    MrWhiskerz

    Joined:
    Nov 14, 2017
    Posts:
    1
    Quick Question. Im not using Photon in my project. What should i delete to remove the "
    Assets/Plugins/Substance/Livelink/Editor/Scripts/MeshLinkEditor.cs(21,33): error CS0433: The imported type `WebSocketSharp.WebSocket' is defined multiple times" Error in the console. Do i need to edit the MeshLinkEditor.cs file? or can I just delete the WebSocket folder? My project does rely on Unet though. Thanks for your help! I greatly appreciate any advice you can give me.

    Edit: The main reason I ask is because I purchased a asset to use for my project which contained Substance files. I'm hoping that assets materials are still compatible

    Edit 2: the asset I'm using that contains the substance materials https://assetstore.unity.com/packages/3d/environments/fantasy/modular-fantasy-town-90075
     
    Last edited: May 17, 2018
  39. Deleted User

    Deleted User

    Guest

    The assets using Substance should be compatible with the new plugin. You can delete our websocket folder and leave the one for Unet.

    Cheers,
    Wes
     
  40. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Mmm.. it's not showing for me.. but will look at fiddling with settings to see if it comes up tks!
     
  41. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I didnt realise I needed to upgrade my substances before moving to 2018, ive been on it for a long time, is there anyway to upgrade them in 2018? or do I need to wipe them all ?
     
  42. Deleted User

    Deleted User

    Guest

    Do you still have the 2017 project? If so, in the new update 2.0.1 you can update using the 2017 and target the 2018 project.

    Cheers,
    Wes
     
  43. Deleted User

    Deleted User

    Guest

    We have a new version of Substance in Unity on the Asset Store - 2.0.1. This build fixes a lot of issues from the 2.0.0 release. We don't have mobile yet, but it will be in the next update.

    https://support.allegorithmic.com/documentation/display/integrations/Beta+Release+Information

    Please note, updating from 2.0.0 - 2.0.1 is breaking the substance connections. We are working with Unity to resolve these issues for future updates. More information here. https://support.allegorithmic.com/documentation/display/integrations/Beta+Release+Information

    release date: 5/24/2018 Build 331

    • General stability of the plugin has been improved (fixed various crashes, hangs, etc)

    • Substance project updating (Reflection) process has been improved

    • 2k and 4k Substances generate more quickly

    • Reset to Default button added to the Substance Inspector GUI

    • Parameters now revert back to default after exiting Play mode (when changing parameters at runtime)

    • Material values (tiling, offset, emission, etc) are now saved after closing the Editor or building a project

    • Adding/Removing parameters when changing a Substance in Substance Designer no longer causes error messages in Unity

    • Substance texture sizes can now be changed at runtime

    • The Unity ‘Reimport All’ option no longer unlinks all Substances in the scene.

    • The Substance preset system has been improved

    Here we have a video showing how to update between beta versions of the plugin that are delivered on the Unity Asset Store.


    Cheers,
    Wes
     
    Last edited by a moderator: May 24, 2018
    JakubSmaga and Rowlan like this.
  44. NiqonNO

    NiqonNO

    Joined:
    Dec 7, 2015
    Posts:
    1
    Hi there. After upgrading to Unity 2018, and changed code to use Substance api, we encountered an weird behavior with function Substance.Game.Substance.Find(). Inserting string with path don't work most of the times, we tried several approaches, which every return same path, but only one is working (but it's still no use, see code bellow), rest return null.

    Code (CSharp):
    1. Substance.Game.Substance.Find(path);
    2. Substance.Game.Substance.Find(@"Assets/RoadAndAutonomicGenerator/Graphics/Materials/Road.sbsar");
    3. Substance.Game.Substance.Find(AssetDatabase.GetAssetPath(32484)); // Only this one seems to work, but instanceID keeps changing every time launching unity
    4. Substance.Game.Substance.Find(AssetDatabase.GetAssetPath(AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path).GetInstanceID()));
    I don't know if this is an bug, or we are doing something wrong.
     
  45. Deleted User

    Deleted User

    Guest

    Hi,

    Our devs are looking into this. The find functionality will only work on substances that are currently loaded into our engine, so they have to be loaded before find will work.

    Cheers,
    Wes
     
  46. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks, will be useful to many people but I couldnt wait, I deleted every substance file. Most of my game went pink, I then reimported the substances and painstakingly reapplied them. They work great now, and look sweet, I thimnk in some weird way it helped me rechoose materials. I think it was an awful process and I curse unity (?) for making me do this, but life is good again, I really love that you can now buy them in a asset store type thing, substances are amazing. So I reckon I will subscribe, and my game will look sweet, some of them reflect light so nice etc, these have got to be the best materials on the planet, keep adding! Thanks guys, I forgive you for wrecking a day of my life LOL.
     
    Deleted User likes this.
  47. Deleted User

    Deleted User

    Guest

    Thanks very much! We have lots of improvements and updates coming to Substance in Unity. Lots of features we will be adding. Mobile support is on the way now. These headaches will go away : )

    Cheers,
    Wes
     
  48. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    thanks for the encouraging update @wesm

    I'm sure you'll love my 1 millions $ question : do you have an ETA ? ;-)
     
  49. Deleted User

    Deleted User

    Guest


    I'm sorry but I don't haven an ETA I can share just yet. I can say the team is working on it now, so mobile support (iOS and Android) is in development as I type this : )

    Cheers,
    Wes
     
  50. rick_palmer

    rick_palmer

    Joined:
    Nov 23, 2017
    Posts:
    1
    I upgraded to version 2.0.1 and the "M Graph Instance Data" parameters don't appear to be exposed in the Inspector anymore. That was useful to rename the graphs instead of relying on the auto-incremented names from the base. Was that intentional or did I delete something I shouldn't have?

    Is there a more straight forward way to rename the graphs/materials now? Seems like it would be useful to have a right click option to rename the graph when you click on a graph icon in the Substance pane in the inspector. And when a new graph is created by duplicating, it would be nice to immediately be able to type in a new name, rather than be stuck with the _1 (or 2...)

    Thanks