HugoMcPhee Posted March 25, 2015 Share Posted March 25, 2015 In a blender scene one of the character meshes has an armature with an animation.After exporting to a .babylon file and loading it, if the character with the skeleton armature is visible when the scene starts , the animation plays and the scene works as normal,If the camera is facing away from the animated character when the scene starts this error occurs Uncaught TypeError: Failed to execute 'uniformMatrix4fv' on 'WebGLRenderingContext' : No function was found that matched the signature provided.(using nw.js based on Chromium 41.0.2272.76.) This is how the scene is loadedBABYLON.SceneLoader.Load("", "TheBlenderScene.babylon", engine, function (newScene) { newScene.executeWhenReady(function () {It's happened in 3 projects, my current workaround has been to include all the animated meshes in the view when the game starts.Has any one else has had this problem, or have an idea of how to avoid the error? thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 25, 2015 Share Posted March 25, 2015 can you share it somewhere? Quote Link to comment Share on other sites More sharing options...
HugoMcPhee Posted March 26, 2015 Author Share Posted March 26, 2015 Yep here's two test scenes that reproduce the error. Although I found it only happens when "Variance" shadows are enabled (from blender), otherwise it works,so it looks like varience shadows are causing the error Here's a scene with two animated object in view: http://mywobsite.x10.mx/armaturetest/index1.html And here's the identical scene with the camera facing away from the animated objectshttp://mywobsite.x10.mx/armaturetest/index2.html This is what the blender setup looks like Here's a zip with all the files (including the blender file)http://mywobsite.x10.mx/armaturetest.zip Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 26, 2015 Share Posted March 26, 2015 The skeleton's transformation matrix is not calculated, since prepare is (probably) called only when a camera is targeting the object.Adding athis.prepare();//make sure it will recalculate the matrix next time prepare is called.this._isDirty = true; at the end of the Skeleton's constructor solved the issue.@DK - Pull Request follows in a sec. The isDirty = true is actually optional, it works well without it. It is there just to make sure it works as before, just with matrix initialization. HugoMcPhee 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 26, 2015 Share Posted March 26, 2015 Ok thanks a lot Raanan Quote Link to comment Share on other sites More sharing options...
HugoMcPhee Posted March 26, 2015 Author Share Posted March 26, 2015 Thanks heaps for that Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 6, 2016 Share Posted December 6, 2016 This seems to be broken (again?) - i am using the 2.5 beta from github (downloaded yesterday). And I get exactly this problem right on startup: (I do have a character with a skeleton in the scene and I have a shadowGenerator active on this character. But the character get's moved into view.) Uncaught TypeError: Failed to execute 'uniformMatrix4fv' on 'WebGLRenderingContext': No function was found that matched the signature provided. Engine.setMatrices Effect.setMatrices renderSubMesh ShadowGenerator._shadowMap.customRenderFunction RenderingGroup.render RenderingManager.render RenderTargetTexture.renderToTarget RenderTargetTexture.render Scene._renderForCamera Scene._processSubCameras Scene.render (anonymous function) Engine._renderLoop Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 6, 2016 Share Posted December 6, 2016 Calling this.character.skeleton.prepare() explicitly fixed the problem for me - so thank you very much for this thread and the solution @RaananW ! @Deltakosh Since the fix was the same, this bug really seems to be reintroduced (or the pull request wasn't merged - I have not checked into that.) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 6, 2016 Share Posted December 6, 2016 This works here: http://www.babylonjs.com/Demos/Bones/ Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 7, 2016 Share Posted December 7, 2016 @Deltakosh Playground that reproduce error and the fixes described in this thread: (To see the error the browser console has to be opened before pressing run, I am using the latest chrome) Error: http://babylonjs-playground.com/#1NXQVV#0 No-Error: http://babylonjs-playground.com/#1NXQVV#1 The only change: Not rotating the Camera by Math.Pi on Y-Axis. (Which brings the animated mesh back into view of the camera). No-Error 2: http://babylonjs-playground.com/#1NXQVV#2 This time camera is still rotated (mesh out of view) but .prepare() is called on the skeleton, this also fixes the error. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 7, 2016 Share Posted December 7, 2016 Working on it jpdev 1 Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 7, 2016 Share Posted December 7, 2016 Thank you David, really appreciate it! Trying to get to know babylon good enough, so I can use it next weekend for a ludum dare submission. (And this is by no means a breaking bug - but if I hadn't found this thread I would have been pretty confused what causes it.) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 7, 2016 Share Posted December 7, 2016 I cannot test the file you used (the bird) seems offline Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 7, 2016 Share Posted December 7, 2016 But I think I fixed the issue Quote Link to comment Share on other sites More sharing options...
jpdev Posted December 8, 2016 Share Posted December 8, 2016 Thanks again David. I am sorry, I upadted my fly game and forgot about the .htaccess file (which enables cross server requests so that the playground may load the bird). It is now working again, and the error is gone! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2016 Share Posted December 8, 2016 So this is perfect Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.