WaterMaterial strange reflection artefacts when adding NodeMaterial to render list


I’m getting strange reflection artefacts when trying to add a NodeMaterial to the render list of a WaterMaterial. The playground below shows something of what I mean. Although in my application the artefacts are far more pronounced. In any case, it’s clear the result is not equal. If I remove the material from the mesh, or change to a StandardMaterial, or use TerrainMaterial for the target mesh. it looks much better. It seems to be just a problem with NodeMaterial. Thanks.

with standard material: https://playground.babylonjs.com/#3N9YA1#1

You need to use the Lights block in your node material:

Note that you are seing a second reflection (which is in fact the refraction) because clip planes are not supported in node materials and the water material is using them to generate the reflection/refraction textures.

Thanks @Evgeni_Popov. I believe the problem I’m referring to here is due to the refraction issue, because I still get the artefacts when I’m using a PBRMetallicRoughnessBlock. I was just using a basic node material as an example here. Is there any way I can fix this using NodeMaterial? I do have other approaches I can try for this such as extending one of the existing material classes, but I would really like to use NodeMaterial in this case.

This PR will add a new ClipPlanes block to the NME:

Once the PR is merged, you will simply have to add the ClipPlanes block to your material:

1 Like

@Evgeni_Popov, thanks a lot, very responsive. I guess that will be available next release? I’m trying to integrate it now, but running into some roadblocks with modules etc.

It should be available in the Playground within one or two days, but NPM packages are rebuilt less often. I will let someone from the team answer about the delay.

No worries. I have some other stuff I can focus on if I know it’s on the way at some point. Thanks very much.

@Evgeni_Popov, I updated to latest beta release and this works beautifully. Relating to other threads about the usability of Babylon for learners. I am stunned every time by the level of responsiveness to questions and problems on this forum, and this has made all the difference in the struggle to learn a difficult but very rewarding library. Sincere thanks!


@Polymorrah this is the kind of answers that makes us always want to improve the framework !!! Thanks fos sharing this and yes @Evgeni_Popov is awesome

1 Like