             @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()

        @debug_x = x
        @debug_y = y

    pick_object: (x, y, radius=1) ->
        # x/y in camera space
        xf = (x*2-1)*@inv_proj_x
        yf = (y*-2+1)*@inv_proj_y

        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
            return null
        object = @mesh_by_id[id]
        if not object
