     constructor: (@context, options={}) ->
         {@debug_canvas, @width=512, @height=256,
             @max_distance=10, @render_steps=8, @wait_steps=3} = options
-        @buffer = new Framebuffer(@context.render_manager, @w, @h, @context.render_manager.gl.UNSIGNED_BYTE)
-        @pixels = new Uint8Array(@w * @h * 4)
+        @buffer = new Framebuffer(@context.render_manager, @width, @height, @context.render_manager.gl.UNSIGNED_BYTE)
+        @pixels = new Uint8Array(@width * @height * 4)
         @pixels16 = new Uint16Array(@pixels.buffer)
         @distance = 0
         @alpha_treshold = 0.5

                        @mesh_by_id[id] = alt

    debug_xy: (x, y) ->
        x = (x*@w)|0
        y = ((1-y)*@h)|0
        @debug_x = x
        @debug_y = y


        # Extract pixels (some time after render is queued, to avoid stalls)
        if @step == @render_steps + @wait_steps
            # t = performance.now()
            gl.readPixels(0, 0, @width, @height, gl.RGBA, gl.UNSIGNED_BYTE, @pixels)
            # console.log((performance.now() - t).toFixed(2) + ' ms')
            @step = 0
            @rounds += 1
