Skip to content

A potential mistake when calculating the opacity gradient. #86

@XiaoXinyyx

Description

@XiaoXinyyx

I believe there is an error in the opacity calculation within the 3dgs_accel branch.

In backward.cu, the gradient of alpha is calculated at line 608 as follows:

dL_dalpha += ((c[ch] * T) - (1.0f / (1.0f - alpha)) * (-ar[ch])) * dL_dchannel;

Subsequently, at line 619, the influence of the background color is added:

// Account for the last sample for color
dL_dalpha += (-T_final / (1.0f - alpha)) * bg_dot_dpixel;

However, I believe this addition is unnecessary. This is because ar[] is initialized earlier at line 576:

ar[ch] = -pixel_colors[ch * H * W + pix_id] + sampled_ar[global_bucket_idx * BLOCK_SIZE * C + ch * BLOCK_SIZE + idx];

Here, pixel_colors represents the output color of the forward render pass, which already includes the background color. As such, the influence of the background color is already accounted for. Therefore, I suggest removing line 619.

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