Tuesday, December 28, 2010

Fwoosh

Holy crap, two posts in one day. Anyway, I think I need to write some matrix transformation algorithms so that all my images don't start in the lower left and end in the upper right. Such is the difficulty of writing curves out by hand.



This is a Coons' patch made of simple one segment Bezier curves. With the new framework it was actually fairly simple to adapt the patch description and shade semi-interestlingly, and it should be possible to generically insert new curves. But the intresting part is that this is the first thing that I've really treated as a 2-dimensional surface and will probably form more of a basis for the things I want to render. I'm pretty close to being able to actually introduce some new tricks that I've been thinking of for doing some interesting shading techniques, but I really may have to start looking at performance.

Seaweed



So, what's not apparent about this image is the amount of work that went into refactoring my image rasterization framework to essentially be able to handle arbitrary C++ types as vertices and to now be able to use arbitrary function objects which can shade meshes composed of said vertices. I also did some refactoring so that I could take arbitrary one dimesional curves and two dimensional surfaces and subdivide them to feed them to the rasterization algorithm.

Most of the new work is apparent as the repeated gradient texture on the Beziers that make up this image, which wouldn't be possible without the ability to write an arbitrary shader. It turns out the hardest part of doing this was that I wanted to treat each little quadrilateral that the subdivision algorithm spits out as a tiny rationally bilinearly interpolated patch, which then interpolate the vertex values that get fed into the shader, but working out the mathematics to figure out how to correlate sample indices to actual parameter values on that patch in a numerically stable way was pretty tricky.

My next step is to try and get arbitrary shaders working on Coons' patches. I actually had them worked out but could only shade them with a solid color, which was fairly uninteresting. Performance has already degraded a bit though, so I think that might actually be what I have to take a look at next.

Sunday, October 10, 2010

Beziers!

Over the last couple of weeks I did a complete rewrite of my little rasterizer program to be able to better handle the different types of shapes that I'll be drawing with. The algorithm is now organized around being able to efficiently super-sample just about any type of primitive without using too much memory, and then aggregate the super sample set into an antialiased lower resolution image. The nature of the algorithm should also make implementing new primitive types (and possibly procedurally generated primitives) simpler. To test it out I added a new primitive type, Bezier curves!

Beziers!

I also published all my code onto GitHub, for backup purposes, and perhaps sharing purposes one day if anyone actually becomes interested.

http://github.com/bracket/rasterizer

Saturday, September 18, 2010

nyyyyyyyyyyyyyyyeargh

My Very Own

Between last posts I've left my old job, moved to Portland, and started a new a job. It feels like it's been way less than 8 months. Anyway, I was kind of stagnating on doing anything interesting image-wise for a while, and was kind of feeling dumb about it.

A friend of mind pointed me at the demo-scene the other day. The idea behind it is to create procedurally created images and videos where the entire compress executable size is less than 64kb, which is tiny in terms of modern computing storage.

The idea intrigued me enough to give it a shot, so this weekend I started a fast and dirty renderer framework to make static images. And here's the first one! With some nice anti-aliased lines and everything. I'm pretty happy 'cause I'm pretty much responsible for every single pixel in this image. Next up: Beziers or NURBs and maybe animation.