-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
fix: correctly render the tooltip triangle #4560
Conversation
From #4451
Answering this here since the other pr isn't really about this. I don't really like this as a fix. With lines having AA, you either have to let a bit of the (non tooltip) background show or cut off AA. It also likely fails if you change the size of the tooltip. The right fix for this should be to pin to the render order so that the lines get drawn after the background mesh components. That should already happen here based on the plot order. Since that's not the case I assume this ends up changing the order: Makie.jl/GLMakie/src/rendering.jl Lines 32 to 39 in 0f4b02d
where Makie.jl/src/layouting/transformation.jl Line 539 in 0f4b02d
or rendering is calculating slightly different, system dependent z values. (I.e. float precision issues) Either way that should be fixable with a translate!(line_plot, 0, 0, 1) like text has.
|
Ah, thanks for the pointer. Found where the large z translation was coming from. At the time of writing |
No I think that was correct. In DataInspector the tooltip is moved to large z so that it draws over other stuff. Iirc 9000 is the default for that. It gets applied with a If you check |
Ok, translated the outline by 1. Without this PR the z values are:
With this PR, the tooltip seems to be rendered correctly, but the z values are:
I don't understand why the triangle mesh bb has a z value of 0. I guess I don't really understand what |
Seems like boundingbox looks at the model matrix in a different way than the backend. But I think the pr should be fine now.
|
So what are possible steps to unify the two? We can probably squash a good bit of rendering bugs with consistency. |
This is great, thanks for pushing the PR to the finish line! |
This is ultimately a If you just consider the pipeline to be |
Just to confirm, the pipeline you're describing is within a single scene? My general understanding of 3D to 2D pipelines is as follows: There's a world coordinate system, every object has a transform that moves it relative to the world coordinate system (the object transform also defined a coordinate system relative to that object). You then compute the "view transform" of every object, which is just its location relative to the camera. Finally, apply a projection transform to create the 2D image and clip anything outside the view frustum. It's an elementary understand so if you could help me map the Makie pipeline to the version I understand, that would be helpful. Right now I have the following:
However, this doesn't seem like the correct mapping because I'm struggling to see a clean split between "object transform" and "projection transform" in the current Makie pipeline. I also don't understand where the "object definition" ends and where "object transform" starts, e.g. the model matrix for most plots (and other objects, sliders, etc.) seems to be an identity matrix, but they're magically in different locations relative to each other. |
Description
Fixes tooltip triangle rendering.
Before this PR:
After this PR:
Type of change
Checklist