-
Notifications
You must be signed in to change notification settings - Fork 388
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
Line strips are no longer a disconnected series of quads #8065
Conversation
…gments, add alias for flag combination
@@ -47,6 +47,9 @@ const FLAG_CAP_START_EXTEND_OUTWARDS: u32 = 32u; | |||
const FLAG_COLOR_GRADIENT: u32 = 64u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the really important changes are in this file
if uniforms.blend_with_background == 0 { | ||
// To not apply this hack needlessly and account for alpha from alpha to coverage, we have to ignore alpha values if blending is disabled. | ||
color = vec4f(color.rgb, 1.0); | ||
} else { | ||
color = vec4f(color.rgb * color.a, color.a); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improves alpha to coverage artifact suppression story. In other words this gets non-map views to where they were in 0.19
Tbh. I'm not 100% sure why I did get still artifacts for boxes in 3D without this, but it also didn't feel that surprising.
What about https://rerun.io/docs/reference/types/archetypes/arrows2d ? |
@emilk I should have formulated that more clearly (fixed now!): the shading specifically is slightly broken (see pic). But we don't have the shading ever enabled in Rerun, we made that an opt-in operation edit: also, the text previously confused left/right when referring to before/after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Can't say I follow all details in the shader code, but I tested it a bit it seems to work great.
Make sure to test this on WebGL and WebGPU! |
Did! On the Mac only mostly though |
What
Fixes a long standing issue that the segments of a line have small gaps between them.
Other than originally planned, the solution employed here is entirely based on fragment shader discard + elongation of the line. This can cause some slight artifacts for 3D lines but it's quite hard to spot those issues. Otherwise the biggest drawback of this is that we have more overdraw which gonna be tricky to deal with once we add transparency. On the flip side this is fairly simple and can re-use some of the round cap handling code - round caps no longer use the "trailing triangle" we had for every strip internally, and instead use the quad extension, actually leading to better looking round caps.
Line loops on map view:
Before:
After:
RRT Star:
Before:
After:
3D line snippet snippet:
Before:
After:
Failure Example in #7191
Before - confusingly broken:
After - pretty bad rendering performance due to quite massive overdraw of alpha tested geometry, but no longer broken.
(After: setting the radius to something large, but sane)
re_renderer 2D demo. Left before, right after. Note that "shaded lines" look a lot better now as a sideffect, with shading of arrows slightly broken. Afaik we don't use this anywhere in Rerun today though.
However, rounded caps are higher quality now in general.
Things that were several segments before can now be strips. No visual change there:
Rectangles:
Frustum:
Box wireframes:
This fixes a regression! In 0.19 those boxes had disconnected lines, in 0.18 this still worked since they were separate segments with rounded corners.
Before (regression):
After:
Due to aforementioned always-round-caps, a list of segments can now look indistinguishable from a single strip:
Under more extreme circumstances it is still (!) possible to have boxes exhibit some artifacts:
This is due to the quasi-capsule nature of our line segments. Calculating a world position from ray-capsule intersection would yield the correct result. What's actually happening right now is that we interpolate the world position over the spanned quad (which is a lot cheaper).
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.Testing