CSS is DOOMed!

Every wall, floor, barrel, and imp is a div — DOOM rendered entirely in CSS. Using 3D transforms, CSS math functions, @property, clip-path, anchor positioning, and SVG filters to build a fully playable 3D first-person shooter in the browser without Canvas or WebGL.

Hello my name is Niels Leenheer

Creating 3D scenes with CSS has always been possible[0], but like this project, it's required JavaScript for interactivity.

But there's a lot more CSS features now. While in the past, Turing completeness in CSS required humans to click on checkboxes, now CSS can emulate an entire CPU without JavaScript or requiring user interaction.[1] So I wonder if DOOM could be purely CSS too, in real time.

[0]: https://keithclark.co.uk/labs/css-fps/
[1]: https://lyra.horse/x86css/

A 3D engine built using HTML and CSS 3D transforms by Keith Clark

A CSS powered 3D environment with geometry created from HTML elements and CSS transforms. Textures and lightmaps are composed by layering multiple background-images and colour is applied using CSS blend-modes.

The author links to th CSS x86 project:

> Yes, Lyra Rebane build a x86 CPU completely in CSS, but that technique is simply not fast enough for handing the game loop. So the result is something that uses a lot of JavaScript.

But where can I try it out in my browser?

EDIT: https://cssdoom.wtf/

cssDOOM

DOOM rendered entirely in CSS. Every wall, floor, barrel, and imp is a div, positioned in 3D space using CSS transforms.

Never tried Doom on a phone before, this one is surprisingly fluid and very playable.

Works smoothly in Firefox. But the default key mapping is busted: fire at Alt means that it opens and closes the menu in Firefox with each press. Also, Alt + left arrow ends the game and goes back in history.

Interestingly, it was more choppy in Chromium.

I could not find a key for moving sideways ("strafing").

All in all, quite mind-boggling.

Strafing is implemented on A and D at least, but having one hand on the arrows to turn and WASD to move is a bizarre mix of modern and original controls

> Interestingly, it was more choppy in Chromium.

Firefox's WebRender is truly a great creation. While Chrome is faster at most things especially involving JS, Firefox puts so much of its rendering on the GPU so moving elements around is incredibly fast.

It works perfectly in Safari on mobile. this never happens.

In 2006, Ars Technica published an April Fool's article[0] declaring that the perennially-forthcoming Duke Nukem Forever would finally see the light of day... as... a browser game! Ho ho, how droll.

Crazy to see how far we've come.

[0]: https://arstechnica.com/gaming/2006/04/forever/

Duke Nukem Forever

Remember back in 1997 when Duke Nukem Forever was announced? Well nearly nine …

Ars Technica

Seriously impressive, especially the viewport culling trick, not seen that one before.

FYI if you want to use inspect element, the viewport div consumes mouse elements, you can get rid of this with

#viewport {
pointer-events: none;
}
#viewport * {
pointer-events: initial;
}

So impressive! Bonus, you can wall hack by just deleting a div ahah