[.CommandBufferContext] RENDER WARNING: there is no texture bound to the unit 0
GoogleChromeのバージョンが上がってから、WebGL(three.js)のテクスチャマッピング関連で、次のようなワーニングが発生するようになりました。
[.CommandBufferContext]RENDER WARNING: there is no texture bound to the unit 0
これは、テクスチャのデータローディングが完了していない段階で、レンダリングを行った時に発生します。そのため、データローディングが完了後にテクスチャを貼るという処理を明示的に行うことで回避することができます。
プログラム例(three.js)
//形状オブジェクトの宣言と生成
var geometry = new THREE.SphereGeometry(50, 200, 200);
var material = new THREE.MeshPhongMaterial( { color: 0xFFFFFF, specular: 0x999999, shininess: 20 });
//地球の生成
var earth = new THREE.Mesh(geometry, material);
//地球テクスチャの読み込み
var textureloader = new THREE.TextureLoader();
textureloader.load( "planets/earth_atmos_2048.jpg" , function( map ) {
earth.material.map = map;
earth.material.needsUpdate = true;
});



