Hey @albertos - that’s a really nice idea, to use a cookie texture to project the character locator onto the ground. However, using one spot light per character seems a bit excessive to me. That’s going to be quite expensive on mobile. A fragment shader that has to process 6 spot lights per pixel is gonna be quite slow on lower end devices especially.
For this particular problem, I suspect you are running out of texture image units in the fragment shader. For six spotlights with cookie, the fragment shader will need to use 6 texture units for the cookies, leaving just two. So if you’re rendering a mesh with, say, a diffuse map, normal map and gloss map, you’ll exceed 8 and the fragment shader will fail to compile. There’s not a great way around this. But maybe one suggestion would be to just start ignoring cookies after the texture units run out rather than just going ahead and generating a shader than won’t compile.
Feel free to log an issue here:
Maybe call it “Shader chunk system can generate shaders that exceed WebGL device limits”.