         distance = vec3.distance(point, cam.position)
         return {object, point, distance, normal: vec3.clone(point)}
 
-    do_step: (scene, camera) ->
+    do_step: ->
         gl = @context.render_manager.gl
-        m4 = @m4
-        mat = @mat
+        {scene, camera, m4, mat, world2cam, world2cam_mx} = @
         mat.use()
         attr_loc_vertex = mat.a_vertex
         attr_loc_normal = this.mat.attrib_locs.vnormal
-        world2cam = @world2cam
-        world2cam_mx = @world2cam_mx
         @buffer.enable()
         restore_near = false
 
         # Clear buffer, save camera matrices, calculate meshes to render
         if @step == 0
+            if @context._HMD
+                return
             # Change the far plane when it's too near
             if @pick_object(0.5,0.5)?.distance < 0.01
                 old_near = camera.near_plane


    init: (scene, camera) ->
        @add_scene(scene)
        do_step_callback = (scene, frame_duration)=>
            @do_step(scene, camera)
        scene.post_draw_callbacks.push do_step_callback

    add_scene: (scene) ->

        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
