Hey all. This is something that I have wanted to do for a long time, and that is a pixelated view effect that runs with raytracing in real time. I managed to get this running from 18 FPS to well over
120 FPS (and if I cap the rendering to 60 FPS, my machine can even get over 250 FPS!).
Have a look!
Comparing to a typical raytracer:
Typical raytracer, 1 raycast per pixel, single threaded (benchmark) | 10-18 FPS at 100x100
My raytracer. 20-30% raycasts per frame, multi-threaded | 110-133 FPS at 100x100
Features:
As far as features goes for a raytracer, this has full on texturing and transparency support, all which runs very nicely.
All current textures I have implemented: Brick, Wood, Grass and Corroded Metal:
Since the renderer uses interlacing, I there is also motion blur to hide the interlace slices when moving:
With all these renderings tricks and optimisations combined, you can get some quite impressive results.
A 200x200 shot with all optimisation options enabled running 30+ FPS:
I took advantage of interlacing, native luau code generation, multi-threading, and pixel sleeping on colours that are the same to achieve the high framerate.
Benchmarking - Average FPS:
Low-end Office PC - 47 FPS
-
DESCRIPTION: Originally an office computer. Memory has recently been expanded from 8 to 16gb. The computer is a 2011-2012 Dell model.
-
CPU: Intel Core i7-2600 (4 core)
-
Memory: 16 GB
-
100x100 Interlaced:
25 - 28 FPS (Average: 27) -
100x100 Interlaced + Pixel Sleeping:
31 - 52 FPS (Average: 35) -
100x100 Interlaced + Pixel Sleeping (No Textures):
40 - 61 FPS (Average: 47)
-
Mid-end Laptop - 57 FPS
-
(Specs not available)
-
100x100 Interlaced:
24 - 30 FPS (Average: 26) -
100x100 Interlaced + Pixel Sleeping:
25 - 50 FPS (Average: 35) -
100x100 Interlaced + Pixel Sleeping (No Textures):
45 - 61 FPS (Average: 57)
-
High-end Gaming PC - 130 FPS
-
DESCRIPTION: My personal computer. Bought this machine early this year.
-
CPU: AMD Ryzen 7 5700X (8 core)
-
Memory: 32 GB
-
100x100 Interlaced:
70 - 80 FPS (Average: 75) -
100x100 Interlaced + Pixel Sleeping:
72 - 130 FPS (Average: 90) -
100x100 Interlaced + Pixel Sleeping (No Textures):
112 - 157 FPS (Average: 130)
-
Future plans:
Until the EditabeImage beta is out, I will be further developing this renderer and further optimising as best as I can.
Once EditableImage releases, and depending on the end result, this will either end up in a game of mine, or/and may end being a sold asset for other developers to use.