Four ways a load can go (and one that returns too early)
Real results from this page: a wrong folder, a file that is not a picture and another website all reject with an Event of type error. The last line shows load() returning before the picture exists.
A texture is a picture the GPU reads. TextureLoader fetches it, but the picture arrives later, it can fail, and a colour picture needs one extra line (colorSpace) or it looks washed out.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write an async function loadColour(url) that returns a ready colour texture, or null when the file fails, and logs the failing URL.
A plane shows a photo that looks too bright. What do you check first?
Explain it without notes
A friend's texture is washed out and pale. What is the likely cause, and what is the one-line fix?
Why does loadAsync reject with an Event, and how do you find the real reason for a failed texture?
Console
Nothing logged yet.Expected console output
right path | ok: 1024x1024
wrong folder | failed: Event error
not an image | failed: Event error
other website | failed: Event error
load() returns at once | image so far: null | isTexture: true