Clamp splat RGB to positive in splatVertex, matching the reference rasterizer#387
Clamp splat RGB to positive in splatVertex, matching the reference rasterizer#387viethungle0503 wants to merge 2 commits into
Conversation
|
Thanks for the pull request, though I don't think The key difference with In any case, I suggest moving the logic to |
|
Thanks for the feedback — I hadn't considered that the same encoder also packs the pre-SH source representation, where clamping would shift the SH-evaluated result. I've moved the clamp to Re-ran my scenes to confirm: the float-target corruption is gone, the ext path matches the 8-bit reference again, and output on a normal canvas is still byte-identical before/after. |
|
Looks good to me |
Fixes #386
Trained 3DGS scenes normally contain some negative base colors. The packed encoders clamp those away at pack time, but
packSplatExt/packSplatExtCovpack raw fp16 — the negatives then turn into NaN insrgbToLinear(powwith a negative base is undefined in GLSL) and, when rendering into a float target where blending doesn't clamp, end up in the framebuffer as black blobs and neon speckles. Screenshots and the full story in #386.This adds the same clamp semantics the packed path already has, at the top of both ext pack functions: negatives and NaN go to zero (a NaN alpha then falls below
minAlphaand the splat is discarded), +Inf caps at fp16 max, and everything in between passes through so the ext encoding keeps its HDR headroom.Output on a normal canvas is byte-identical before/after — the fixed-function blend clamp was already enforcing these semantics there — so the change only shows up where things were broken.