-
Notifications
You must be signed in to change notification settings - Fork 315
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 broken on specific float values #261
Comments
@mellinoe any idea? |
Possibly your rasterizer playing tricks. It's definitely not a geometry problem (i.e. the line is not actually broken), it's rendering. I'm not sure how imgui works internally to generate lines but maybe it just creates a 1"px" geometry that your rasterizer fails to detect as pixels, what makes sense especially given the imprecision of the floats gpus deal with. If you want more elaboration do a c/cpp repro and ask in the imgui repo. One possible solution would be to snap to integers in the shader. Possibly that should be done by default I'd say. |
i did it on c++ imgui directly and couldn't reproduce the issue. following is the code i used.
|
figured out the solution, have to use LinearSampler over here (https://github.com/mellinoe/ImGui.NET/blob/master/src/ImGui.NET.SampleProgram/ImGuiController.cs#L133) rather than PointSampler. thx to Mellinoe and RenderDocs for all the help! |
issue fixed: ocornut/imgui#5156 |
Sorry if this question had being asked before, kindly refresh my memory if it is. Why in the following image the line gets broken when I change the box size. (code given below)
private static float X = 0.0f;
private static float Y = 619.500f;
private static float W = 351.0f;
private static float H = 248.0f;
// then in the render function
ImGui.DragFloat("X", ref X);
ImGui.DragFloat("Y", ref Y);
ImGui.DragFloat("W", ref W);
ImGui.DragFloat("H", ref H);
ImGui.GetBackgroundDrawList().AddRect(new Vector2(X, Y), new Vector2(X + W, Y + H), 0xFFFFFFFF);
The text was updated successfully, but these errors were encountered: