Closed Duy-Thanh closed 1 week ago
Your basic idea to render into a texture and display that is valid, but there is not nearly enough information to say what went wrong. You can use tools like RenderDoc to analyze your rendering and check if your texture has the contents you expect it to have. Maybe your texture has an alpha channel that is zeroed out, that would make it effectively invisible.
If your problem boils down to how to render into a texture in the first place, that has nothing to do with ImGui itself, but there are lots of tutorials about that online.
As mentioned, none of this is really an dear imgui question. Your question is how to get your scene into a texture which is a DX11 question and we are not equipped to answer that here.
Assuming GetSceneTexture()
returns a valid ID3D11ShaderResourceView*
your call to ImGui::Image()
is enough.
Version/Branch of Dear ImGui:
Version 1.91.5, Branch: docking
Back-ends:
imgui_impl_Win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows 11 + MSVC 2022 17.11.5 + CMake
Full config/build information:
Details:
Question
I want to make my application can render the 3D object inside Viewport window, renderer using here is DirectX 11 D3D
But in some weird case, I can't make it work.....
I uploaded the entire project to GitHub, but I don't know if it's possible to link it here
If you need it, let me know!
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
Here is my Initialize code:
And the Viewport window: