问题描述
-
使用 Vite 采用 React 前端框架创建 ThreeJS 的 demo:立方体显示
-
项目启动
- 使用 Chrome 访问:localhost:5173/ 无内容
- 使用 Edge 访问:localhost:5173/ 正常显示
-
Chrome 使用 F12 调试查看错误信息如下
Status: Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, GL_VENDOR = Google Inc. (Google), GL_RENDERER = ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (LLVM 10.0.0) (0x0000C0DE)), SwiftShader driver-5.0.0), GL_VERSION = 5.0.0, Sandboxed = yes, Optimus = no, AMD switchable = no, Reset notification strategy = 0x8252, ErrorMessage = BindToCurrentSequence failed
问题解决
-
访问网站:查看浏览器是否支持WebGL
-
若仅是未开启设置,前往 Chrome 设置 - 系统
-
将硬件加速模式开启并重新启动浏览器,正常显示