Extend Shading Dropdown


Is it possible to extend the “Shading” dropdown on the materials with custom shaders? The physical and phong shaders are way too complex for what our game requires. We just need something like an unlit shader for most of the materials we’re going to use.

Also, does an open-source library of custom shaders for PlayCanvas exist somewhere?

If you need an unlit shader, you could use the emissive texture property on the material and untick the lighting, fog etc features under other.

I think PlayCanvas does some optimisations on the shaders pending what properties are used on the material.

Thanks for the reply! If this can be confirmed by the devs, then we would have around 80% of our shading covered by the standard material. That’s nice.

I’m currently looking into the custom shaders tutorial and I’m a little surprised to see everything being generated at runtime. Is there no material object or component in the editor where a custom shader can be tweaked by an artist with visual feedback? If not, then that’s a huge drawback in terms of workflow since we would need both an artist and a programmer to cooperate on materials.

What do you mean by generated by runtime?

In the tutorial, the material is created in the initialize function of a script and all parameters, including the shader, are set here. I would expect the option to have a material component where you select the shader and configure the parameters (similar to the physical shader).

Ah yes. Shader preview isn’t support in the editor but you can create a script that can expose the parameters of the shader in the editor so that can be tweaked at runtime I believe. Not a perfect solution but doable.