3D rendering

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by zp on Fri Sep 06 10:27:25 MST 2013
The power of the  LPC43xx in DMIPS is quite close to the Intel Pentium I running at more than 120MHz. So I decided to estimate the abilities of the LPC43xx in 3D graphics. Or to test my ability to show the best of the LPC4357 in 3D, if you want.

You can have a look at this 11MB 800x600 video. I'm working on my own DIY board with the plain C programming powered by Rowley Crosswork toolchain. 

LPC4357 3D rendering

This is not a 3D demo but just the perspective texture mapper visual test. I'm now in the very beginning state.
Screen resolution is 640x480 with 16bpp.

A free textured 3D lowpoly model was taken from the psionic site.
The backface culling, frustum culling and perspective mapper seems are working quite well meaning all the other interpolated values (like vertices colors for a blending and normals for a Gourad shading) will interpolate correctly as well. An optimized mesh normals per-frame recalculation also works about at no cost wit such kind of models on the LPC43xx.
No optimization of any kind still applied so the total FPS is quite low.

In the top left corner:
white number - FPS (updated every second, calculated on a second basis);
red number - previous frame time in milliseconds (updated every frame);
white number - the counter of writings in a (type of float) Z-buffer  (updated every second, calculated on a second basis);

In the bottom left is displayed a local composite matrix for the 3D object.

Comparing to the modern 3D ARM hardware accelerators (like a SGX530 in TI Sitara or Mali400 in Freescale imX5/6) this test shows just about 20K textured triangles per second against 20M in case of hardwared 3D :). By the way, all HW accelerators have free 4xAA  and many other things we can only dream of...

Though the low-poly geometry is processed quite fast, it is the texturing & rasterization issues that make the total result too poor. But if the  Z-buffer is accessed up to 50K times per frame the total FPS is about 20 (ie without closelooks). This means we can keep at least several low-poly (1K polygons) 3D objects in the scene. But the optimizations of all kind are still in a far future. At least we have a reserved 640x350 resolution, a palettized color modes or a WQVGA/QVGA LCD as the last bastion.

It is obvious that we need a pixel shader. May be another LPC43xx without LCD'd became a "master" and the other, with the LCD, will be a pixel shader with the help of its M0. (Here are going some cenzured heretic thoughts about a vybrid 6).