I need help very urgently right now…!! Is there anyone who can help me!?
I want to run Babylonjs with WebGPU. However, when I open the project I wrote from VsCode to OpenLive Server, WebGPU works well. However, when opened with another internal server, I don’t know why it appears as WebGL even in an environment that becomes WebGPU. There is no error.
What kind of work does the server need to do when implementing WebGPU?
This is my current code.
const webGPUSupported = await BABYLON.WebGPUEngine.IsSupportedAsync;
if (webGPUSupported) {
engine = new BABYLON.WebGPUEngine(canvas);
curWebEnvString = “WebGPU”
CurrentStatus = “Web GPU”;
console.log(“WebGPU”);
await engine.initAsync();
} else {
console.log(“GL”);
curWebEnvString = “WebGL”
CurrentStatus = “Web GL”;
console.log(“WebGL”);
engine = new BABYLON.Engine(canvas, true);
}
Not VScode Open Live Server, but an internal server.
It seems it is your browser that does not support WebGPU in the first case. If using Chrome Canary, you must either start it with the --enable-unsafe-webgpu flag or the set flag in Canary (chrome://flags):
Oh! Thank you for what Evgeni_Popov said.
If so, shouldn’t it not be done on the OpenLive Server if it wasn’t because of the browser on the internal server as well, too?
However, WebGPU works well in OpenLive Server.
(And the same script, the same browser.)
First of all, on OpenLive Server, it comes out well like Evgeni_Popov pictures.
When you open it on the same browser with the internal server, it appears with the picture.
try going to application in devtools and deleting everything from the cache while on 192.168.0.57. also make sure your html documents are the exact same, the order of imports matters.
This page is working well when running it with npm run start in visual studio code. but once I build it and then run it in ngnix, it throw not support WebGPU
If I run it with “npm run start”, it work well, navigator.gpu and navigator.gpu.requestAdapter() are all not null. But when I “npm run build” to build it, move it to ngnix ,and then run it, navigator.gpu and navigator.gpu.requestAdapter() are all null.
I think this is some matter about canary, when it visit a babylon html from local workspace it can load navigator.gpu correctly, but when it visit a babylon html from remote workspace(ngnix), it can’t load navigator.gpu.
Sorry I am not knowing enough about webpack.
I use this way to build project, it can build project with webgpuEngine correctly about 2 month ago.
I don’t know why it doesn’t work now.
Try removing the top tsconfig and changing the bottom tsconfig to commonjs. Removing the top one might cause typescript a warning but thats ok. Add a .env file in the same directory as the tsconfig and package.json and add:
TSC_COMPILE_ON_ERROR = true
DISABLE_ESLINT_PLUGIN = true
SKIP_PREFLIGHT_CHECK = true