             @ctx.putImageData(@imagedata, 0, 0)
         return
         
+    single_step_pick_object: (x, y) ->
+        {gl} = @context.render_manager
+        @step = 0
+        coords = @get_byte_coords(x, y)
+        @buffer.enable()
+        gl.scissor(coords.x, coords.y, 1, 1)
+        @do_step()
+        while @step != @render_steps + @wait_steps - 1
+            @do_step()
+        @step = 0
+        gl.readPixels(coords.x, coords.y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE,
+            @pixels.subarray(coords.index, coords.index+4))
+        gl.scissor(0, 0, @width, @height)
+        @pick_object(x, y)
+        
     create_debug_canvas: ->
         if @debug_canvas?
             @destroy_debug_canvas()

        depth = ((depth_h<<8)|depth_l) * @max_distance * 0.000015318627450980392 # 1/255/256
        # First round has wrong camera matrices
        if id == 65535 or depth == 0 or @rounds <= 1
            radius -= 1
            if radius > 0
                return @pick_object((x+1) / @width, y / @height) or
                    @pick_object((x-1) / @width, y / @height) or
                    @pick_object(x / @width, (y+1) / @height) or
                    @pick_object(x / @width, (y-1) / @height)
            return null
        object = @mesh_by_id[id]
        if not object

                            gl.frontFace(2305) # gl.CCW
        @step += 1

        # Extract pixels (some time after render is queued, to avoid stalls)
        if @step == @render_steps + @wait_steps
            # t = performance.now()
