This error shows on Chrome, and it seems to happen while the spotlight’s projectionTexture hasn’t yet finished loading, and there is a mesh without a texture:
ProjectionTexture? Cooooool. I didn’t know there WAS such a thing. Ok, everyone sit down on the couch… and I’ll show slides from my vacation in North Dakota. Do we need a square-shaped spotlight?
I wrapped reg-b4-render in a scene.onReadyObs (lines 32/38). Any change in issue on your end?
Possibly improper texture isReady stuff in the projectionTexture? hmm. One would suspect that it uses the same loader as everything else… but perhaps not. (I’m not much help, am I? Sorry)
The projection playground can be found under “examples” > “Lights” on the playground as “Light projected texture”, and there’s more where that came from!
The wrapper doesn’t solve it, because the registerBeforeRender stuff is actually irrelevant code left in from the original playground (my bad, I should have made a minimum repro). It does work when the spotlight is added after the projection texture has done a onReady though.
You’re probably right about it being an isReady problem, but I don’t think it’s with the projection texture, since it works just fine if the meshes in the scene have a texture.