webGL errors with terrain


#1

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?


#2

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


#3

pinging @julien-moreau for investigations


#4

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:


#5

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.


#6

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


#7

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


#8

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


#9

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

Thank you Julien


#10

Then fixing asap =D


#11

Thanks @Dad72 for your PR!


#12

It was a pleasure.