Author Topic: What's Possible with a Custom GLSL Shader in Painter?  (Read 1301 times)

It's not completely clear to me what exactly is possible with Substance Painter's customizable GLSL shader. I understand that this is a GLSL API with limited scope, and a library of useful tools to help us achieve more advanced shaders in the viewport - but is it limited to just the basic Metal-Roughness and Specular outputs?

For example, in the Surface Shader API page of the documentation, a list of functions is provided that gives us some level of access to the BSDF/Fragment Shader. Is this list the only outputs we're able to send to the GL Frag?? So do I have a limited BSDF?

The functions listed are:
  • alphaOutput
  • diffuseShadingOutput
  • specularShadingOutput
  • emissiveColorOutput
  • albedoOutput
  • sssCoefficientOutput

There's only one 'specularShadingOutput' - so does this mean I'm only able to have one layer of Specularity in the BSDF? What if I wanted to add a second specular BSDF layer, say for clear coat or sheen? I know that Adobe has provided a Clear Coat shader - however, is this something I could re-create myself with the Shader API? Or is the API too limited?

Thanks in advanced!

Well I continued to try to play around with what's possible in the GLSL. Considering my goal is to add more specular BSDF layers to the material, I don't believe there's much I can do in Painter's Shader API to achieve this.

As a work around, I just created a new viewport shader which grabbed my custom MDL. My MDL sources the 'user0-4' channels to render the sheen and clear coat effects. So, my workflow right now is to author layers in those channels, then in order to view their effects, I have to switch to the Iray viewport renderer.

It's not the ideal workflow, but it may be the only way I can replicate the shader effects from my renderer without more access to the Fragment Shader through the Shader API.