How to run a computeShader locally?

Compute Shaders | Babylon.js Documentation

The examples work in the playground. I wanted to get a ComputerShader running on my local from a test.html file.

Use WebGPU to watch this demo which requires compute shaders support. To enable WebGPU please use Edge Canary or Chrome canary. Also, select the WebGPU engine from the top right drop down menu.

What do I have to change?

        let engine = new BABYLON.Engine(canvas, true, {
            preserveDrawingBuffer: true,
            stencil: true
        });

        let scene = createScene();

        engine.runRenderLoop(function () {
            if (scene) {
                scene.render();
            }
        });

I downloaded one of examples from PG with Download button and it runs even without localhost.

2 Likes

https://doc.babylonjs.com/setup/support/webGPU/

const engine = new BABYLON.WebGPUEngine(canvas);
await engine.initAsync();
2 Likes

Thanks to both of you. A new level for me. Parallel processing on the GPU!

2 Likes