• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Texture packing with Substance plugin in Unity HDRP 2020.3.12f1

Community Beginner ,
Aug 12, 2021 Aug 12, 2021

Copy link to clipboard

Copied

I am using the Unity Plugin in Unity HDRP 2020.3.12f1 and the Substance Plugin Version 2.5.4 .

I would like to know if there is a way (within the tool or via scripting). to influence the way the plugin is packing its textures.

 

Unbenannt02.PNG

 

For example, even though I pack the height map into the B channel of the Mask. the extra output for the height map on the far right is still beeing created. It would be great to be able to influence this behaviour in some way. Another example for this would be to be able to store information in the alpha channel of the normal map. Things like this. When baking the textures to another folder I end up with extra textures I don´t need or which are not packed the way I need them to be for my project.

 

I also noted an issue regarding reimporting. Whenever I update or reimport an sbsar file using the plugin, material connections on assets get lost or are not rendered correctly (displayed pink even though material is applied). This is especially frustration when working on a big project with lots of modular elements. This happens for different sbsar files all alike.

 

Thanks in advance for your help!

 

Kind Regards,

 

Sebastian

TOPICS
Bugs & Crashes , Question , Unity

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 16, 2021 Aug 16, 2021

Copy link to clipboard

Copied

Any Feedback on this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

Hello defaulth3swyrrc3o0o 

Here are the answers to your questions from one of our developers working on Unity plugin.

Please let us know if you have additional questions or any of the responses are not clear.

 

Question:
"For example, even though I pack the height map into the B channel of the Mask. the extra output for the height map on the far right is still beeing created."
Response:
It looks like the user thinks that the height map should not be generated if it is packed into another texture! This is NOT the behavior expected by Unity.
The shader dictates which of the Substance outputs are used to generate the textures to assign in the corresponding Unity material. These textures are then always generated by the Substance engine, and mapped to the corresponding material entry, as displayed in the "Main Maps" section of the Material Inspector page.
There is no "extra output".

 

Question:
"It would be great to be able to influence this behaviour in some way."
Response:
We're using Unity's "behavior".

 

Question:
"Another example for this would be to be able to store information in the alpha channel of the normal map"
Response:
We don't mess with the normal.
Also, if the normal gets packed, Unity may end up refusing to acknowledge that the texture is actually a normal, thus resulting in a broken normal texture. (Unity does validate the content of normal textures)

 

Question:
"Things like this. When baking the textures to another folder I end up with extra textures I don´t need or which are not packed the way I need them to be for my project"
Response:
There requires texture packing GUI to be changed/evolved.

 

Question:
"I also noted an issue regarding reimporting. Whenever I update or reimport an sbsar file using the plugin, material connections on assets get lost or are not rendered correctly (displayed pink even though material is applied)."
Response:
We need the Substance and assets and the repro steps to check that out.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

"Another example for this would be to be able to store information in the alpha channel of the normal map"
Response:
We don't mess with the normal.
Also, if the normal gets packed, Unity may end up refusing to acknowledge that the texture is actually a normal, thus resulting in a broken normal texture. (Unity does validate the content of normal textures)

 

- we have an inhouse build shader and therefore dont use the unity standard solution. Our shader requires us to pack our textures in a specific way, which is simply not possible with the Substance Plugin, despite the standard options the Plugin provides for the Unity inhouse shader.It would be great to have a way to pack the textures created by the substance plugin in a way that allows us to map them accordingly to our shader solution. Are there any plans to improve the plugin in that regard in the future? Most of all we need a way to influence the RGBA channel packing of the normal map.

 

Thanks in advance!

 

Kind Regards,

 

Sebastian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

Also, is there any way to influence how the textures are named? for example instead of "mask" using the according RGB channel names (for exp. MetalRoughHeight)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

@defaulth3swyrrc3o0o , we do have plans to improve the plugin and will take this into consideration. If this is something we can pick, we will!

 

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Hello Sebastian,

Here is the answer from our developer:

Unity can mess things up if normal channels are tampered with. Suggestion would be to create the normal texture and map it accordingly in the Material Inspector page thus overriding "our" normal texture.

 

In regards to your question about RGB channal names:

The name of a texture corresponds to its graph name + " - " + corresponding output name defined in Designer.ONE EXEPTION: HDRP's "mask" texture. The above is still true, but the "mask" part is always there (because it's automatically generated by the plugin)

 

Please let us know if you have anymore questions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 17, 2021 Sep 17, 2021

Copy link to clipboard

Copied

Regarding the renaming of the Textures. I think the texture endings (basecolor etc.) is corresponding to the output channel choosen in SD under "usage":

 

Unbenannt01.PNG

Unbenannt02.png

 

However as these names are set, it would be better to have the option to choose the name based on the identifier or Label in SD. Not sure if this is changeable but also instead of Mask, a name corresponding to the channel packing would be more diserable for exp "MetalRoughnessHeight" or similar. I know these are small things but especially in a bigger project with lots of Materials, where a clean and straight forward way to name and export textures our of the plugin is crucial, this would be very beneficial to have.

 

A solution I found for our project regarding the normal map is to pack the normal channel (AO to the Blue channel in our case) directly in SD.

 

Regarding theHeight information. I understand that the solo height map is needed for the Unity shader. However, as we don´t use it neccessarly as a single texture in our own shader and pack it into the mask output, generating it twice during texture export (in the mask channel and as an extra height texture) is not disirable for us. more customization options in this direction would really help. 

 

If those and the previous mentioned things could be implemented in one way or another in the future, that would be great.

 

Thanks in advance!

 

Kind Regards,

 

Sebastian

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

The questions of Sebastian are legitimate, in the sens that anyone can develop its own shader i would be awesome to generate textures the way it would it be needed by the custom shader.

For instance we tried using https://assetstore.unity.com/packages/vfx/shaders/better-lit-shader-2021-207262 with substances and they have actually different options of using packed textures so it quite fails. I'm not sure it's a complicated task to allow to customely pack and rename the textures. This would leverage A LOT of work.

Thanks for you feedback and possible work on this.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

https://substance3d.adobe.com/documentation/integrations/generated-textures-packing-170459638.html This doesn't serve your use case as you are working with custom shaders, am I right? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2023 Nov 07, 2023

Copy link to clipboard

Copied

Hi,

I think the creator of the thread is right. The output of the "mask" is hard-coded which is okay up to a point. I am missing the option for a terrain layer mask, this has the heightmap in the blue channel of the mask and not the detail map.

If you dig through the code for a few hours you can code this into the plugin yourself.

It would be nice if the plugin got an option for "Terrain Layer Masks" in the future

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 14, 2023 Nov 14, 2023

Copy link to clipboard

Copied

Hi @Imperatoss , I'm trying to see if I can create this request into an actionable ticket for our engineers. If I understand correctly the ask is to be able to pack the different outputs generated by the plugin into the the red, green, blue, or alpha channels of another output or a new generated output (and being able to rename and define this output)? Currently it looks like we are only packing into Alpha channels.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 15, 2023 Nov 15, 2023

Copy link to clipboard

Copied

LATEST

Hi @Aldo_3D 

The plugin in Unity creates textures based on the selected shader. In HDRP it is hardcoded in the code how the mask texture is created, there the detail mask is added in the blue channel at the mask, so far everything is correct.

I often use the textures for terrains. There is no detail mask there, but the blue channel contains the heightmap.

 

The way you described it is correct and would be a nice feature. A way to create a custom map where you manually select the inputs. With the mask, there is currently no way to set a custom input in HDRP mode.

 

It would be a really cool feature if you could switch from the material to the terrain layer in the Substance Graph, so that you only have the textures you need and no unnecessary material and texture outputs, since you often only use the textures for terrains.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation
Download Latest Versions