CraftLabCS Renderer Lab — editable source, first development version Independent rendering code: renderer/engine.mjs UI and browser imports: renderer/lab.mjs, renderer/lab.css, renderer-lab.html Mesh decoding and coverage: renderer/mesh.mjs Model and finish mapping: renderer/manifest.json Pinned graphics dependency: Three.js 0.180.0, vendored locally with MIT license. CURRENT COVERAGE All 1,490 catalog skins have exact weapon/paintkit material mappings. 1,259 retain verified baked finish textures from the pinned community source. 231 use resolved CS2 paint layers, masks and palettes, including the 217 previously missing finishes and baked mappings incompatible with their current model. 35 stickerable guns use 69 native legacy/HD variants. The Bayonet now uses its matching native legacy model as well. All 70 meshes retain material groups. Optics, scopes and holsters keep their actual base materials; sticker-gap geometry is hidden as weapon material but remains available to the native sticker layer. Asset sources: https://github.com/LielXD/CS2-WeaponPaints-Website https://github.com/ianlucas/cs2-lib https://github.com/ianlucas/cs2-lib-assets Baked texture source pinned to 796b428de4be746058e636abd23ee5d9d14989e4. CS2 metadata pinned to 0b4f915a04e8f9051ec8dcaa9f88012e92819488. Model release: cs2-v2000930-37854572932. Resolved paint definitions live in skin-materials.json. The source-document SHA-256 digests are recorded there. Texture paths are content-addressed exports served by cdn.cstrike.app. Paint graphs load locally instead of fetching several remote material documents every time a skin changes. The compositor now reads exposed color, boolean, scalar and texture overrides, including extended paints and custom paint-by-number masks. Source 2 paint style indices: 0 solid, 1 hydrographic, 2 spray, 3 anodized, 4 anodized multicolor, 5 anodized airbrush, 6 custom paint, 7 patina, 8 gunsmith. Only styles 2 and 5 use triplanar projection. UV paint uses authored scale and weapon-size adjustment; palette values are converted from sRGB to linear space. Paint alpha controls masking/durability rather than weapon transparency. The existing full bright lighting preference is preserved. Refresh with scripts/compile-skin-materials.py and the pinned items/model-materials JSON snapshots. The script requires exact IDs and complete paint dependencies; it does not fabricate textures or apply catalog thumbnails to weapon geometry. Run scripts/audit-skin-textures.py to verify runtime texture URLs/CORS, and scripts/tests/skins-check.mjs for coverage and material assignment checks. Raw asset textures remain provider-hosted. The compositor is independent; CS2 seed identity, complete patina/aging, metallic/pearl response and pixel parity remain experimental and require GPU/in-game reference comparisons. No SkinHub renderer code or CDN is used by the development build. Float changes paint loss using the authored wear/cavity maps. Seed samples the material-declared pattern offset/rotation bounds and wear transforms. Fixed UV artwork stays fixed. Projected patterns read the real EXR position and surface maps. Sticker scraping preserves authored protected areas (Jackass at wear 1 reveals ass); holo spectra respond to view angle through the authored RGB mask. Wear updates change uniforms without reloading meshes or rebuilding decals. The independent wear threshold, paint compositing, holo response and seeded random sampling remain approximations. Exact CS2 seed correspondence and pixel parity are UNVERIFIED. Patina aging, foil reflections, glitter and the full Source 2 paint-style pipeline still need dedicated implementation/reference QA. Do not use this development preview to certify a known blue-gem seed. Code: renderer/effects.mjs; source mapper: scripts/map-material-assets.py. Metadata source pinned at 0b4f915a04e8f9051ec8dcaa9f88012e92819488. CS2-lib MIT license: renderer/CS2-LIB-LICENSE.txt. Underlying Valve/artists retain their artwork rights. EXRLoader and fflate are vendored from Three.js r180, with their original license notices retained. FUNCTIONS Orthographic flat camera, perspective orbit camera, front/back sides, pinch and wheel zoom, flat pan, resolution-aware canvas, projected sticker decals, fixed prototype sticker size, selected-sticker outline, drag/rotation, locks, saved lab crafts, transparent PNG export, per-skin textured GLB imports in IndexedDB, coverage report, and an asset import pipeline. Lab coordinates are separate from native CS2 sticker offsets. Lab crafts do not overwrite main editor crafts. Imported GLBs retain their materials. Their PBR output is an approximation, not a claim of Source 2 visual parity. HOW TO IMPORT A FINISH For a quick local test: export an uncompressed, self-contained GLB from Blender with PNG/JPEG textures embedded. Barrel along X, top along Y. In the lab select the matching weapon and skin, then import the GLB. The import is stored only in that browser for that exact skin. Draco/Meshopt/KTX2 compressed exports need additional decoders and are rejected by this version. For permanent assets, prepare an asset directory containing manifest.json: { "models": {}, "finishes": { "YOUR_EXACT_CATALOG_SKIN_ID": { "weapon": "weapon_ak47", "glb": "finishes/ak47-elite-build.glb", "notes": "Exported at float 0.01, seed 1" } } } Then run: node scripts/import-renderer-assets.mjs /path/to/asset-directory A finish can alternatively specify albedo, normal, and roughness PNG/JPG paths, using the correct Workshop mesh UVs. Legacy skins require matching legacy meshes: use a GLB containing the appropriate mesh and materials rather than mapping a legacy texture onto a new HD model. The pipeline never guesses this mapping. After importing, rebuild and publish the Site. REBUILD ORIGINAL MESHES Valve source: https://www.counter-strike.net/workshop/workshopresources Download and unzip cs2_weapon_model_geometry.zip, install Python + NumPy, then: python scripts/convert-renderer-models.py /path/to/extracted/geometry Back up your manifest first: conversion regenerates its model table and clears finish entries. The converter preserves all triangles and uses 16-bit quantized vertex data. Source and output SHA-256 hashes are recorded in the manifest. WHAT IS REQUIRED FOR EVERY SKIN An exported asset collection from a current CS2 installation: HD and legacy weapon meshes, paintkit definitions, base and paint textures, compositing masks, normal/roughness/metalness maps, paint palettes, sticker material and scrape masks. Source 2 Viewer can extract assets from game VPK files; exported glTF/GLB can be used by this renderer. A catalog thumbnail is not a UV texture. A baked FN texture is not a working shader for all floats and pattern seeds. Those shaders must be implemented and compared with in-game reference renders, especially the edge cases at wear 0/1, seed boundaries, holo effects and legacy mesh variants. LOCAL SOURCE BUNDLE Download /renderer-source.zip. It includes the renderer code, dependencies, catalog, converter and asset importer. Base Workshop geometry binaries are downloaded and converted from Valve's official pack by scripts/fetch-renderer-models.py. Run that script, then serve the public folder with: python -m http.server 8000 --directory public Open http://localhost:8000/renderer-lab.html in a WebGL2-capable browser. ATTRIBUTION Valve and workshop authors retain ownership of their models/artwork. Three.js is MIT-licensed; see vendor/THREE-LICENSE.txt. The independent CraftLabCS renderer uses no SkinHub viewer scripts, iframe, or CDN. Community asset repository MIT license: renderer/ASSET-LICENSE.txt. The main editor continues to offer SkinHub while this lab is developed. Refresh pinned mappings with scripts/map-github-renderer-assets.py using the repository Git tree JSON and its src/data/skins.json. Matches require exact weapon ID, paint index, model file, texture file and explicit legacy/HD metadata. Lighting: renderer/lighting.mjs uses full bright textured materials without added cast shadows, AO, normal shading or reflection lighting. Baked texture details remain visible. Both views use the same bright appearance. Imported GitHub models rotate 180 degrees so the muzzle faces left in the default front view. Development editor: /development.html is generated from the live index.html and app.js by scripts/build-development.mjs. It uses renderer/development-frame.mjs instead of an external viewer. Browser data is copied on first use, then written only under cscraftlab-development: keys. The live/development comparison links carry the exact current craft in the hash, overriding stale browser snapshots on explicit navigation. The development editor now uses the model UV1 channel, authored per-weapon HD/legacy sticker homes, inverse scales and base rotations from cs2-lib. Native offset conversion is reversible and independent of zoom or camera position. Four-home weapons borrow their fifth home through the existing MIT-licensed anchor table. Stickers are clipped onto UV triangles and stay on those surfaces when the camera rotates. Game placement polygons constrain sticker centers while dragging. Sticker artwork clips against the actual weapon surface, not the placement-region boundary. Zoom supports 1200% in flat and orbit views; orbit magnification beyond 300% narrows the field of view at a fixed safe distance. UV1 uses the centered game coordinates directly; horizontal markup is not mirrored. Automated checks cover 69 model variants and all 345 default slots. On-device visual parity remains unverified. The standalone lab retains its separate prototype placement coordinates. The standalone renderer lab is also still available. Version 49 edge behavior Placement centers use the intersection of each slot's authored regions and the selected legacy/HD model's native sticker UV triangles. This respects cutouts and disconnected islands without reducing the artwork to the center region. Artwork is clipped at real triangle boundaries and remains exactly on the mesh; GPU polygon offset supplies depth separation without opening hard-edge seams. Sticker materials cull backfaces consistently, including holo materials. Coverage checks sweep all 345 slots in eight edge/corner directions (2,760 cases), plus gap and hard-edge fixtures. These CPU checks do not certify exact CS2 GPU visual parity; comparison with in-game references remains necessary. Version 52 studio materials The development renderer now uses MeshStandardMaterial with a neutral generated studio reflection environment, balanced front/back light and no cast shadows. Source base normals decode hemi-octahedral RG; roughness uses normal B and base metalness uses G, rather than glTF channel assumptions. Authored paint normal, roughness and metal masks are blended toward substrate as paint wears. Maps remain linear except albedo. Missing optional maps fall back to geometric shading. Legacy/HD material groups preserve scopes and unpainted parts. This is a PBR approximation; exact CS2 shader and GPU visual parity are unverified.