My favorites | Sign in
Project Home
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 25: Interlacing in parallel mode
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ejrh00@gmail.com
Closed:  Nov 2011


 
Project Member Reported by ejrh00@gmail.com, Nov 17, 2011
Parallel mode cuts the fractal into contiguous segments of num_frames pixels, and fills them in sequence.  This means the fractal is drawn in diagonal bands that gradually become wider.  Sometimes due to the parameters this looks like a nice gradual fade, but other times it's annoying.

We should make it do those pixels in the segment in an "interpolative" order, e.g. instead of doing 0, 1, 2, 3, ..., 40 it should do sparse points then the midpoints of them, then the midpoints of those.  A power-of-2 scheme makes this easy, in the above example it becomes:

0, 32, 16, 8, 24, 40, 4, 12, 20, 28, 36, ..., 39.

An algorithm for this is:

frame_step = the power-of-2 nearest num_frames
frame = 0
Render(frame)
frame = next_frame

next_frame is:

frame += frame_step*2
if frame >= num_frames:
    frame_step >>= 1
    frame = frame_step

Nov 17, 2011
Project Member #1 ejrh00@gmail.com
Slightly tricky: there are edge cases at both the start and end of the process.  Works now though.  We set frame_step >= num_frames*2, and frame = 0 at the start, so frame 0 is drawn, then the frame step is halved, frame 32 (e.g.) with frame step 64 (e.g.), then it's halved, then the rest.  And we terminate when frame_step = 1.

However, by the time it's filling in every odd frame, the effect is largely the same as the original incremental mode.

Which suggests a recursive solution: while doing all the frames for a given frame_step, we should apply the same algorithm to interlace them!  If I implement that scheme it'll be easiest to pre-permute the frame numbers at the start.

Should try to research it somehow.

Nov 17, 2011
Project Member #2 ejrh00@gmail.com
It's called a "low-discrepency sequence".

See discussion at http://stackoverflow.com/questions/8176743/recursive-interlacing-permutation.
Nov 19, 2011
Project Member #3 ejrh00@gmail.com
Fixed in r149.
Status: Fixed

Powered by Google Project Hosting