My latest 3D engine called 'Engine From Nowhere'. I personally think it is up there with some of the fastest true 3D rasterizers on Scratch that can do perspective textures. The scene you are seeing is over 15700 textured polygons! On my PC, which to be fair uses a top end CPU, it runs at about 40fps worst case at 480x360. That equates to roughly 629600 textured polygons per second shown in the worst case scenario. The fragment code, or stages before finally showing the rendered frame, can push over 2.2 million TPS. Uses normal WASD movement controls. Q/E controls camera roll with Yaw and Pitch controlled via mouse. Update v.14 * Fixed triangle order if statement edge case's before calling prepPartition. * More accurate render_fps display Update v1.13 * Changed tris_per_sec to rendered_tris_per_sec - a more accurate representation of the triangles actually being rendered on screen. Update v1.12 * Optimized triangle pointer allocation Update v1.11 * Significant performance improvement by making pen renderer draw spans for colors that stay the same Update v1.10 * Reduced unnecessary additions in the scanline sections. Update v1.9 * Updated texture image Update v1.8 * Reduced worst case if statements ran during the prep partition stage. Update v1.7 * Changed object texture image Update v1.6 * Replaces division in fragment code to get UV texture with multiplication Update v1.5 * Reduced variable writes in the fragment code * Reduced if statements in the render loop Update v1.4 * Reduced variable writes for case where two vertices is behind the camera * Reduces some unnecessary toNotNan() function calls * Added much more higher polygon model to the scene (roughly 15740 polygons vs the previous of around 690 polygons) Update v1.3 * Reduced variable writes for case where no vertex is behind the camera * Reduces some unnecessary toNotNan() function calls in the 1, and 2 vertex behind camera cases. * Made camera rotation respect camera roll Update v1.2 * Uses frame offset depth buffer to reduce writes to reset depth buffer when drawing frame. * Updated variable names to be more accurate to their function.
Please give credit to @statictg if you use this engine in your own project. NOTE: this engine runs at a fixed 480x360 resolution so you will want to run this on Turbowarp (with "Warp Timer" off) via the link below: https://turbowarp.org/1375357685 Don't expect any functional levels of performance if running on scratch.mit.edu. Engine is made by me, but a lot of optimization tricks were learnt along the way from friends in the G3D server. Please give feedback if you find ways to improve the performance of this render engine. Thank you trying this engine.