Bring back natively un-patterned lines (Fix parts of lines disappearing with large coordinates) #5216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This restores the init-time decision between having a line pattern texture or not, and replaces
lastlengtharrays with dummy data when they are not needed. This fixes an issue reported on Slack, where random segments of a line disappear:I didn't thoroughly think through the cause of this issue, but it's probably a Float32 precision issue with
f_pattern_overwriteinprocess_pattern()inlines.geom. The dates convert to large numbers ~6e13. Without patterns, GLMakie skipped projections when calculatinggl_last_length, so that they ended up with ~6f13 values too. With thepatterntexture always given, the shader ended up mixing those values with pixel scale offsets, which are way below float precision. I assume that (or something similar) caused texture sampling to break.Setting
gl_last_lengthto NaN's, Inf's, zeros, etc fixes the issue. Skipping thepattern::Texturebranches does too, and it should improve performance.Type of change
Checklist