Skip to content

Fix axis aligned gaussian causing NaN in shader#18

Merged
LioQing merged 1 commit intomasterfrom
fix-axis-aligned-nan-case
Feb 21, 2026
Merged

Fix axis aligned gaussian causing NaN in shader#18
LioQing merged 1 commit intomasterfrom
fix-axis-aligned-nan-case

Conversation

@LioQing
Copy link
Copy Markdown
Owner

@LioQing LioQing commented Feb 21, 2026

Finally fixed this annoying issue, it is caused by axis aligned Gaussian position (which is why the coverage/model.ply did not have this problem, because the Gaussian positions are not axis aligned), causing the eigenvector to be 0, 0, which gave an NaN when normalizing

image

Closes #8

@LioQing LioQing added this to the v0.6.1 milestone Feb 21, 2026
@LioQing LioQing requested a review from Copilot February 21, 2026 10:55
@LioQing LioQing self-assigned this Feb 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical rendering bug where axis-aligned Gaussian positions caused NaN values in the shader during eigenvector normalization. The issue occurred when the 2D covariance matrix had zero off-diagonal terms and equal eigenvalues, resulting in a zero-length eigenvector that produced NaN when normalized.

Changes:

  • Added zero-vector check before normalization in cov2d_axes function to prevent NaN values
  • Updated coverage data (auto-generated)

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/shader/utils.wesl Fixed NaN bug by using select to provide fallback direction when eigenvector is zero
coverage/lcov.info Auto-generated code coverage data update

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/shader/utils.wesl
@LioQing LioQing merged commit ad22428 into master Feb 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render glitch in camera orientation edge case

2 participants