GrandSchtroumpf Posted March 5, 2017 Share Posted March 5, 2017 Hello Guys, I am developing a game with Angular2 and Bablyon.js. So far no problems, but I recently used the Water material and I couldn't add it to my mesh : var waterMat = new BABYLON.WaterMaterial("waterMat", newScene, new BABYLON.Vector2(512,512)); waterMat.bumpTexture = new BABYLON.Texture("assets/scenes/home/img/water.png", newScene); water.material = waterMat; //water is a plan mesh I downloaded it from the Babylon.js Generator, and when I the console told me : "Unable to load src/Shaders/water.vertex.fx" I tried to change the Shader Repository, but it didn't change the error. So I assumed it' not linked to that. BABYON.Engine.ShadersRepository = "../Shaders"; I tried with a stand-alone project, and it worked perfectly. I have no idea where the error come from, and where to add this "water.vertex.fx" file ... BTW : I import my BABYLON with require in node_modules. Thank you for your help =) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 6, 2017 Share Posted March 6, 2017 hello! Watermaterial.js should come with its shader definition. Can you link here the babylon.js file you are using? Quote Link to comment Share on other sites More sharing options...
GrandSchtroumpf Posted March 8, 2017 Author Share Posted March 8, 2017 I am using the one generated from this page: http://babylonjs.com/versionBuilder/ with only "Water Material" checked. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 9, 2017 Share Posted March 9, 2017 Hum..the file seems ok can you publish your page somewhere so I can check? Quote Link to comment Share on other sites More sharing options...
GrandSchtroumpf Posted March 9, 2017 Author Share Posted March 9, 2017 Sure, here it is :http://www.noom-game.eu And the working example :http://www.oktopure.com/mountains.html BTW : by putting it online the console gives me others errors (that I don't understand either ^^) Thank you for your help. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 9, 2017 Share Posted March 9, 2017 Hello I cannot help with too many errors can you isolate only the bjs error? Quote Link to comment Share on other sites More sharing options...
GrandSchtroumpf Posted March 10, 2017 Author Share Posted March 10, 2017 Sorry, I only see BJS error on my console (see image) ... Or WebGL warnings that are links to BJS I suppose. Thank you for your help anyway . I'll try to figuring out what's going on =) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 10, 2017 Share Posted March 10, 2017 can you use babylon.max.js to ease debugging? Quote Link to comment Share on other sites More sharing options...
GrandSchtroumpf Posted March 10, 2017 Author Share Posted March 10, 2017 Of course, but if I take the babylon.max.js I won't have the water material inside isn't it ? How can I add it to the BABYLON object then ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 13, 2017 Share Posted March 13, 2017 You can find any individual material here: https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview release/materialsLibrary Quote Link to comment Share on other sites More sharing options...
GrandSchtroumpf Posted March 14, 2017 Author Share Posted March 14, 2017 Ok, thank you =). I'll check how to add this material to my element directly. 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.