As I work on expanding a JS game utilizing Three.js as an API, a recent issue has arisen in the form of the following error:
TypeError: Argument 2 of WebGLRenderingContext.uniform4fv could not be converted to any of: Float32Array, UnrestrictedFloatSequence.
The problematic line in the code is the basic render call for the game:
renderer.render(scene, camera);
I won't delve into sharing the messy code here; that's not my purpose. I'm hoping someone out there has encountered this before and can shed light on what might be causing it.
Note:
I. The original error originates from within Three.js (The internal rendering logic)
three.min.js:7:118
II. The first frame renders without issues, but subsequent frames trigger the error
III. The scene consists of simple objects, with a particular object being the source of trouble:
this.geometry = new THREE.PlaneGeometry(0.8, 0.8);
this.texture = new THREE.TextureLoader().load("graphics/racers/" + racer + ".png", function () { return;});
this.texture.generateMipmaps = false;
this.texture.minFilter = THREE.NearestFilter;
this.texture.magFilter = THREE.NearestFilter;
this.texture.repeat.set(0.25, 1);
this.material = new THREE.MeshBasicMaterial({ map: this.texture, transparent: true });
this.mesh = new THREE.Mesh(this.geometry, this.material);
scene.add(this.mesh);
If you require more information, don't hesitate to ask.
Thank you in advance!
EDIT: I've discovered that the error only pops up when the Mesh Object mentioned earlier is visible to the camera!