Was #include<instancesDeclaration> ever needed in the fragment shader?

The following works in 4.2,1 and earlier versions of 5 (I think):
(https://playground.babylonjs.com/#V9ZICI#3)

The shader isn’t compiling in 5.29.0.

I removed the line:

#include<instancesDeclaration>

in the fragment shader (it’s still in the vertex shader) and everything worked.

I just “cleaned up” all my forum links to playground entries that had this extraneous line. Merry merry! :slight_smile:

It’s a mistake to use #include<instancesDeclaration> in the fragment shader, it should be used only in the vertex shader.

If it works in earlier version of Babylon.js, it is only because of some lucky side effects, you should not rely on it.

1 Like