Skip navigation
HTML can't run Doom But HTML can now run *inside* Doom! Thanks to HTML-in-Canvas!
0:00 / 0:26

HTML can't run Doom But HTML can now run *inside* Doom! Thanks to HTML-in-Canvas!

Robin

@solarise_webdev4K followers

Visit on X
1,145 likesDownloadOriginal post

115,376 views

HTML can't run Doom But HTML can now run *inside* Doom! Thanks to HTML-in-Canvas! Fully accessible DOM elements drawn into Doom's own wall textures. This demo uses a WebAssembly port (jacobenget/doom.wasm) of the original C source. See it in action at - Requires Chrome with chrome://flags/#canvas-draw-element enabled. On every Doom tick, HTML-in-Canvas's drawElementImage() captures the DOM form (child of ) to an offscreen buffer, it's quantised to Doom's 256-colour palette, and the bytes are written straight into the cached patch for the appropriate texture in Doom. Doom's own software renderer then paints it onto E1M1 as a wall texture - which means perspective warp, sector lighting, and even the damage-red tint all get included and applied to the HTML form elements. It's just a texture to Doom.

36 Comments

Comments from the original post on X (Twitter)

  • Akuma No Tsubasa's profile picture

    @totmacherx

    It's so fucking impressive what people do it with a 33 year old game. One day someone will run crysis in doom. Mark my words. Might be another 50 years but it will happen.

    8 likes

  • cr4n3's profile picture

    @metaphysicr4n3

    Yes internet is fun again. The future is bright.

    6 likes

  • George McHorseman's profile picture

    @GMcHorseman

    Sooo... emscripten? Then you get a DOM inside your DOM, so you can DOM while you DOM.

    5 likes

  • CuddlySalmon's profile picture

    @nptacek

    @codexeditor ok so now we need to run doom inside VR inside doom inside VR

    4 likes

  • Elix's profile picture

    @GenericMage_

    ❌ "Can *it* run Doom?" ✅ "Can Doom run *it*?"

    4 likes

  • Justin Williams's profile picture

    @develop_justin

    This is what the world needed. Thank you for your service

    3 likes

  • dominik kundel's profile picture

    @dkundel

    Damned I was gonna do that tomorrow 😂 nice job 👏👏

    2 likes

  • Robin's profile picture

    @solarise_webdev

    I sensed I should get in there quickly! It was inevitable 😂 Would love to see other approaches for this though. My one is pretty hacky, reused an existing texture (you can see the form texture duplicated if you head up the stairs to the left!) Interested to see how this could benefit browser-based games in general too

    1 like

  • undefined's profile picture

    @undy_aeon

    but can you run a canvas in it and run doom inside doom?

    2 likes

  • Air Guitarist's profile picture

    @wildstrums

    Yeah but can I run a C64 emulator inside of it?

    2 likes

  • Valentino Giudice's profile picture

    @Aspie96

    > HTML can't run Doom @rebane2001, can it with CSS?

    2 likes

  • Shaun Kahler 🥽's profile picture

    @kbidata

    Omg whyyyy 😂

    2 likes

  • Robin's profile picture

    @solarise_webdev

    Had to be done! 😄

    1 like

  • Cole Lawrence's profile picture

    @refactorordie

    @codexeditor This explanation helped me understand what "html-in-canvas" is actually doing. Neat demonstration!

    2 likes

  • Vincent's profile picture

    @VynseDev

    customer support: "please shoot at the form" 😂

    2 likes

  • Pseudonym 🦅's profile picture

    @tariusdamon

    👀

    1 like

  • Sync Kun's profile picture

    @Stardus63556727

    Wild

    1 like

  • ZEUS LYKAIOS ❤️‍🔥🌲✋'s profile picture

    @zeuslykaios

    noting this down

    1 like

  • Quaid Leckey's profile picture

    @quaidleckey

    Doom 3 demake with the interactive panels when?

    1 like

  • Flutterwhat's profile picture

    @flutterwhat

    so, what are going to be the pratical applications in this? in game interfaces that actually require internet access to function? imagine not being able to open a door becaus the game's servers shut down and they used HMTL canvas for all the screens in the game

    1 like