Hardware Accelerated Raycaster - Love2D
Wolfenstein 3D style raycasting engine using the GPU for drawing. Essentially it gathers the data from the raycasting into a texture which is used in a shader for drawing. The wall render step also updates a depth buffer which is used when rendering the sprites. The floors/ceiling are just a hacky mode 7-sh shader. On my PC (i9-9900k, 32GB RAM, 1070ti) it renders at 3840x2400 in ~1.5ms - 2ms for a reasonably populated scene. On my 2013 MacBook Pro (i5-4882U, 8GB RAM, integrated graphics) it renders at its native resolution of 2560x1600 in ~2.8ms - 3.2ms for the same scene. For a more typical raycaster resolution of 320x200) my PC renders a frame in about 200-600 microseconds, while my old mac is around 1ms - 2ms. The performance bottleneck is now just the raycasting (raycastTime in the debug overlay). The impact can be tuned by reducing the draw distance (and that hidden by further reducing the shading distance). theoreticalRenderFPS is kind of nonsense, it's just 1/renderTimeInSeconds. github: https://github.com/marclurr/harc