Ingo Chou Posted October 22, 2015 Share Posted October 22, 2015 Hi, I create effect with API : var eff = engine.createEffect("shader/myfx", ["pos","nor","uv"], ["wmat", "vmat", "pmat"], ["bumpsamper", "diffsamper"], ""); if(!eff.isReady()) {return false;} But failed. It always returns false; What causes it? How can I get the error information ? Thanks for any help? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 22, 2015 Share Posted October 22, 2015 First, it looks like createEffect is asyncronous, because it is loading files, then compiling. Your code is not valid. You need to assign callbacks to the createEffect() method:https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L1236 2nd, the effect is passed in the callbacks, so you could check getCompilationError() method:https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/babylon.effect.ts#L142 Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 23, 2015 Author Share Posted October 23, 2015 Thanks for your reply! I set onCompiled callback and onError callback like this: engine.createEffect("shader/myfx", ["pos","nor","uv"], ["wmat", "vmat", "pmat"], ["bumpsamper", "diffsamper"], "", function(){alert("compiled")}, function(){alert("error")} ); But the callbacks have never been called. And it's state is always NOT READY. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 23, 2015 Share Posted October 23, 2015 Hello the best way to be able to help you is through the playground Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 26, 2015 Author Share Posted October 26, 2015 OK, thanks. 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.