[SOVLED] TypeError: Failed to execute 'uniform2fv' on 'WebGL2RenderingContext': No function was found that matched the signature provided

I am working on a project to make WebGL 2 code works on playcanvas. However, I meet this error.

Here is the project link. Someone helps me plz :confounded:.

Hi @kprimo,

I think you mean WebGL2 with GLSL 3 ES code. That’s a huge shader that you are trying to implement in Playcanvas from shadertoy.

Rarely it will work without changes. The error indicates there is a missing uniform somewhere which I can’t track it sorry. Usually the approach I take with this kind of shaders is build them line by line to make sure I don’t get any errors.

Start by adding all uniforms, then method by method until the main() method of the shader can execute with no errors thrown.

1 Like

Thanks for your reply. Actually I do have modified the shader code to make it won’t execute with errors(on shader). Finally I got this error :joy:.

Here is the link of the shadertoy demo which I am trying to modify.

The shader code doesn’t reply errors now, thus I cannot find out where to debug.

found something about this: https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform

wtf, I got it! The type is wrong when assigning a value to a variable named ‘uMouse’. I’m so stupid
:woozy_face:! Now it runs well!

3 Likes

Very cool. ShaderToy. Something else for me to try to find time for. :^)

1 Like