Open luxploit opened 1 year ago
Hello,
Not much of this is a dear imgui question. You are essentially asking us to debug your DX8 code here.
I personnally don’t know DX8 but hope you get it working, I see no reason for it to not work.
It has been ages since I used DX8. At a quick glance I couldn't see any obvious mistakes in your backend. I don't know how good RenderDoc is with DX8, but you should give it a try. If it works with that version, it's a great tool to debug rendering of any kind.
I seem to have fixed the core rendering issue, I didn't set the stream source correctly. Now I have to find an alternative to SetScissorRect, to fix the clipping, as that API doesn't exist on DirectX 8
As an alternative, you can set the render viewport and a properly configured projection matrix.
Using a vertex shader may be more natural.
As an alternative, you can set the render viewport and a properly configured projection matrix.
I've been trying with clip it using the viewport, didn't quite work out.
// Clip overflow using viewport
const RECT r = { (LONG)clip_min.x, (LONG)clip_min.y, (LONG)clip_max.x, (LONG)clip_max.y };
D3DVIEWPORT8 clipped_viewport = {
r.left, r.top,
r.right - r.left,
r.bottom - r.top,
0.f, 1.f
};
bd->pd3dDevice->SetViewport(&clipped_viewport);
That looks strange. Did you adjust the projection as well? And did you reset the viewport to the old value at the end?
I reset the viewport after calling DrawIndexedPrimitive, but I didn't adjust the matrix as I don't know how to.
Even if you can get it to work this way (and I think you can) I suspect altering viewport may be flushing too many things in the pipeline, I would recommend using a vertex shader.
I don't think a vertex shader would help much since it doesn't know about the triangles that the vertex is part of.
As for the adjustment of the projection matrix:: just as it is set up at the end of your ImGui_ImplDX8_SetupRenderState()
function, but with the clip rect taken into account.
Another alternative would be to set up four clip planes using IDirect3DDevice8::SetClipPlane()
. The documentation states how to set up the clip planes. Don't forget to enable them in the render states.
I'll try out using clip planes later today.
I'll try out using clip planes later today.
hello , have you fixed imgui with dx8 ?
I have not worked on this for a while no. But you're welcome to try it out, I'll upload the latest zip of my dx8 port later this week when I return home.
Looking forward to your new version
Version/Branch of Dear ImGui:
Version: 1.89.7 WIP (655aae5) Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_dx8.cpp + imgui_impl_win32.cpp Compiler: MSVC (Visual Studio 2015) Operating System: Windows 11 22H2
My Issue
I've been trying to port ImGui to DirectX 8.1b. So far I've managed to spawn the window and draw the background color, however none of the ImGui windows itself are displaying. They are however being created and are clickable, as I've set
ImGuiDebugLogFlags_EventMask_
on DebugLogFlags to see if they were even being created.I've attached the ported code aswell as the Installer for the DirectX 8.1b. To compile this however you will need to add an environment variable called DXSDK81 as the older DirectX SDK doesn't set one by itself. Additionally you may need to edit the line
typedef void * POINTER_64 PVOID64;
in winnt.h, as compiling with the DirectX 8.1 SDK causes an error on some machines, totypedef void * POINTER_64, * PVOID64;
. This requires changing ownership of the file (Located at C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h` from SYSTEM to your own user, and giving yourself the "Full Control" permission flag.Attachments example_win32_directx8.zip