Repository navigation
HD models: no see-through specks on the Garand's sight and other custom guns - #1033
Conversation
Some custom weapon skins (PRE's Garand, Luger, M1 Carbine, scoped Kar) were converted to 256 colours with palette entry 255 left as an ordinary near-black, so dark metal pixels on it are cut out; each became a 4x hole that blinked as the gun swayed. On v_/p_ skins, see-through blobs of 8 px or fewer are now drawn solid in their neighbours' colour. Map models keep their small holes (leaf gaps, frayed flags, wire mesh). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (night pass 2026-10-25)Read: the whole diff ( Ran: One thing to know, not a blocker: Verdict: ready to merge. |
Release note: Fixed: HD weapon skins no longer show tiny see-through dots that flickered on some custom guns, like the Garand's rear sight on the pre-Anniversary install.
What was wrong
PRE's custom
dod\models\v_garand.mdlhas a skinskin3_test.bmp(512x512) flagged masked, so palette index 255 is drawn see-through. In this skin, palette entry 255 is an ordinary near-black (2,2,2), not a key colour: whoever converted it to 256 colours let dark metal pixels land on it. That leaves 1,170 see-through blobs (corner neighbours counted as one), all of them noise, and no real hole.models_hd.pytook the alpha straight from that mask, so each speck became a hole in the HD skin, and it blinked as the gun swayed against a bright floor. The same happens in PRE's custom Luger, M1 Carbine and scoped Kar skins (palette entry 255 = (4,4,4)).Fix
models_hd.py: on skins used by a model held in hand (v_orp_), see-through blobs of 8 px or fewer (corner neighbours count as one blob) are drawn solid in the HD file. Like every see-through pixel already, they take their nearest solid neighbour's colour. Real holes, like the stock Garand's 137 px peep sight, stay.test_models_hd.pycovers the threshold, corner-joined blobs, the edge, real holes, and that only weapon skins change.Decisions
v_,p_). All 200 unique masked skins in PRE's and POST'sdod,dod_addon,dod_downloadsandvalve\models, map models included, were surveyed. 98 have 1-3 px holes, and on map models most of them are on purpose: gaps between leaves (trees and bushes), the frayed edges of torn flags, gaps in wire and camo nets, and the spring mesh inrustcar.mdl. A size-only rule would fill all of those. A colour rule ("fill a speck painted the same colour as its surroundings") also failed: it filled the rustcar's mesh gaps, whose key is black on dark metal. On weapon skins the data is clear-cut: the smallest real hole in anyv_/p_skin in either install is 21 px.skin2_test.bmp, which is harmless.killfeed_icons.py) are untouched. PR Kill feed: an even layout where every weapon icon has the same height and nothing is cut off (#1022) #1023 changes that file. They were checked:d_garand(which draws part ofv_garand.mdl),d_scopedkar,d_kar,d_lugerandd_m1carbinewere rendered on PRE with the current skins and with speck-filled ones, and every pixel came out the same. The icons have no pinholes.models_hd.py.Survey: what this changes
All 314
v_/p_models in PRE and POST (dod,dod_addon,dod_downloads,valve\models) have 28 unique masked skins, and 6 of them change:dod\v_luger.mdl(custom)skin1_test.bmp512x512dod\v_luger.mdl(custom)skin2_test.bmp512x512dod\v_scoped98k.mdl(custom)skin2_test.bmp512x512dod\v_garand.mdl(custom)skin3_test.bmp512x512dod\v_m1carbine.mdl(custom)skin4_test.bmp512x512dod\v_luger.mdl,HLTV_Models\v_luger.mdl(stock)skin2_test.bmp256x256The other 22 masked weapon skins are unchanged. They include the stock Garand, M1 Carbine and Luger skin1, and every PRE custom skin keyed with pure blue (30cal, 98k, BAR, Bren, Enfield, Greasegun, MG34, MG42, Sten, Bazooka, Panzerschreck, scoped FG42, mortar). Map models are not touched.
Test done
python -m unittest test_models_hd test_studiomodelingoldsrc-hooks/tools/hd: 13 pass. CI doesn't run these Python tests; that was already true fortest_studiomodel.Rebuilt the affected skins on this PC. First, 43 files were backed up to
local\specks-backup\(PRE: 6 skins x 7 styles, ultrasharp, plain, x4plus, generalv3, remacri, siax and blend; POST: 1 in ultrasharp). Then those files were removed andmodels_hd.pywas run per style, plusbuild_all.py --types models blend. In the Garand's ultrasharp file, see-through pixels went from 7,608 to 376. PRE's partial custom styles (pbrify,ultrasharpv2,webphoto) don't hold these skins.In game, PRE, Brain account, game_probe with the WSOD25 capture DLL, 1280x720. Demo:
ktps8w4-element_gskill_armory_h2, element's POV with the Garand, around 7:13 on the demo bar, running past bright walls and the floor. There were three launches, 1 s of HLAE frames each:models\overridesfor that run and removed afterwards;ds_hd_enabled 0.In before, a few light dots blink on the lower half of the rear sight. In after, none show over 10 frames. The texture's own scratches look the same in both. With HD off, the original model shows the same kind of dots. That comes from the custom model itself, not from HD, and this PR doesn't change it. The difference is small at 1280x720; the screenshot this started from was larger. Review sheet:
local\review-images\specks\garand_rear_sight_before_after.png. The skin itself over white, before and after:garand_skin3_ultrasharp_{before,after}_on_white.png.Your test
<PRE>\dod_addon\dodstudio_hd\models\<each style>\deleteskin3_test.bmp_5bd6747b.tga,skin1_test.bmp_95fc9010.tga,skin2_test.bmp_2803c465.tga,skin4_test.bmp_4729aab9.tga,skin2_test.bmp_15824d37.tgaandskin2_test.bmp_3682be1c.tga. On this PC that's already done, and the old files are inlocal\specks-backup\.ktps8w4-element_gskill_armory_h2(element's POV, Garand) around 7:00 on the demo bar, while he runs with the Garand over the bright floor. The rear sight and receiver should show no light dots blinking as the gun sways.🤖 Generated with Claude Code