[Solved] (WebGL: INVALID_OPERATION: texImage2D: no texture bound to target) when creating CubeTexture

I get:

engine.cubeTexture.js:184 WebGL: INVALID_OPERATION: texImage2D: no texture bound to target
(anonymous) @ engine.cubeTexture.js:184

when trying create CubeTexture, like this:

const file = '512x512.png';
const skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.diffuseTexture = BABYLON.CubeTexture.CreateFromImages([
     file, file, file, file, file, file
], scene, false);

it happen on Firefox and Chromium, OS Ubuntu 20.04. Version of BabylonJS: 4.1

Welcome aboard!

Are you sure you don’t have a 404 error message in the browser console?

A repro PG will definitely help in the matter (https://playground.babylonjs.com/).

Yes, i sure =(

Im trying to reproduce this https://playground.babylonjs.com/#RNBKQ#8 (locally). So, time-to-time i have black screen with sphere (without cube background). some time - ok…

This is my console output =)

Hard to diagnose without a repro…


I used https://playground.babylonjs.com/#RNBKQ#8 string-to-string =)

i do not know what exactly happened, but i have catched, that construcor of BABYLON.Engine() called one more time. I fix it, and became ok =)


I’m not sure I have understood but I’m happy you sorted it!

1 Like