Author Topic: Loading custom shaders from Unity  (Read 3953 times)

Hi there, I just learned about substance painter and was amazing at the tools.  I'd really like to integrate this into my current workflow as the idea of painting to multiple channels at once would save tons of time!

I'm using a custom shader (created with Shaderforge), and I'd like to load this into Substance Painter. 
So I grabbed my .shader file, and dragged it into the "shaders" window in Substance Painter - this didn't work "Shader cannot be imported into this view". 

I'm no shader master, but obviously there's a difference between the shaders that Unity and SP use (.shader vs .glsl).  Is there any way to "convert" my .shader file to one that will work with SP? I could always rewrite it but that's above my knowledge, and with a handful of custom shaders it would take a while...

So is this possible?  Or will this ever be possible?  Any tips?

After seeing this I don't want to go back to photoshop, drawing in 8 different channels all individually.  The ability to use what looks like the best texturing tool with the best shader editor would be amazing :)

Thanks!

Hi there, I just learned about substance painter and was amazing at the tools.  I'd really like to integrate this into my current workflow as the idea of painting to multiple channels at once would save tons of time!

I'm using a custom shader (created with Shaderforge), and I'd like to load this into Substance Painter. 
So I grabbed my .shader file, and dragged it into the "shaders" window in Substance Painter - this didn't work "Shader cannot be imported into this view". 

I'm no shader master, but obviously there's a difference between the shaders that Unity and SP use (.shader vs .glsl).  Is there any way to "convert" my .shader file to one that will work with SP? I could always rewrite it but that's above my knowledge, and with a handful of custom shaders it would take a while...

So is this possible?  Or will this ever be possible?  Any tips?

After seeing this I don't want to go back to photoshop, drawing in 8 different channels all individually.  The ability to use what looks like the best texturing tool with the best shader editor would be amazing :)

Thanks!

Hi,

Yes, the issue is the shader language. The .shader is unity's specific version for their system. Its what they call a surface shader and is written in a language called ShaderLab. It acts as a wrapper for cg/hlsl shader code. Substance Painter works with glsl. You can write a portion of the glsl code which is the fragment shader.  You then save this as .glsl and it will then be able to be imported into SP.

In the SP Help menu, there is a Shader Documentation section which also has sample shaders. Check the samples as it will show you the structure, but you will need to recreate the fragment shader you created in Unity for glsl for Painter.

Cheers,

Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thank you Wes, this clarification is exactly what I needed to help me start in the right direction! :)