You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImGui 1.93.0's ImDrawList rework changed the layout of the baked anti-aliased line
texture table (ImDrawListSharedData::TexUvLines[], now (u0, u1, v, 1/thickness)) and
selects entries through the new ImDrawList::_SelectLineTexture() helper. ImPlot3D reads
that table directly in GetLineRenderProps(), so against ImGui ≥ 1.93 it picked the wrong
UVs and anti-aliased lines rendered incorrectly / were not visible.
This ports the upstream ImPlot fix to ImPlot3D.
Changes
GetLineRenderProps() now mirrors ImDrawList::_SelectLineTexture() for the new TexUvLines[] layout and adds the anti-aliasing fringe to half_weight.
Since ImDrawList3D is not an ImDrawList, the selection logic is inlined against _SharedData (with _FringeScale == 1) instead of calling the method.
Guarded with #if IMGUI_VERSION_NUM >= 19299 || defined(IM_DRAWLIST_TEX_LINES_SAMPLE_COUNT);
the pre-1.93 path is kept unchanged for older ImGui.
ImPlot #711 (AddLineH() / AddLineV() wrappers,
added in ImGui 1.92.8) is not ported: every ImPlot3D line is a 3D-projected segment at an
arbitrary screen angle, so there are no axis-aligned AddLine() calls to replace.
Hmm it feels like we could decide to redesign the function to be part of ImDrawListSharedData.
I think it could wait until we finish some work on making baked corner dynamic as it may further changes a few things, and until then you can use this code. As soon as we change it (if we do) i'll let you know.
About hard-coding fringe to 1.0f.
Do you have a Mac?
Unfortunately Mac style scaling works a bit differently.
draw_list::_SetPixelDensity() is called once a frame per drawlist and with _SetPixelDensity(2.0f) will set _FringeScale to 0.5f.
You may copy value from any drawlist in the same viewport.
It's not even easy to notice: this was broken on Mac until this week, FringeScale was always set to 1.0 as a result the AA fringe was thicker than necessary, making things a little bit more blurry on retina.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
ImGui
1.93.0'sImDrawListrework changed the layout of the baked anti-aliased linetexture table (
ImDrawListSharedData::TexUvLines[], now(u0, u1, v, 1/thickness)) andselects entries through the new
ImDrawList::_SelectLineTexture()helper. ImPlot3D readsthat table directly in
GetLineRenderProps(), so against ImGui ≥ 1.93 it picked the wrongUVs and anti-aliased lines rendered incorrectly / were not visible.
This ports the upstream ImPlot fix to ImPlot3D.
Changes
GetLineRenderProps()now mirrorsImDrawList::_SelectLineTexture()for the newTexUvLines[]layout and adds the anti-aliasing fringe tohalf_weight.ImDrawList3Dis not anImDrawList, the selection logic is inlined against_SharedData(with_FringeScale == 1) instead of calling the method.#if IMGUI_VERSION_NUM >= 19299 || defined(IM_DRAWLIST_TEX_LINES_SAMPLE_COUNT);the pre-1.93 path is kept unchanged for older ImGui.
References
(commit
7eeb916, "useImDrawList::_SelectLineTexture()").ImDrawListv1.93 changes.AddLineH()/AddLineV()wrappers,added in ImGui 1.92.8) is not ported: every ImPlot3D line is a 3D-projected segment at an
arbitrary screen angle, so there are no axis-aligned
AddLine()calls to replace.