3.10.2012

Polygon tackle

Before starting to work on my exposé, I want to have a bit of different coding and started to work on a generic way of rasterizing and rendering data. Don't know whether I mentioned the two macros ITK_CELL and ITK_COMP in itk_misc.h of ITK, but they pretty give the basic idea of how I'm trying to combine multiple buffer formats with homogenously typed, randomly arranged data cell. With a little mapping array I can hopefully put aside most code and rely a not highly performant but otherwise optimal way of combining multiple buffers into more complex image with alpha and bump mapping data without doing any combining, copying or just render code repetition. I'm trying to pull it all together and also found an found an interesting way to abuse my usual n-dimensional array iteration by just altering start and end values, directly mapping both to some polygon border positions. This could make rendering polygons the same as rendering rectangles and even provide a first step to basic stretching and rotation of graphics with 3D acceleration. Feels a bit like discovering mode 7 on the Super Nintendo. I'm still figuring out the details interesting for generalization but the idea itself could actually work. If I start working on software rendering once again, than with some more style and reusability than before. And I'll pass the focus on triangles and do the full polygon program cause I can imagine more interesting things with them than just with polygons. Whatever, it's simply easier to think of than trying to squeeze the loop more and more. Plus, n-dimensionality has it's price and won't give away optimization for free. Optimizing n-dimensional loops, anyone?

No comments: