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

end segment of circle arc scissoring #4419

Closed
rollraw opened this issue Aug 10, 2021 · 7 comments
Closed

end segment of circle arc scissoring #4419

rollraw opened this issue Aug 10, 2021 · 7 comments

Comments

@rollraw
Copy link

rollraw commented Aug 10, 2021

version: 1.82
branch: master

at first, i noticed that with dx9 renderer strokes are always anti-aliased even if imgui anti-aliasing is disabled
using following code in a fresh imgui example:

ImGui::GetStyle().AntiAliasedLines = false;
ImGui::GetStyle().AntiAliasedFill = false;
ImGui::GetStyle().AntiAliasedLinesUseTex = false;
ImGui::GetForegroundDrawList()->AddCircle({ 300, 600 }, 50.f, IM_COL32(243, 104, 224, 255), 12, 1.0f);

we will see this next with dx9:
dx9
and next with dx11:
dx11
i guess it could be related to bugs of dx9, because i tried to set dx9 renderstates to disable anti-aliasing but nothing changes

at second, circles (no sense filled/stroked) last segment looking scissored with magic '12' number as segments count (that will look for precached points), due to reduced segments count by 1 due to closed primitive drawing

@ocornut
Copy link
Owner

ocornut commented Aug 11, 2021

Thank you for the report.
There are two distinct issues there.

With dx9 renderer strokes are always anti-aliased even if imgui anti-aliasing is disabled

First question: even if it was fully the case, would you have an issue with it?
I did that

ImGui::GetStyle().AntiAliasedLines = ImGui::GetIO().KeyShift;
ImGui::GetStyle().AntiAliasedFill = ImGui::GetIO().KeyShift;
ImGui::GetStyle().AntiAliasedLinesUseTex = ImGui::GetIO().KeyShift;

dx9_aa
It doesn't look particularly "more" anti-aliased but I think the perception might vary depending on colors.

However it is possible there is something else in your app, e.g. multi-sample AA done by the app or by the GPU driver could alter that perception.

About the circle missing one segment:
Confirmed. I'm quite confused as 89685b3 (for 1.75) was explicitly intended to fix something and it appears it did the opposite. I think possibly the fix made sense before we switched to the new adaptive algorithm in 1.78 or a further change? Tagging @thedmd (or I'll check next time when I get back from holidays).

@thedmd
Copy link
Contributor

thedmd commented Aug 11, 2021

@ocornut I will take a closer look at the missing circle segment.

@ocornut ocornut added this to the v1.84 milestone Aug 11, 2021
thedmd added a commit to thedmd/imgui that referenced this issue Aug 11, 2021
…ices for 12 segment case (ocornut#4419)

Before introduction of adaptive arcs PathArcToFast() were operating on 12 vertices table.
Now it is replaced by internal _PathArcToFastEx() doing same job but with greater granularity,
PathArcToFast was left as a fallback.
@thedmd
Copy link
Contributor

thedmd commented Aug 11, 2021

@ocornut It is fixed on PR. I think this is how it should be from the begging, not patching AddCircle was my oversight.

Commit and PR have an extra comment, which I hope make the change clear.

@rollraw
Copy link
Author

rollraw commented Aug 11, 2021

However it is possible there is something else in your app, e.g. multi-sample AA done by the app or by the GPU driver could alter that perception.

it's not a my own app, just imgui example from latest commit, i also tried to explicitely disable multisample AA with

presentParams.MultiSampleType = D3DMULTISAMPLE_NONE;
presentParams.MultiSampleQuality = 0UL;

in the d3d device creation, but seems it doesnt helped, so yes could be related to gpu/drivers, but weird it happens only with dx9

@thedmd
Copy link
Contributor

thedmd commented Aug 11, 2021

Is AA forced in driver settings?

@rollraw
Copy link
Author

rollraw commented Aug 11, 2021

Is AA forced in driver settings?

you're right, found in nvidia docs about this, overriding of application antialising working only till dx10, it's so weird but ok i'm calm now

@rollraw rollraw changed the title dx9 always antialiased lines and end segment of circle arc scissoring end segment of circle arc scissoring Aug 11, 2021
thedmd added a commit to thedmd/imgui that referenced this issue Aug 19, 2021
@ocornut
Copy link
Owner

ocornut commented Aug 19, 2021

Should be fixed by cb00972
Thanks @thedmd !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants