Art asset viewer WebGL failure blanks the 2D image overlay #1057

Closed
opened 2026-08-13 05:45:17 +00:00 by spikerj · 1 comment
Owner

ArtAssetViewerComponent.initThree() constructs THREE.WebGLRenderer with no try/catch. The constructor effect calls it the moment #canvasContainer materializes (inside *transloco).

If WebGL is unavailable (blocked context, software GL fail, or a 2D-only session showing concept/texture overlays), the throw escapes the effect. detectChanges aborts, so the image overlay (imageSrc / download-original / close) never renders — users cannot even view the AVIF preview that does not need a GPU.

Pinned by art-asset-viewer.leftovers.spec.ts: overlay tests have to stub initThree, otherwise detectChanges throws THREE.WebGLRenderer: Error creating WebGL context before the overlay DOM exists.

Fix: catch the WebGL constructor failure, emit loadError, and still render the 2D overlay/toolbar.

ArtAssetViewerComponent.initThree() constructs THREE.WebGLRenderer with no try/catch. The constructor effect calls it the moment #canvasContainer materializes (inside *transloco). If WebGL is unavailable (blocked context, software GL fail, or a 2D-only session showing concept/texture overlays), the throw escapes the effect. detectChanges aborts, so the image overlay (imageSrc / download-original / close) never renders — users cannot even view the AVIF preview that does not need a GPU. Pinned by art-asset-viewer.leftovers.spec.ts: overlay tests have to stub initThree, otherwise detectChanges throws `THREE.WebGLRenderer: Error creating WebGL context` before the overlay DOM exists. Fix: catch the WebGL constructor failure, emit loadError, and still render the 2D overlay/toolbar.
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). Art asset viewer keeps the 2D overlay when WebGL fails. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). Art asset viewer keeps the 2D overlay when WebGL fails. Closing.
Sign in to join this conversation.