Why do all the AI assistants generate babylon.js code that doesn't load texture maps correctly?

ChatGPT, Copilot, Claude all generate code that results in “factory” texture maps not loading from babylonjs.com or the git repo. why is that and what’s the workaround? thx

Hi @Mike_Pell and welcome to the community.

Hallucinating AI is not a bug with Babylon.js, so I’m unsure what can be done about that other than checking/confirming everything generated by AI, or waiting for them to get better.

It’s not uncommon for AIs to generate 3D code using APIs of other engines or seemingly make up API calls that don’t exist.

The official documentation is the best option for accurate code examples.

Maybe you could post the code that’s being generated or create a Playground, in case the documentation is unclear and could be clarified to improve generative AI.

fair enough on the AI assistants not having a known good example, but they all do it so makes me suspicious that something broke recently like the texture folder moving or being deleted on the server and the old method not being publicly retired.

here’s what ChatGPT generated against this prompt on July 13, 2025, which results in a cube with the red checkerboard pattern denoting the texture map could not be loaded:

“create a complete HTML file that uses babylon.js to create a scene with a ground plane that’s metallic silver and a cube that sits on it with a photorealistic wood texture. use dramatic lighting”

Wood Cube on Metallic Ground - Bright Scene html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; } canvas { width: 100%; height: 100%; display: block; }

Posted code is invalid and incomplete.

1 Like

Just tried your prompt and I copy/pasted the createscene here:
Babylon.js Playground

Seems alright :slight_smile:

1 Like

Claude and Copilot from using them seem to need you to be explicit in version requirements. Telling them for the latest Babylon.js or even the version number helps clear it up usually. It’s not just textures.. It’s basically deprecations, new features, etc.