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

Ellipsoid cutout #24

Closed

Conversation

hybridherbst
Copy link
Contributor

@hybridherbst hybridherbst commented Oct 9, 2023

Adds a "cutout" transform field in the inspector, that, when defined, visually cuts out the splats on an ellipsoid shape. This allows interactive editing and also using the same cutout for multiple scenes.

I moved the logic from the vertex shader into SplatUtilities.compute; what I'm unsure about (but what would be great!) would be to set the deleted bits correctly too so that when exporting a new PLY only the remaining splats are exported.

Some more ideas not covered by this PR:

  • allowing for a list of cutters
  • using a round box SDF instead of an ellipsoid for more control (one more parameter for "roundness" plus maybe a nice gizmo)

@aras-p
Copy link
Owner

aras-p commented Oct 10, 2023

Any opinions on whether this is better as a reference (list of references) to the cutout shape, or whether this would be better as an "editing tool"?

Right now it's a bit confusing since as soon as you pick the cutout shape, everything outside of it disappears. That can be easily addressed by making "outside of cutout" perhaps temporarily just have reduced alpha/size, so that you can "feel" the rest of the scene at least. And then maybe in the editor, have a button to "apply cutout" that would actually mark splats outside of it as deleted. Does that make sense? (I could implement that)

@hybridherbst
Copy link
Contributor Author

hybridherbst commented Oct 10, 2023

I like to keep things non-destructive as long as possible (so I like „store spherical shape“ better).

Maybe there’s a middle ground — how about:

  • when going into „Edit Mode“, you get a little plus button that adds a „Filter Object“
  • that is persisted as „filter object“ with pos/rot/scale/future props (no strong opinion if that’s better as serialized data or as GameObjects)
  • Those filters are implicitly applied to the deletion bits instead of having to press „Apply“
  • When exporting a PLY/merging things they’re also applied

What do you think? Could give that „editing feel“ but also an easy way to switch between „see all particles“ (when in edit mode) and „final object“ (leave edit mode)

@aras-p
Copy link
Owner

aras-p commented Oct 10, 2023

I'll play around with various options and see which one seems to work best :)

@aras-p
Copy link
Owner

aras-p commented Oct 11, 2023

@hybridherbst alright, so I took your PR and iterated on it a bit, can you try feature/ellipsoid-cutout branch from this repo and see if that makes sense?

  • Cutouts are not any game objects, but ones with GaussianCutout component. The component can switch between Ellipsoid and Box shapes.
  • Multiple cutouts are supported (splat stays alive if it's inside any of them, not all of them -- I think that makes sense?)
  • PLY export takes cutouts into affect too
  • Scene view display can be switched between "faded" and "hidden" for cutouts (and for deleted splats too)
  • Other minor updates to the inspector UI

Not done yet: in-scene drag handles for cutout shapes, similar to lights/colliders. Easy, but does not happen by itself :)

@hybridherbst
Copy link
Contributor Author

Thank you! Some feedback:

  • I think the flow works!
  • I found it a bit confusing that I'm not automatically going from "faded" to "hidden" mode when leaving editing; in which case would I want to leave editing but have faded?
    • Overall I find "faded" nice for editing mostly, but otherwise would always set to "hidden" when not editing anymore.
  • Currently a modified PLY can only be exported once at least one splat has been deleted, the cutouts don't count
  • Bit annoying that the Gizmos aren't shown while selecting the actual game object, but I think that's what you meant with adding in-scene drag handles.
    • Gizmos could also be drawn in OnDrawGizmos instead of check if any of the cutters is selected to determine if gizmos should be shown?
  • small separate issue, can't undo splat deletion
  • also can't reset deleted ones (they do reset after a domain reload)
  • hidden/faded state also resets after domain reload (to "faded")

@aras-p
Copy link
Owner

aras-p commented Oct 13, 2023

Good points, thanks for testing! Some of them already addressed (gizmos not being visible), some will try to address, some are "uhh hard, maybe later" (undo -- since all the selection/deletion state is in GPU side data only, making that integrate with undo system is doable but a bit of a hassle :)).

@aras-p
Copy link
Owner

aras-p commented Oct 13, 2023

Continuing over at #31 (I don't know how to add "my" commits on top your your PR hah). Thanks for making the initial change!

@aras-p aras-p closed this Oct 13, 2023
@hybridherbst hybridherbst deleted the feature/ellipsoid-cutout branch October 20, 2023 16:09
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.

2 participants