I’ve long been active in PSP development and decided to have some fun with graphics on the PSP. I asked my university to order two PSP dev systems and I got to work porting my ray tracer to the PSP. As a team effort with three other graphics enthusiasts, we decided to accelerate hypertexturing on the PSP using the VFPU. We ended up with a ray tracer, hypertexturer, and volume ray caster working on the PSP capable of displaying a 64x64x64 voxel volume.
Before porting the ray tracer, my buddies and I made a few little graphics demos using the Sony framework (very similar to OpenGL), and then tried some procedural graphics writing directly to the frame buffer and bypassing the Sony framework entirely. We started with the Mandelbrot set, but for some reason, writing to the frame buffer just wasn’t getting the speed we wanted, so we decided to use the Sony framework for display. After porting the ray tracer we started optimizing by converting doubles to floats, compiled with -O3, reduced the number of objects in the scene and removed shadows. With that done, we moved onto hypertexturing. To get more speed there, we did a number a sphere hit function optimizations, as much precomputing as possible, centered the sphere at the origin and placed a bounding sphere around the hypertexture. After all that, I still wanted more speed, so I precomputed all the normals and stored them in a voxel grid. This reduced the calculations to a sphere hit test, simple ray march, a lookup in the voxel grid, and phong shading on the normal. We then limited the render target 64x64 pixels (given the size of the volume), and then used the fast Sony framework to zoom and filter to full screen. All these optimizations got us a 600x (60,000%) improvement over the initial implementation.