Page 1 of 1

Substance materials

PostPosted: Thu Aug 03, 2017 7:42 am
by joelrowney
ive found the implementation of substances to be quite problematic when it comes to multi material substances. having the substance material specifically chosen in the shader means different instances of the shader cant be used for sub materials of the same substance. (unngghhh, my brain hurts) Also having to also assign the input textures (which may or may not actually show in the selection dialogue) which are already implicitly assigned in the shader. Would maybe having a dialogue option on a texture node that allows you to assign the usage of the texture "IF" the shader were to be assigned to a substance, work better? would this make the usability similar to the default unity shader that fills in the substance output textures as expected when its used in whatever substance material its been assigned to?

Re: Substance materials

PostPosted: Thu Aug 03, 2017 10:04 am
by Amplify_Borba
Hello Joel, thank you for getting in touch and for using Amplify Shader Editor!

joelrowney wrote:ive found the implementation of substances to be quite problematic when it comes to multi material substances. having the substance material specifically chosen in the shader means different instances of the shader cant be used for sub materials of the same substance. (unngghhh, my brain hurts)


Unfortunately, that is the current implementation we have at the moment, it's aimed at single substance material use.
We are, however, open to any and all suggestions.

In order to avoid any possible misunderstanding, can you provide us a sample of the substance setup that you intended to use?

joelrowney wrote:Also having to also assign the input textures (which may or may not actually show in the selection dialogue) which are already implicitly assigned in the shader. Would maybe having a dialogue option on a texture node that allows you to assign the usage of the texture "IF" the shader were to be assigned to a substance, work better? would this make the usability similar to the default unity shader that fills in the substance output textures as expected when its used in whatever substance material its been assigned to?


Since we can't predict how shaders are going to be constructed, it could be a bit tricky. The user could simultaneously use the shader in a substance and a standard material. There's currently no way to control how that could be used.

In what circumstances were you unable to access the substance textures?

Looking forward to your reply!

Re: Substance materials

PostPosted: Thu Aug 03, 2017 1:40 pm
by joelrowney
Thanks for your response.
i`m creating a planet generator from a spherised cube and using 6 materials in the substance to map to map images on each "face"
https://drive.google.com/open?id=0B6pMRD0-wflvOFBUcWpheVZsZjQ

i have a script to transfer settings between each sub materials substance settings. the default shader finds the correct substance maps for each material and works as expected. i am looking to replace the standard shader used in this with a amplify shader that would allow me to add further effects and access maps in alternative ways (for this i need to set the substance to generate all outputs).
i havent had much time to fault find this process, but once i add a newly made amplify shader to any material and add the reference in the shader, when i compile it and return to the unity editor to add the textures into the texture slots, the textures specified in the shader itself (and only those textures) are not available in the texture dialogue. i was wondering if i should consider making either specific shader functions for each substance material that can be accessed and switched between in a single shader, or duplicate the whole shader with duplicate substances (rather than sub materials)?

Re: Substance materials

PostPosted: Thu Aug 03, 2017 2:47 pm
by Ricardo Teixeira
joelrowney wrote:Thanks for your response.
i`m creating a planet generator from a spherised cube and using 6 materials in the substance to map to map images on each "face"
https://drive.google.com/open?id=0B6pMRD0-wflvOFBUcWpheVZsZjQ

i have a script to transfer settings between each sub materials substance settings. the default shader finds the correct substance maps for each material and works as expected. i am looking to replace the standard shader used in this with a amplify shader that would allow me to add further effects and access maps in alternative ways (for this i need to set the substance to generate all outputs). i havent had much time to fault find this process, but once i add a newly made amplify shader to any material and add the reference in the shader, when i compile it and return to the unity editor to add the textures into the texture slots, the textures specified in the shader itself (and only those textures) are not available in the texture dialogue. i was wondering if i should consider making either specific shader functions for each substance material that can be accessed and switched between in a single shader, or duplicate the whole shader with duplicate substances (rather than sub materials)?



No problem, thank you for the sample.

Generating Outputs is a requirement, else they wont be visible. You can think of the editor has a sort of helper, you can build shaders but they depend on the available data. Unfortunately, I don't think that the type of automation that you are looking for is currently possible.

In your case it might be simple and more efficient to duplicate the substance and shader, Shader Functions would not be ideal for this particular case.

Can you walk us through your process? We would love to know more about your requirements and your 4 Substances setup, we might be able to provide some additional tips, not necessarily related to ASE.

Thanks!

Re: Substance materials

PostPosted: Fri Aug 04, 2017 9:24 am
by joelrowney
Thank you for your interest.

the goal of the part of the the project i`m working on is to be able to generate a procedural solar system. this will be attached to a procedural star generator and Galaxy system for the game "Galaxy in Flames" by Mjolnir Software http://mjolnirsoftware.com/

the planets are currently cube mapped cubes that have been deform to spheres.
Image
this is to fix various mapping problems caused by deforming uv`s to a sphere.

Each "face" has its own material id and is has planar 0,1 uv`s like a standard cube (but of course now the mesh is a sphere)
The substance for rocky planets (and a separate one for gas giants) has a switch which tells the substance which projection to generate. this switch is incremented on each material face (cubeframe value in the below image)
Image

I use a script to set the values in each of these materials so they match and can be edited in 1 place.
Image
i have a mapping issue at the seams between each material that i believe is due to a problem with the mesh tangent normals
Image
i am looking into either generating better tangent normals on the imported model from 3dsmax, or generating the sphere its self in code and generating all the mapping and normal data in code (top image).

I am using the standard shader at the moment. It works fine for the rocky planet, but i would love to use ASE to give the jovian planets a more "gassy" look. layered and voluminous.
Image
Re your advice i will try using a shader per face. i am thinking putting the main part of the shader into a function put the substance node reference in the face specific shaders. this i think will allow me to make develop the shader in a single place and then just recompile each shader to update them all, rather than editing each or copying code. your recently implemented shader tabs should make this fairly painless :D thank you.

you may also be interested in my current galaxy setup which uses ASE to produce a voluminous galaxy using geometry to create slices.
Image

and the internal galaxy which also uses ASE exclusively Image

Re: Substance materials

PostPosted: Fri Aug 04, 2017 11:06 am
by Ricardo Teixeira
joelrowney wrote:Thank you for your interest.

the goal of the part of the the project i`m working on is to be able to generate a procedural solar system. this will be attached to a procedural star generator and Galaxy system for the game "Galaxy in Flames" by Mjolnir Software http://mjolnirsoftware.com/

the planets are currently cube mapped cubes that have been deform to spheres.
Image
this is to fix various mapping problems caused by deforming uv`s to a sphere.

Each "face" has its own material id and is has planar 0,1 uv`s like a standard cube (but of course now the mesh is a sphere)
The substance for rocky planets (and a separate one for gas giants) has a switch which tells the substance which projection to generate. this switch is incremented on each material face (cubeframe value in the below image)
Image

I use a script to set the values in each of these materials so they match and can be edited in 1 place.
Image
i have a mapping issue at the seams between each material that i believe is due to a problem with the mesh tangent normals
Image
i am looking into either generating better tangent normals on the imported model from 3dsmax, or generating the sphere its self in code and generating all the mapping and normal data in code (top image).

I am using the standard shader at the moment. It works fine for the rocky planet, but i would love to use ASE to give the jovian planets a more "gassy" look. layered and voluminous.
Image
Re your advice i will try using a shader per face. i am thinking putting the main part of the shader into a function put the substance node reference in the face specific shaders. this i think will allow me to make develop the shader in a single place and then just recompile each shader to update them all, rather than editing each or copying code. your recently implemented shader tabs should make this fairly painless :D thank you.

you may also be interested in my current galaxy setup which uses ASE to produce a voluminous galaxy using geometry to create slices.
Image

and the internal galaxy which also uses ASE exclusively Image



Thank you for the additional information, it's seems to be an amazing project! I wish that we had some tips for you but we are not entirely sure what else to recommend. Do keep us posted, we would be happy to help if you have any questions or if you run into any issues.

The galaxy looks awesome, we would love to promote your project as soon as you are ready to make it public.

Thanks!

Re: Substance materials

PostPosted: Fri Aug 04, 2017 7:06 pm
by joelrowney
:D Ha, no worries. i`m sure i`ll be back with more questions as we go. its a big project for a small team. Would you be happy for us to advertise the usage of ASE and other Amplify assets on this project?

Re: Substance materials

PostPosted: Mon Aug 07, 2017 11:19 am
by Ricardo Teixeira
joelrowney wrote::D Ha, no worries. i`m sure i`ll be back with more questions as we go. its a big project for a small team. Would you be happy for us to advertise the usage of ASE and other Amplify assets on this project?


Sounds like a good challenge, we really look forward to seeing what you create. Any promotion on your side would be very welcome, let us know if we can do the same on our side when your project(s) is available to the public.

Be sure to also post your questions in the official ASE Unity forum thread, the community is very responsive.

Thanks!