Material.shader type mismatch?

Hi!

I wrote a custom shader that I want to assign to a material. I have followed the documentation/tutorial here: Custom Shaders | PlayCanvas Developer Site
which shows the following:

this.shader = new pc.Shader(gd, shaderDefinition);
this.material = new pc.Material();
this.material.shader = this.shader;

But the types in "playcanvas": "^2.7.7" suggest that Material has no shader property. Is this expected?
Screenshot 2025-06-13 at 09.44.47

I am on day one of trying out PlayCanvas, so I did not want to jump the gun and open an issue straight away.

Thanks!

I’ll be updating that document soon, it’s bit obsolete and no longer function. Very sorry about it.

Please see the example here on how to do it:
https://playcanvas.vercel.app/#/graphics/shader-burn

There are multiple other examples there as well.

2 Likes