webGL errors with terrain

I’m having a look at the demo playground for terrains here https://www.babylonjs-playground.com/#E6OZX#7

These errors are appearing in the console

[.WebGL-0000017078801B00]RENDER WARNING: there is no texture bound to the unit 3
/#E6OZX#7:1 [.WebGL-0000017078801B00]RENDER WARNING: texture bound to texture unit 4 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
/#E6OZX#7:1 [.WebGL-0000017078801B00]RENDER WARNING: texture bound to texture unit 6 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

Does anyone know how to fix this?

I noticed her mistakes for several years and I never understood how to correct them and why they were present.

pinging @julien-moreau for investigations

Found, this is due to a bad return value in the function “isReadyForSubMesh”. I’m not checking if ALL textures are ready (only mix map). Fixing ASAP :slight_smile:

3 Likes

This problem also existed with CustomMaterial which was extended from StandardMaterial.
Maybe this problem also exists in StandardMaterial. But I do not know, it’s a hypothesis.

Had a look to the CustomMaterial class and it looks that it is the same issue, the “isReady” function must be overriden to determine if the material is ready (including textures) or not

Awesome! Thank you @julien-moreau for fixing the issue. I’ll try out the new code soon

@ozRocker @Dad72 pull request created! Properly set if TerrainMaterial is ready for sub mesh by julien-moreau · Pull Request #5800 · BabylonJS/Babylon.js · GitHub

2 Likes

@julien-moreau This problem is also with mixMaterial. You correct it only on TerrainMaterial.

Thank you Julien

Then fixing asap =D

1 Like

Thanks @Dad72 for your PR!

1 Like

It was a pleasure.