Building headless blender to WebAssembly

A headless blender that can be run in the browser with webassemlby would enable services that use blender for calculating complex 3d tasks by running them on the client system. I can imagine many scenarios where this can be a huge game changer. For example rendering images that have been customized by the client with only some simple parameters.

I have started to look into how building headless blender to webassembly might be done, but quickly realized that this is far out of my capabilities. Thats why im reaching out to you fellow developers.

First of all I would be interessted if anyone can say if this is even realistically possible without rewriting blender.
Also, do you have some valuable resources that might help me in achieving this? Like a explanation of the build scripts/build files. Or Compiling C++ to WebAssembly.
Is anyone already working on something similar?

I hope this is the right place to ask. And that my interest is understandable.

I looked at this last year, got it to the point where a basic python script could run, reasons why i never continued the work are

  1. The GFX stack in blender is highly reliant on opengl 3.x , the browser offers only opengl ES which blender currently does not support.

  2. Even with a lite build the time the linker required to generate the code was through the roof (minutes per try,vs seconds for native code) to the point where no productive development could be done


And what about WebGPU (WebGPU). Blender Web Edition :blush:

1 Like

doesn’t really matter all that much as this point, all drawing code in blender is targeting desktop openGL, reworking that to support any other gpu stack (doesn’t really matter if that stack is OpenGL ES or WebGPU) is a monumental amount of work.


I don’t know much about this but I found this on StackOverflow

Since it’s been a couple of years, I dare ask. Theoretically would the Vulkan port allow for this? As I understand it, Vulkan is built for that sort of gpu-stack-agnostic system, right?

No vulkan won’t help there


Is it possible to compile only the bmesh part of Blender? This will provide procedural modeling capabilities for the Web platform. Currently, there is no JavaScript library that can be used for procedural modeling

Is it possible to compile only the bmesh part of Blender?

possible? probably… out of the box? not even close, It’s never the question if something is possible, it’s code, surely it can be done, it’s just how much time you want to pour into something to get it done. I didn’t save any code of my attempt a few years ago but i’m pretty sure the bmesh bits build without much struggle. But by the time it got to that point i probably spend days on solving other problems.