Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stefan

Pages: [1] 2
1
I need to have control of the textures that substances generate, but when I set the "Components" to "RGB" and "Usage" in Substance Designer to "Any" and import the substance in Unity, the textures are generated as grayscale/Alpha8 textures.

How can I force all outputs to be the format that is specified in Substance Designer?


2
Thanks for the info Wes, good that it's on your radar. The Unity API script reference and examples are very rudimentary, the GetGeneratedTextures() method isn't documented there from what I can see. It would be very useful if it was documented a bit more.

3
When I use:

Code: [Select]
SubstanceGraph _substanceGraph = _proceduralMaterial.Duplicate();

and then at a later time I do the following:

Code: [Select]
               
_proceduralMaterialMaps.QueueForRender();
_proceduralMaterialMaps.RenderAsync();
_textureMaps = _proceduralMaterialMaps.GetGeneratedTextures()[0];
_material.SetTexture("_TexMaps", _textureMaps);

I a yellow corrupt texture.

See attached picture.

I tried to also tried doing RenderSync() as well as doing GetGeneratedTextures() after a delay, but the textures are always yellow/corrupt.

Any ideas how to fix this?

4
Licensing aside, my main concern is the substance support in engines like Unity. I am a huge fan of the Substance technology, Substance Designer and Painter. Since the native integration of substance in Unity was dropped and the replacement plugin is struggling still being in a beta a year later I'm concerned about the future from a technology perspective. Substances have been essential for me to generate procedural planet surfaces but I have been unable to release the asset for Unity 2018.x and remembering the journey of Mixamo into Adobe I fear this will follow the same path.

5
I upgraded to 2018.3 to test some more and I also updated to your latest plugin as of what is available today.

When I import a .sbsar I get this Warning:
Code: [Select]
Identifier uniqueness violation: 'Gas_Storm - normal'. Scripted Importers do not guarantee that subsequent imports of this asset will properly re-link to these targets.
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

The .sbsar then imports, but when I go to press the + icon  to create duplicate instances I get the following errors:

Code: [Select]
InvalidOperationException: The object Gas_Storm - normal was already added to the context.
Substance.Editor.SubstanceImporter+<>c__DisplayClass61_0.<OnImportAsset>b__0 (UInt32 pOutputHash, Int32 pFormat, Int32 pChannelsOrder, Int32 pWidth, Int32 pHeight, Int32 pMipCount, IntPtr pPixels, Int32 pPixelLength)
Substance.Editor.SubstanceImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at C:/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:20)
UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

AssetImporter is referencing an asset from the previous import. This should not happen.
UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


AssetImporter is referencing an asset from the previous import. This should not happen.
UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Asset import failed, "Assets/Procedural Planets/Materials/Gas/Gas.sbsar" > InvalidOperationException: The object Gas_Storm - normal was already added to the context.
Substance.Editor.SubstanceImporter+<>c__DisplayClass61_0.<OnImportAsset>b__0 (UInt32 pOutputHash, Int32 pFormat, Int32 pChannelsOrder, Int32 pWidth, Int32 pHeight, Int32 pMipCount, IntPtr pPixels, Int32 pPixelLength)
Substance.Editor.SubstanceImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at C:/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:20)
UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Here's the .sbsar I try to import: https://www.dropbox.com/s/25929tpqdarvgye/Gas.sbsar?dl=0 - I have published it with the most recent version of Substance Designer.

After the error message above the substance no longer has a red substance icon or any children, but it's just a generic white icon and not recognized as a substance: https://www.dropbox.com/s/0ab8upaqq6pmlvj/brokensubstance.PNG

Update: I should also mention that that .sbsar has two normal maps that it generates, one with identifier "CapNormal" and the other one with identifier "BodyNormal".

6
Substance Integrations - Unity - Re: Consistent updates?
 on: January 16, 2019, 01:59:07 pm 
Thanks Wes for describing what goes on behind the scenes so we can get an idea of what's going on. I am surprised that the decision was made so hastely to drop the native support of Substances leaving 2017.3 because it really worked well. I mean, I would have loved higher resolution output, GPU, and 16 bit/channel support and I thought that was what was in store when moving to a separate "more rapidly" developed plugin to incorporate the features that Substance is capable of. Never would I have dreamed of that it would be a struggle as you describe with the limited and changing C# API that you have to adhere to.

Just when Unity 2017.3 was released I relesed an asset that I had been working on for 2 years. It relies on Substances to generate planet textures that a custom shader utilizes to assemble very high resolution planets. I had not been able to create them withouth the Substance technology and Substance Designer. Unfortunetely, a year has passed and the API is still lacking basic features (until very recently even to get the generate texture, as well as getting a callback when a texture has finished generating). On top of that, the instability between Unity version and a heap of what nearly appears as random errors are generated as I try to duplicate material instaces and the sbsar-imports become corrupted.

For me, this means that any customer of mine that uses Unity 2018.x is lost. And in the world of assets people upgrade rapidly to later versions of Unity so I couldn't have timed my release of my asset at any worse time. I receive weekly questions when my asset can support Unity 2018 and during the first 6 months I was positive and highlighted the eventual benefits of you guys being in control of the features so we could utilise the full potential of Substance. Now, unfortunately, all I can say is that I have no ETA and that the substance plugin is still in beta, that it's too unstable, and that it lacks the necessary API-functionality for me to be able to update my asset.

This is a shame because Substance Designer and Substance Painter are truly amazing products and the Substance technology itself too. Unrivalled from my point of view.

Considering the lessons learned, and that you have to work with your hands tied behind your back with API restrictions - couldn't it be reevaluated to go back to natively supporting Substance in Unity? That really, really, worked well according to me. Also, how does the Unity integration differ with UE4 for example? Do you experience similar problems there?

7
I import a sbsar and I try to add an instance of the substance graph, so I press the + icon and then apply. The sbsar in Unity breaks (white icon) and I get this error message:

InvalidOperationException: The object Gas_Storm_normal was already added to the context.
UnityEditor.Experimental.AssetImporters.AssetImportContext.AddObjectToAsset (System.String identifier, UnityEngine.Object obj) (at C:/buildslave/unity/build/Editor/Mono/AssetPipeline/AssetImportContext.bindings.cs:37)
Substance.Editor.SubstanceImporter+<>c__DisplayClass49_0.<OnImportAsset>b__0 (UInt32 pOutputHash, Int32 pFormat, Int32 pChannelsOrder, Int32 pWidth, Int32 pHeight, Int32 pMipCount, IntPtr pPixels, Int32 pPixelLength)
Substance.Editor.SubstanceImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at C:/buildslave/unity/build/Editor/Mono/AssetPipeline/ScriptedImporter.cs:19)
UnityEditor.AssetImporter:SaveAndReimport()
Substance.Editor.InspectorSubstanceBase:ApplyOrRevertChanges(Boolean)
Substance.Editor.InspectorSubstanceBase:DisplayRevertApplyGUI()
Substance.Editor.InspectorSubstanceGame:OnInspectorGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Using Windows 10, Unity 2018.1.0f2 (64bit) (I am making assets for Unity hence not the latest 2018.x build).

8
With the known issues, what does this actually mean? "Substance materials are not persistent when exported/imported using a Unity package".

If I create a Unity Package and include substance graphs with multiple instances, are those OK, or is it just the property values that are not persistent?

9
Still no success on this for me. @Allegorithmic - how do we find out if a SubstanceGraph is processing?

Hi Stefan,

We don't currently have a function for this in the API. The API is till being worked on but we are looking at adding this functionality in a future update where you can use a function to check to see if a substance graph is queued/processing.

Cheers,
Wes

Ok, thanks for response and for confirming. Hope to see it added - I use it for progressively updating textures in my procedural planets so it waits for processing to finish before moving on to the next resolution. I also use it for callbacks so people using my procedural planets can be sure that a planet has been generated in case they want to hide it or use cut scenes while it is being generated.

10
Still no success on this for me. @Allegorithmic - how do we find out if a SubstanceGraph is processing?

11
How do I reference the generated textures?

In native Unity2017.x I used ProceduralMaterial.GetGeneratedTexture
 (https://docs.unity3d.com/2017.1/Documentation/ScriptReference/ProceduralMaterial.GetGeneratedTexture.html)

12
Thanks for replying. I did see something in the cpp about a callback but the API documentation is more of a meta shell rather than describing anything and providing examples which is what I usually rely on.

Unfortunately I really can't just QueueForRender() and then wait because my planet texture build process is relying on sequentially building textures using the same SubstanceGraph and then copying textures before building the next one.

I see this in the documentation:
Code: [Select]
cppSetCallbacks()
static void Substance.Game.NativeFunctions.cppSetCallbacks ( System.IntPtr log,
System.IntPtr texture,
System.IntPtr graphInitialized
)

...but I'm not sure how to use it. Any suggestion would be appreciated. I guess this should enable me to get a callback when a graph is initialized (does that mean finished building?) and what do I do with a System.IntPtr? =)

13
I'm upgrading my asset to use the new plugin in Unity 2018.1 and I can't find a replacement in the API for ProceduralMaterial.isProcessing - does anyone know how to check the new Substance.Game.SubstanceGraph if it's currently rebuilding any textures?

14
Substance Integrations - Unity - Re: Unity 2018.1 Support
 on: January 14, 2018, 11:30:39 pm 
Hello. I'm also interested to find out more about this. I've built an asset over the course of 2.5 years based solely on procedural materials so finding out it's deprecated when my asset has just been released is a bit disconcerting. At the same time, I hope that it can bring 4k+ textures, GPU and 16 bit/channel support. As Rowlan asked, will it be free (I suspect and hope it will be as it is with UE4 I believe) and will it be smooth for users to enable substance support?

I would also be very interested in a beta as soon as possible so I can have a chance to offer 2018.x support as soon as it becomes publicly available.

15
Will you post here when the fix is published? Just ran into this issue today and it caught me off guard. Glad I found this post to describe the situation.

Pages: [1] 2