|
Project Information
|
IntroductionV4P - Vectors For Pocket - is a minimalistic software-only dependency-free scanline-rendering based 2D graphics engine. Its purpose is to render a 2D image out of a set of layered polygons.
The basis of the algorithm is introduced by Wikipedia here: http://en.wikipedia.org/wiki/Scanline_rendering. This algorithm has been merged with Bresenham and quicksort algorithms, plus bit-based layers management and poor-man integer only mathematics routines picked here and there. V4P is extra light. It consists in a ridiculously short piece of C code. See by yourself: grep -c ';' *.c lowmath.c:72 quickheap.c:66 quicktable.c:28 sortable.c:64 v4p.c:519 V4P targets very light platforms without any form of hardware acceleration: neither FGU nor FPU. RAM usage is negligible since neither Z-buffer nor "S-buffer" (as depicted here: http://www.gamedev.net/reference/articles/article668.asp) are involved. Plus V4P has no dependency with any other technology. It even brings its own integer only maths routines. It means you could easily embed V4P in almost any software or hardware. Just provide it with a "span" drawing function. A memset()-like function should work well in most cases. For you information, V4P has been initially developed on an antique PDA. BackendsV4P sources includes few backends: SDL, XLib, and palmOS 4 API (!) Those are simple backends. One might imagine much more clever ones, with complex color structures, anti-aliasing and such. Extra libsV4P sources also includes several extra pieces of C code for your pleasure:
Things to be doneHere are few things which could be done next. new backends
targets
V4P based libraries and frameworks
new featuresanti-aliasingA new span-drawing function may handle it. curvesWe need facilities to convert curves into vectors. import/exportA real SVG parser would be handy. deeper z range, transparent polygonsOnly 16 layers for now. A balanced binary tree of spans may remote this limitation and allow polygons combining (transparency and such). accurate math routinesByte-length values are really inaccurate! dirty rectanglesA library on top of V4P may avoid unchanged scene area rendering. |