Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo: Improve boundsError to take camera parameters into account #786

Merged
merged 3 commits into from
Oct 9, 2024

Commits on Oct 7, 2024

  1. demo: Improve boundsError to take camera parameters into account

    While boundsError is an approximation and the precise version would
    compute the projected sphere bounds taking into account perspective
    distortion and near plane clipping, our simpler variant can work as well
    and is invariant to camera rotation which is a nice property in certain
    cases; for example in VR you might want to compute LOD based on a
    "third" eye, a center camera, so that the geometry is in sync between
    two eyes.
    
    Our boundsError implementation was mostly serviceable but did not depend
    on camera field of view and had some potential issues with monotonicity
    for cases where the camera position was inside the sphere.
    
    We now clip the distance to znear and properly scale it so that the
    result is a normalized screen space error (0..1, multiply by screen
    height to get pixels). This ensures that if the bounds.error is 0,
    boundsError will return 0 even if the camera is inside, which should
    ensure proper cluster selection for extreme closeups.
    zeux committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    81d49de View commit details
    Browse the repository at this point in the history
  2. demo: Fix .obj normal indices serialization

    We previously output the normal values but not normal indices; when
    imported, editors tend to ignore the normal data as a result.
    zeux committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2a97945 View commit details
    Browse the repository at this point in the history
  3. demo: Add basic normal integration for simplification

    For now we use a fairly low weight (0.5); 1.0 is generally more
    appropriate for full mesh simplification at least but we'll start
    conservative for now.
    zeux committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    c664ea2 View commit details
    Browse the repository at this point in the history