How can I make the custom shader stop?

It works on the example project, but when I try it I get the error above

EDIT

Fortunately the issue was easy to figure out. The problem happens if the material doesn’t have a texture, but just a color. How can I make it work with materials that have color only?

EDIT

After some research I found out here that I indeed need a texture to make these shader chunks work (although the original shader worked without it). So I created a 1px by 1px texture and assigned to all diffuse textures of the materials that were missing a texture…and it worked, except for one material that I still get the error for some reason ;_;

EDIT

Any way to make this work without having to have a dummy texture? Somehow check if just the color is available?

EDIT

I give up. Is there a way maybe to make the original shader work while having one of the materials having a diffuse texture with Color Channel: Alpha, instead of the usual RGB? Only one of the materials is like this, the others are RGB. The problem I’m having now is that the original shader works, but because one of the materials uses alpha the dissolve effect doesn’t work properly on that material and it’s very dark. On the other hand the modified shader to use material chunks blow up like I said above. So really the easiest solution for me is enough.

This would be the direction I would go in if you want to use the Standard material. Chances are that you need a dummy texture on the opacity map on the material as it’s the opacity chunk that is giving the error.

Not sure what you are asking here but you can use the old shader with an added parameter to control the overall opacity and change the blendtype of the Basic Material.

I’ve modified my project to allow for this: https://playcanvas.com/project/990841/overview/custom-shader-chunks

1 Like