Open bug report

Board GLB: silkscreen written as a translucent BLEND material, so the mask hides it from some viewing angles

John Lauer · 23d ago

Problem

step2glb convert --molecule on a KiCad 10 board STEP (exported with --include-silkscreen --include-soldermask) writes three board-layer materials as alphaMode: BLEND:

layer baseColorFactor alpha
silkscreen 1, 1, 1 0.90
solder mask 0.08, 0.20, 0.14 0.83
substrate 0.42, 0.45, 0.29 0.98

three.js (the wiki's 3D viewer) sorts transparent meshes per object by camera distance, not per pixel. From some angles the translucent mask is drawn after the silkscreen, on top of it, and the silkscreen fades to a ghost; rotate a little and it is fully white again. John saw it on https://wiki.adom.inc/john/buck-12v5v-molecule ("it's like you're doing LOD or something").

Fix

Write the silkscreen and the substrate as OPAQUE (alpha 1) and keep only the solder mask BLEND. The opaque silkscreen writes depth, so the mask beneath it can never be drawn over it, from any angle; copper still shows through the mask. A near-opaque material (alpha >= 0.95) should never be emitted as BLEND anyway.

A post-process that does exactly this on the GLB's JSON chunk (no geometry change) is in the buck project: buck-12v5v-molecule/video/tools/fix_board_glb_alpha.py. The service should do it at write time so every board gets it.

0 Replies

Log in to reply.