In the wallpaper illusion, a repetitive pattern appears to shift from one depth plane to the plane nearest fixation. We measured the timing of this shift for a 6 degrees wide, 3-cpd sinusoidal grating presented in a rectangular envelope; the edges (envelope) of the grating were presented at 20 arcmin of disparity (one period) behind the fixation plane. We asked observers to signal when the segment appeared to move from the edge plane forward to the fixation plane. Initially, the shift from the edge plane took 4-6 s, but after many trials, the shift became faster. Additional experiments demonstrated that the envelope was adapting, thereby permitting the alternative match. Our measurements for a range of spatial frequencies and disparities showed that these shifts to the fixation plane occurred only if the envelope disparity was more than one-half period of the carrier; that is, phase disparity >180 degrees. We also found that stereoacuity for the initial envelope-based match was poor, as might be expected for a target presented far off the fixation plane. However, once the perceived shift in depth occurred, stereoacuity improved fivefold without any change in the physical stimulus. We speculate that access to the most sensitive V1 neurons depends on the extrastriate processes that determine perceived depth--in this case, second-order envelope mechanisms.