I’m creating a scene where a plane with a water material is supposed to fill a number of pools and channels in a ground mesh. My own attempts to create water with a PBR material or import something from Blender were poor, so I tried to use the Babylon.js water material.
When I apply the material to the plane, however, the mesh is simply not visible. From moving the camera, which is subject to gravity and collison checking, I can see that it’s still there and collides with the camera ovoid.
I don’t receive an error message in the console, so I guess my code can’t be too wrong. Here’s the relevant code section:
var waterMaterial = new BABYLON.WaterMaterial(“water_material”, scene);
waterMaterial.bumpTexture = new BABYLON.Texture(“materials/Water_001_NORM.jpg”, scene);
Yes , … but then (just to make this clear) you do not need to push’em one-by-one, of course. You can add them all at once. **
You can also include an identifier in your meshes name or id to have them render as a mirror on the watermat.
May be you also want to check the other water materials created from NME. There are a few nice ones you could use as a base. Meanwhile, have a great day
**Edit: Apologies. That does not work. Old material does not have a renderList, only add (Don’t know why)
thanks for the hints. But I simply can’t get it working.
I added the water plane, the skydome and all ground meshes to the render list, but the material is still invisible.
Could the problem be the bump map? What do I need here? I have used the normal map of a pbr water material, but I’m beginning to think that was wrong. Do I need a greyscale texture?
The water mesh, by the way, is rather large. How do I scale the bump map? Would it work like this:
waterMaterial.bumpTexture.uScale = 22;
@DRLeria Thanks for the Playground example. I will study this carefully and rework my code. Maybe I find my error.