|
Author |
Topic: interlacing (Read 968 times) |
|
toxi
|
interlacing
« on: Aug 13th, 2003, 3:21pm » |
|
i'm just cleaning up some older, unfinished experiments with P5 and thought this example might be interesting to some of you. it is mainly about a technique called "interlacing" and how it can be used to improve render performance for CPU intensive applications. interlacing is nothing new, in fact it has been used in old TVs and computer games. the classic idea is to reduce the amount of process data per frame and so achieve a higher framerate and more fluid animation. in practice we'll skip every other scanline (pixel row) when drawing a frame. so in one frame we only draw the 1st, 3rd, 5th, 7th etc. line and the next frame only the 2nd, 4th, 6th and so forth. if this happens fast enough, our eyes won't even notice. but the result is, every frame we only have to compute 50% of the data, hence we double our performance! now interlacing can also be applied in horizontal direction by skipping every other pixel in each scanline. in addition to the vertical interlacing described above this means we cut down our data (per frame!) again by half. not bad, huh so to get to the point: the demo below is displaying my version of our all favourite metablobs, a well known species of CPU eaters. the code is very loosely based on jacob's version, posted here ages ago. only due to the interlacing it can handle easily up to 10 blobs/balls in a much bigger window. http://www.toxi.co.uk/p5/blobsInterlace/ click to add a new blob at the mouse position. keys 2-4 will change the vertical interlace to fractional scanline widths/offsets and will create very weird overlays, ghost effects. press 1 to return to "normal".
|
http://toxi.co.uk/
|
|
|
vent
|
Re: interlacing
« Reply #1 on: Aug 16th, 2003, 8:10pm » |
|
I can't wait to try this technique on one of the more cpu intensive things I've created (and abandoned for that reason). Reminds me of when I was trying program an old microcontroller to generate an ntsc signal... unfortunately it never worked correctly.
|
« Last Edit: Aug 16th, 2003, 8:11pm by vent » |
|
http://www.shapevent.com/
|
|
|
|