-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
What are these bleaches on the window? (After upgrading to v1.90.3) #7342
Comments
Hard to say without more information. Could be an obscure bug in the library or render backend that manifests itself with your custom rendering, could be a mistake in your custom rendering that didn't make a difference until some bug was fixed in the library. What version did you use before and how did it look then? Can you pinpoint the revision that broke your custom rendering? Should be doable in a small amount of attempts if you use a binary search pattern while switching revisions. F.e., if the current revision -1000 still worked, try -500. If that still works, you limited the break to the range of -500 to 0, try -250 next. If -500 already didn't work, the break is in -1000 to -500, try -750 next. After 10 steps like this, you are down to the exact revision. Also always a good way to analyze rendering problems: make a frame capture with RenderDoc and look if anything is incorrectly set up. |
@GamingMinds-DanielC
Also I had to change some code lines to adapt the deleted functions, e.g. :
To note that I'm not experinced at ImGui, I'm still learning and I appreciate the community help, thanks. |
Version 1.63 is quite ancient (from 2018), so it's most likely not a single commit that is to blame. My best guess is that the blending setup in the renderer backend changed since then. The best way to check that is still RenderDoc, by capturing frames in both versions and comparing render states. There you can also check if your textures are OK. Your |
Ah, I figured out what's wrong. The old backend version likely used point sampling while the current one uses a bilinear magnification filter. Your texture doesn't extend its contained images into a small border, that's why stretched images bleed into the background color while filtering. This one f.e.: AddImage(n_01, ImVec2(512, 512), pos + ImVec2(48, 0), pos + ImVec2(size.x - 86, 37), ImVec4(414, 471, 4, 37)); If you want to stretch a 4 texel wide image across a lot more pixels, you need to add a border in your atlas, so that at least 1 pixel to the left and right are identical. Otherwise, the leftmost pixel is halfway between the leftmost texel of your specified coordinates and the texel to the left of it. Same goes for the right side, also for the top and bottom for vertically stretched textures. In your case 1 texel border should be enough, more are needed if you have mip maps for minification filters. A proper pre-processing of your texture would mark all pixels as part of a tile or part of the background gaps first. Then, set every texel to the average of all tile texels of the 8 texels around it if there are any. Mark those texels as tiles, repeat the process as many times as your borders need to be thick, or until no texels marked as background remain. An alternative would be to switch the texture sampler in the backend back to point sampling. |
On this specific suggestion by Daniel, also refer to #7230 |
Interesting ... What could be wrong now? as you see, the window is very dim, also the close button (still clickable). PS: changes I've done
|
You divided all coordinates by 256, then still by the texture size which is 512x512. So basically you are only sampling from the top-left 2x2 texels of your texture, which are just the background color between tiles. Everything being black is to be expected in this case. But why did you add additional clamping in the first place? Clamping is not the problem here, your texture coordinates were correct before. Your problem is either the missing border around tiles in your texture or the sampler setup in the render backend, neither is addressed by this change. Even if clamping was the problem it would be in the wrong place (the correct one would be the sampler setup again). |
Before I proceed to change the sampler setup, I wanna make sure if the function alright?
and the way to call it is like this?
|
Yes, that looks correct. |
Please use latest version and alter sampling state using AddCallback(), similarly to what is suggested there: Or adjust your texture to leave 1 pixel empty space between items. |
Done, thanks.
|
Version/Branch of Dear ImGui:
Version 1.90.3, Branch: Release (master)
Back-ends:
imgui_impl_dx9.cpp + imgui_impl_win32.cpp
Compiler, OS:
Windows 11, ISO C++ 17 Standard, Platform Toolset VS2022 v143
Full config/build information:
No response
Details:
The windows I used to create were having no issues with background and borders, however, after upgrading the .h/.cpp files of ImGui to v1.90.3 and modify some of the windows code to meet the changes done in the current version, the window started to show some bleaches all around the window, for example, the picture attached below:
I use my custom function to draw windows in a game I'm developing extension windows to it, as in the code snippets below:
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: