News for hackers. Stuff that matters.
Re:JavaScript Wolfenstein 3D Engine by dtf on Thursday August 06, 2009 @05:29PM (#746445)
Incredible stuff. Do you know if this is using anything intrinsically Flash-only, other than a fast VM? It looks like a software rasterizer - is there anything preventing a port to some kind of Javascript/HTML setup?
Re:JavaScript Wolfenstein 3D Engine by actually on Thursday August 06, 2009 @05:37PM (#746458)
It is software rasterizing, written in haXe. I know the author from his posts on the haXe compiler ML, so I have a few details about the engine. haXe itself compiles to JS/C++/PHP/etc., however the only way that engine could possibly be fast enough is to make use of haXe's Flash-specific "Memory" API, which uses opcodes from Adobe Alchemy to manipulate a flat memory space at the byte-level.

While it could definitely be ported, you'd have to change the part of the implementation that makes it fast to do so. If JS got a similar ability to do byte-level manipulations, it wouldn't be out of reach, but right now it looks like JS implementations are avoiding these kinds of proprietary extensions.

Re:JavaScript Wolfenstein 3D Engine by badsectoracula on Thursday August 13, 2009 @12:30PM (#761112)
I think this version doesn't use the "Memory" API. I have two versions, one that uses it and one that doesn't and the difference is very minimal - not worth to drop the Flash 9 support at least.

I'm not sure if RF2 can be done in regular JavaScript though. Maybe in Chrome 3, which about twice as fast in my 3D canvas benchmark test (this one: http://gimme.badsectoracula.com/canvas3dbenchtest.html ). But Flash works 'equally' in almost all browsers while JS+Canvas is very browser specific when it comes to performance.