-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
# Conflicts: # src/GLVisualize/visualize_interface.jl # src/glwindow.jl # src/screen.jl (NOTE: appears to solve the GPU utilization problem but sliders etc don't respond)
This line needs to use |
The reason I stopped working on this and made it a draft was that I wanted to do something more fancy. Specifically something like nodes in Blender to select which shaders are applied and how data flows. I didn't get very far with that though. If this makes things significantly better for macos maybe we should just merge it and make something better later |
Thanks @ffreyer, though unfortunately that doesn't seem to resolve it. |
New info: I just noticed that at least one widget ( |
Some progress.. I've been able to make other widgets 'work' again, some surgery in AbstractPlotting was required. By 'work' I mean that since I really have no business performing this kind of surgery without a medical license, it could be that really they just appear to work and something is totally borked under the hood. Actually looking closer certainly something isn't working quite correctly: sliders do respond to the mouse but the slider handle jumps away from the mouse so it isn't under it once you start dragging. At least sometimes--changing the window size seems to have something to do with it. Buttons seem OK. I haven't tried to apply my 'fixes' to the other widgets yet. Interestingly the GPU % as reported by Activity Monitor is still close to 100%, but overall graphics performance doesn't seem to be negatively affected the way it is with current GLMakie master. But, I feel this is close. I need to put a pin in this for now but in case it's useful here are the branches of GLMakie and AbstractPlotting that represent where I'm at: https://github.com/pbouffard/GLMakie.jl/tree/work-in-progress When I get a chance later this week I'll try to clean this up. |
To look at the objectid buffer: using GLMakie, ModernGL
using GLMakie: GLVisualize, GLAbstraction
fig, ax, pl = scatter(1:10)
scene = fig.scene
img = let
screen = scene.current_screens[1]
window_size = widths(screen)
fb = screen.framebuffer
buff = fb.buffers[:objectid]
glBindFramebuffer(GL_FRAMEBUFFER, fb.id[1])
glReadBuffer(GL_COLOR_ATTACHMENT1)
sid = zeros(GLMakie.SelectionID{UInt32}, window_size...)
glReadPixels(0, 0, window_size..., buff.format, buff.pixeltype, sid)
sid
end
image(first.(img)) You can also get this to display directly, without copying from the GPU and feeding it back. For that change There are also some calls to |
Ok, I had to also add I don't think I did anything similar to #145, not intentionally, at least. |
objectid_buffer = Texture(Vec{2, GLuint}, fb_size, minfilter = :nearest, x_repeat = :clamp_to_edge) | ||
position_buffer = Texture(Vec4f0, fb_size, minfilter = :nearest, x_repeat = :clamp_to_edge) | ||
normal_occlusion_buffer = Texture(Vec4f0, fb_size, minfilter = :nearest, x_repeat = :clamp_to_edge) | ||
objectid_buffer = Texture(Vec{2, GLushort}, fb_size, minfilter = :nearest, x_repeat = :clamp_to_edge) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be Gluint
because of #126.
I fixed things in my pr |
Thanks @ffreyer!! |
Okay, awesome! I just tried #107 and it seems to significantly improve performance on my Mac. Thank you for this! |
So this is actually the PR #107 from @ffreyer with merge conflicts resolved. I does seem to solve the GPU usage issue on Mac, and 2D and 3D scenes appear to work properly, at least, with very minimal testing. However widgets appear to be broken: they appear as expected but don't respond at all.
Full disclosure: I do not know anything about the GLMakie internals and just did some educated guesses on resolving the merge conflicts. Submitting this PR in the hopes that there's just a minor delta from it to what will actually resolve MakieOrg/Makie.jl#678.
Also, I have no idea whether corresponding changes in other packages!
Apologies if this isn't quite the right process here, but I'm hoping this is helpful!