WebGL (Wasm) build without graphics?

Hello everyone,

I am wondering if it’s possible to disable rendering and graphics at all (keeping only the game logic / physics loop) for an Unity WebGL build. I want to achieve the same behavior as an Unity Dedicated build that runs with batchmode and nographics but for a WebAssembly target.

First, do you think it’s possible, and if so, what do you think is the best path to get this working ?
I have thought of several ways:

  • Try to disable WebGL init and rendering by editing the Wasm directly (InitWebGLPlayer.PlayerInitEngineGraphics + NeedToPerformRendering),
  • Intercept the IL2CPP output of a Dedicated build and recompile it with emscripten,
  • Make a custom Render Pipeline that is actually rendering nothing (but I don’t think this will do anything to the WebGL initialization part, so it’ll still be there),
  • Any other solution :sweat_smile:

Thanks in advance for your help!

Hope that someone can help on this or give a lead :smiling_face_with_tear:

Bump for this one

Is it possible to pass the nographics arg to the Wasm?

Hi!

The player command line args listed here: Unity - Manual: Unity Standalone Player command line arguments don’t have an effect in Web builds. So -nographics and -batchmode will not work unfortunatly.