090311 / Atom Triangle Soup

previous | next

Atom iPhone Update

Blend performance on the iPhone wasn't up to the level I needed. So I'm doing something different, and 3000 lines into a new engine (from "scratch") started this weekend using older Atom code as reference. The PowerVR MBX has one awesome feature by design, for a single opaque draw call, it can handle huge amount of Z overdraw. In fact the first generation iPod Touch can do 29 fps with 64x overdraw with a single draw call of 64 fullscreen triangles of different z (note 64x Z overdraw is not obtainable in practice, using lots of triangles will limit this). In any case I've gone back to rendering triangles.

Development in engine triangle soup test shots below, don't expect anything to look like real game...

I'm sticking to the same framebuffer feedback as I had in previous Atom engines. For the iPhone engine, triangle output is color + color.alpha * texture. Texture is the previous rendered frame only. I'm rendering to a 256x256 sized render texture (for bandwidth, fill, MBX requirement for pow2 texture size), then copy to screen using a scanline pattern to help hide upsample artifacts.

Texture recirculation coordinates are delayed by one frame so they can correspond to previous frame triangle positions. Effects are generated by adjusting texture coordinates and feedback amount.

Geometry shown here is just distorted octahedrons, in a distorted oct tree traversal, with random colors, with fractal framebuffer feedback cranked up. Feedback with scaling can have this "copy multiple reduction" fractal effect if contractive mappings are used.

The geometry for now has a static tree, because I haven't yet finished the dynamic traversal and hidden surface removal code for the new engine.

Using feedback to simulating the feel of refractive or reflective transparency. Guessing this is similar to how the ice was rendered in Super Mario Galaxy.

Per texture coordinate (not doing vertex) jitter can create a heat wave effect.

Or blur and and strange fluid visual echo.

Or without jitter for just the visual echo.

Crank up per texture coordinate jitter and the result is some wild stuff which looks in motion (and not on the static screen shot) like an old school fluid flame effect.

All these material effects can be mixed and matched on any geometry. Lots of stuff to try out still ... like using something other than random color. Next step is to get the HSR and view traversal working. After that adding in the hierarchical physics code. Then the scary task of optimizing the CPU work to insure it runs on the iPhone...

Network Notes

Xtremelabs has posted some interesting average bandwidth and latency numbers for various wireless networks (useful for iPhone dev). Latency for EDGE is next to useless for anything interactive on multiplayer. IMO also looks like P2P would be required (to cut communication latency in half) for good interaction...

Network : Upload Kbits/s, Download Kbits/s, Latency ms
3G : 955.6, 152.6, 484.2
EDGE : 218.4, 37.3, 907.3
WIFI PUB : 2502.0, 773.9, 205.0
WIFI PRI : 2905.3, 738.8, 184.4

Voxels Continued

Efficient High Quality Rendering of Point Sampled Geometry
Spacerat's Voxel Blog with CUDA demo.

Other iPhone Notes

According to this,

128MB
101MB for OS
11MB for video
15MB for app

Unity3D Wiki has some good numbers on textured overdraw performance (using 512x512 texture).

10.8 ms for 32bit texture full screen quad
20.4 ms for dual 32bit texture
8.1 ms for 4bit texture
12.2 ms for dual 4bit texture
9.8 ms for dual 2bit texture
7 ms for color only

Other MBX Notes

MBX Hardware Details not the MBX Lite, but very very useful indeed...