i am useing babylonjs-materials. but have a error
this my code:
How to use babylonjs-materials correctly
i am useing babylonjs-materials. but have a error
this my code:
How to use babylonjs-materials correctly
How do I get water fragment. fx and water vertex. fx these two files
Hello @ShareQiu1994 , how are you doing?
Can you give a little more information about your project? Are you using webpack?
cc @RaananW who is our build GURU
i’ll analyze it and let you know! Seems like something on our side is missing
@srzerbetto yeah, i am useing webpack . this is my code
http://devmodels.oss-cn-shenzhen.aliyuncs.com/devtest/liubofang/code/jinan3D_2.zip
@RaananW okay. Waiting for your message
So, that’s not an issue with babylon, but an interesting feature of es6 modules and the way they are imported.
The UMD packages we offer (which are the ones you are using) are populating the global BABYLON namespace. When you import * as BABYLON from "babylonjs"
you are getting a replication of the BABYLON global namespace, but this package will not be extended when import "babylonjs-materials
is executed.
There are a few different solutions:
window.BABYLON
instead of BABYLON
. This will use the global namespace.import "babylonjs"
. The global BABYLON namespace will be available.thanks, ES6 packages is not suitable for me because the documentation explains it too little. I used the second method slove it