Build the idea, one step at a time一步步建立理解
Need a math refresher?需要补一点数学基础?
Open only the tool you need; return here to use it in the next step.按需打开一个小工具,再回到本课把它用起来。
Matrices & covariance矩阵与协方差Derivatives as local rates导数:局部变化率STEP步骤 1 / 5
Move the world into the camera’s frame把世界搬到相机坐标系
Subtract the camera position, then rotate into its axes. This lesson uses +Z forward and +Y down, with a centered pinhole camera and no lens distortion. The wgpu host converts conventions for its right-handed view and clip transform. Column vectors, axis directions and matrix layout must be agreed before multiplying.先减相机位置,再旋转到相机的坐标轴。本课采用 +Z 向前、+Y 向下、无畸变的居中针孔相机。wgpu 主机代码会转换为自己的右手观察与裁剪约定。列向量、坐标轴方向与矩阵布局必须先约定好。
STEP步骤 2 / 5
Divide by depth为什么要除以深度
Similar triangles give horizontal image displacement divided by focal length equal to X divided by Z. Multiply by focal length, then add the principal point. Focal lengths here are measured in pixels. For X = 1, Z = 10, f = 100 and cx = 64, u = 74. A point at nonpositive depth is outside this teaching camera’s valid projection.相似三角形给出“像面横向偏移 / 焦距 = X / Z”。乘焦距,再加主点位置,就得到像素坐标。这里焦距单位为像素。X = 1、Z = 10、f = 100、cx = 64 时,u = 74。深度非正的点不属于这套教学投影的有效范围。
STEP步骤 3 / 5
Ask how a tiny move changes the image微小位移会让屏幕变化多少
At fixed depth, increasing X by δX changes u by (f/Z)δX. Increasing depth makes the same X subtend a smaller angle: the local multiplier is −fX/Z². Collect these multipliers for u and v into J. A derivative is a local conversion rate, and the Jacobian is a table of those rates.固定深度时,X 增加 δX,u 增加 (f/Z)δX。深度增大,同一个 X 张开的角度变小,其局部倍率是 −fX/Z²。把 u、v 对三个坐标的倍率收进 J。导数是局部换算率,Jacobian 就是这些换算率组成的表。
STEP步骤 4 / 5
Project the axes, then rebuild the shape投影各条轴,再重建形状
Write covariance as the sum of outer products of scaled axes aₖ. Each axis becomes Jaₖ in screen space. Adding their outer products gives C = JΣcJᵀ. This is a local linear approximation to perspective; a whole 3D Gaussian is not exactly a 2D Gaussian after perspective projection. Our shader adds 0.3 pixel² to each diagonal for a minimum footprint.把协方差写成缩放轴 aₖ 的外积之和,每条轴投影后变成 Jaₖ,再把外积加起来就是 C = JΣcJᵀ。这是透视的局部线性近似;整个三维高斯经透视投影并不严格等于二维高斯。本项目 shader 给对角线各加 0.3 像素平方,提供最小覆盖。
STEP步骤 5 / 5
Connect the traditional pipeline接上传统图形管线
A triangle pipeline follows world → view → clip → perspective divide → NDC → viewport → rasterization. A splat pipeline shares the camera transforms but must also project covariance and evaluate a soft pixel weight. In this project, a small triangle quad encloses each ellipse; the fragment shader computes the actual falloff.三角形管线经过世界 → 观察 → 裁剪 → 透视除法 → NDC → 视口 → 光栅化。Splat 共用相机变换,但还要投影协方差、计算柔和的像素权重。本项目用三角形组成的小四边形包住椭圆,片元着色器才计算真正的衰减。
PUT NUMBERS IN代入数字
At the optical axis, a spherical scale of 0.2 at Z = 10 and f = 100 gives a projected standard deviation of 2 pixels before filtering. Including 0.3 pixel² gives √4.3 ≈ 2.074 pixels. Doubling depth reduces the unfiltered width to 1 pixel, not the world-space scale.在光轴上,球形尺度 0.2、Z = 10、f = 100 时,滤波前屏幕标准差为 2 像素。加 0.3 像素平方后得到 √4.3 ≈ 2.074 像素。深度加倍,滤波前宽度变成 1 像素,世界尺度没有变。