3D viewer in KiCad 7.0.10 renders through holes with odd square cutout

As the title mentions, I noticed something odd (and new) in the 3D viewer. Through-holes are rendered with an odd square-shaped cutout around the hole itself. Any hole does that actually, be it holes without copper (but surrounded by a copper plane), holes with copper pads and vias.

No clue why nor what has happened. Could it be due to some setting I have inadvertently changed, I don’t know (but the result would still make no sense to me).

Does anyone have any idea?

Which OS
Help -About KiCad - copy version info

Application: KiCad PCB Editor x86_64 on x86_64
Version: 7.0.10, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.3.0
FontConfig 2.15.0
libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.59.0 nghttp3/1.2.0
Platform: Arch Linux, 64 bit, Little endian, wxGTK, KDE, wayland

Thanks, an unsupported Linux distribution.
HaffBuzz stands out as odd, but I would first try switching to software 3D rendering. Wayland has track record of problems.

Thanks dsa-t, yes it looks like this is the very same bug. Apparently long-standing, 5-year old.
I confirm that raytracing looks fine, it’s only in the OpenGL mode.

And 5 years ago, they already said " This bug has been around a long time, but was never reliably reproducible". So it’s basically been known for a pretty long time.
From what I can tell, this has never been solved. I understand that it seems not “reliably reproducible” - but clearly to me there’s a problem in the 3D rendering that goes way beyond any particular version of libraries or drivers, given it has been there for years.

Since it’s 100% reproducible on my setup at the moment, happy to do further testing to help with it. If there’s any interest. Otherwise I guess I’ll stick to raytracing for sharing/publishing 3D renders, and I’ll live with the square cutouts for viewing. I’ll still take that over software rendering any day.

The bug may well be in a third party library. There isn’t much KiCad code unchanged since so long ago.
Raytracing works. Did you try software vs hardware rendering with “Fallback graphics”?

If you’re familiar with OpenGL and can use apitrace to see what’s happening with the half-circle texture and can modify+test KiCad, it would be great if you could provide a patch.
Otherwise, I don’t think just remote testing would be productive.

I’m not familiar enough with OpenGL textures, and even less so with KiCad’s code base, to do anything really helpful on that front, I’m afraid. Or I would have to spend a lot of time getting into that first.

Hi there,

appeared for me with KiCAD 8.0.0 again. I think I had it in 7.0 as well but used software rendering then.
But now i can’t find the setting again.

I’m on SteamDeck (desktop mode)

Application: KiCad 3D Viewer x86_64 on x86_64

Version: 8.0.0, release build

Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.1.1
FontConfig 2.15.0
libcurl/8.5.0-DEV OpenSSL/3.1.5 zlib/1.3.1 nghttp2/1.58.0

Platform: Freedesktop SDK 23.08 (Flatpak runtime), 64 bit, Little endian, wxGTK, X11, KDE (One-Time Launch), x11

Build Info:
Date: Feb 23 2024 23:25:22
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.84.0
OCC: 7.7.2
Curl: 8.5.0-DEV
ngspice: 42
Compiler: GCC 13.2.0 with C++ ABI 1018

Thanks for the report. As mentioned, it’s a problem that’s definitely been known for years.

As dsa-t evoked, I do also suspect that the culprit may lie with an OpenGL fragment shader specifically written for rendering circles. I’m unfortunately really not familiar with fragment shaders. And it’s quite possible that the end result depend on the exact version of OpenGL being used, and its implementation via your GPU driver. Not trivial. I can just say that I haven’t noticed any other similar artefact with other applications using OpenGL with the exact same versions.

Note that I use KiCad 6 in parallel to support older projects, and I just tried it (hadn’t used its 3D viewer in a while), and the same rendering issue with holes is now present, as in v7, and wasn’t before.

So, definitely linked to a recent change in mesa and/or the GPU driver (I’m using an AMD GPU), but given how old this issue is, the “trigger” is still likely in a problematic fragment shader. But it’s not due to the 7.0.10 version of KiCad specifically. (And we have a user who has the issue with v8 here as well anyway.)

1 Like