ImGui and MSAA #758
-
Hi All, I was wondering if anybody has got ImGui to work with MSAA? I have ImGui working well in my application already. When I switch on MSAA using
my general 3D scene looks great, but the ImGui windows are squashed up into a corner and I get a heap of validation errors about VkPipelineMultisampleStateCreateInfo::rasterizationSamples must be the same as the current subpass. I know it's because ImGui renders straight onto the screen space and I need to resolve the multisample frame buffer before passing it to ImGui, I'm just not sure how to go about it. Has anyone else tackled this successfully? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 3 replies
-
Good question. ocornut/imgui#2706 addresses this question from the ImGui side. After a very quick look, I think you should be able to change the setup code in RenderImGui.cpp (_init()) to pass a multisample count to ImGui. |
Beta Was this translation helpful? Give feedback.
-
A quick search of vsgImGui comes up with the following code in imgui_impl_vulkan,cpp:
|
Beta Was this translation helpful? Give feedback.
-
I decided to use this issue to finish up some work I did on vsgImGui last month but hadn't merge with master, and to update imgui to the latest v1.89.4 release and implot to master to keep things compiling. This work is in the ImGuiNode branch: https://github.com/vsg-dev/vsgImGui/tree/ImGuiNode I have also checked into vsgExamples master the addition of --samples <num_samples> to the vsgimgui_example to test the issue that @rolandhill reported and the issue appears with the ImGui dialog appearing tiny :-) I will now look into fixes the issue. |
Beta Was this translation helpful? Give feedback.
-
I have got the MSAA working with the commit to the ImGuiNode branch: I need to reflect on this branch before merging with vsgImGui master. |
Beta Was this translation helpful? Give feedback.
-
I have adapted @timoore work on adding texture images to vsgImGui to work with my refactor that I did in the ImGuiNode branch, and have adapted Tim's changes to vsgimgui_example to work with this new scheme as well. Changes can be found in the ImGuiNode branch of vsgImGui and vsgExamples: https://github.com/vsg-dev/vsgImGui/tree/ImGuiNode
Could folks test out the above ImGuiNode branches as this should make vsgImGui more flexible, support MSAA and texture images. if that works fine then I'll merge with vsgImGui and vsgExamples master. |
Beta Was this translation helpful? Give feedback.
-
Hi Robert,
I tested the ImGuiNode branches of vsgImGui and vsgExamples. The
vsgimgui_example example worked perfectly. I then tested my own application
and it works perfectly too. I don't see how it could get any simpler - just
set windowTraits->samples to the value you want and it's done. I notice
that setting windowTraits->vulkanVersion = VK_API_VERSION_1_2 is not
required anymore either.
The only other thing I noticed is that I get errors building vsgExamples
for vsgviewer and vsgmeshshader. They also threw errors on the master
branch.
Thanks for the fantastic support!
Regards,
Roland
…On Wed, 22 Mar 2023 at 06:26, Robert Osfield ***@***.***> wrote:
I have continued to refine the ImGuiNode branch of vsgImGui and
vsgExamples, I'm trying to simplify usage and implementation while make it
more flexible. I've run out of day to wrap this work up so will return to
it tomorrow. Testing out these two branches is still helpful as an
feedback/insights that you can provide I can help shape the final elements
of work.
—
Reply to this email directly, view it on GitHub
<#758 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQ76JHOGEU3SIOD5DQTW5H6EVANCNFSM6AAAAAAWCF7TV4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the response, Tim. I did search for this on the ImGui pages but
didn't come up with that issue, only older ones suggesting I had to resolve
the multisamples first.
As you will have seen, Robert has addressed this now in the ImGuiNode
branch. I've tested it and it's working well now.
Cheers,
Roland
…On Tue, 21 Mar 2023 at 21:11, Tim Moore ***@***.***> wrote:
Good question. ocornut/imgui#2706
<ocornut/imgui#2706> addresses this question from
the ImGui side. After a very quick look, I think you should be able to
change the setup code in RenderImGui.cpp (_init()) to pass a multisample
count to ImGui.
—
Reply to this email directly, view it on GitHub
<#758 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQ3CY3PNO34G2WRAR4TW5F5FZANCNFSM6AAAAAAWCF7TV4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I synced my fork with VSG then pulled from my fork. I'm using the master
branch. Git Graph shows the following
[image: image.png]
Maybe V1.0.4 has moved ahead of master on the VSG repo.
Cheers,
Roland
…On Wed, 22 Mar 2023 at 19:08, Robert Osfield ***@***.***> wrote:
That's good to hear.
The compile error with vsgviewer and vsgmeshshader suggest to me that you
need to update your VSG version to 1.0.4 or master.
—
Reply to this email directly, view it on GitHub
<#758 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQYPJA2EWBCPXHWYXD3W5KXOPANCNFSM6AAAAAAWCF7TV4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I have completed my refactor of vsgImGui to make it more flexible, update to ImGui v 1.89.4 and ImPlot master and to support image texture using a new vsgImGui::Texture class: Changes to vsgImGui This also has the support for handling the MSAA. I have updated the vsgImGui version to 0.1.0 and vsgExamples to 1.0.4 to reflect these changes. I will post more info on a separate Discussion thread for the vsgImGui thread as this thread really about the MSAA issues. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Robert. I just repulled and rebuilt everything using master
branches and it all works. I did it before, but must have screwed up
somewhere along the way.
Cheers,
Roland
…On Wed, 22 Mar 2023 at 20:11, Robert Osfield ***@***.***> wrote:
I have just done a diff and VulkanSceneGraph-1.0.4 and VSG master are the
same.
—
Reply to this email directly, view it on GitHub
<#758 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQZMNT5MBZ3IVJWOE3TW5K63TANCNFSM6AAAAAAWCF7TV4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
I have got the MSAA working with the commit to the ImGuiNode branch:
vsg-dev/vsgImGui@14c9dc8
I need to reflect on this branch before merging with vsgImGui master.