diff --git a/examples/aurora.psh b/examples/aurora.psh index 2f889c9..41aaf48 100644 --- a/examples/aurora.psh +++ b/examples/aurora.psh @@ -1,14 +1,14 @@ -// Mandelbrot Set Explorer +// Mandelbrot Set Explorer II // This example builds on mandelbrot.psh. // Differences: -// - Uses a different palette with green aurora borealis colors +// - Uses a different palette with aurora borealis colors // - Renders the set concurrently using actors // -// Each actor is given a (logical) portion of the image. -// For each pixel it calculates the color to render and -// sends a message to the main actor with the index and -// the color to paint, both packed in a single Integer. +// Each actor is given a set of rows and calculates the +// corresponding array of colors, sending it back to the +// main thread/actor where they are $memcpy'd onto the +// final image. let WIDTH = 640; let HEIGHT = 480; @@ -22,31 +22,21 @@ let IM_END = 1.125; let MAX_ITER = 60; let NTHREADS = 16; -// Distribute rows to hand to actors -fun calc_boundaries() { - let chunk_size = HEIGHT _/ NTHREADS; - let rem = HEIGHT % NTHREADS; - let var limit = 0; - - let boundaries = []; - for (let var i=0; i> 32; - frame_buffer.set_u32(idx, color); } -// print render time +// Print render time let render_time = $time_current_ms() - start_time; $println("Mandelbrot render time: " + render_time.to_s() + "ms");