Skip to content

Why make clamp to (tx,ty) during computing cov2d? Why the backward grad dJ_dz does not change whether the clamp happens or not? #75

@archershot

Description

@archershot

const float limx = 1.3f * tan_fovx;
const float limy = 1.3f * tan_fovy;
const float txtz = t.x / t.z;
const float tytz = t.y / t.z;
t.x = min(limx, max(-limx, txtz)) * t.z;
t.y = min(limy, max(-limy, tytz)) * t.z;
const float x_grad_mul = txtz < -limx || txtz > limx ? 0 : 1;
const float y_grad_mul = tytz < -limy || tytz > limy ? 0 : 1;

Clamp (tx,ty) seems to make Gaussians closed to view space (ndc). And for remote huge Gaussians, it would contribute for rendering when its radius is larger than 0.3*tanfov. Why preprocess gaussian like this? Isn't that a bug?

float dL_dtx = x_grad_mul * -h_x * tz2 * dL_dJ02;
float dL_dty = y_grad_mul * -h_y * tz2 * dL_dJ12;
float dL_dtz = -h_x * tz2 * dL_dJ00 - h_y * tz2 * dL_dJ11 + (2 * h_x * t.x) * tz3 * dL_dJ02 + (2 * h_y * t.y) * tz3 * dL_dJ12;

And for the later grad computing of dL_dtz. It should be affected by the clamp, like clamp J[0,2] from "-fxtx/(tztz)" to "-fx/tz*clamp(fov)". But the above implementation ignore the clamp for dL_dtz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions