feat(ugc): glitter flecks (LEGO-AnimUV) and milky satin in made models

Glitter colors (Materials.xml type glitter, glitter_colors 114,117) go into
S21_Glitter_Model and, transparent, S21_GlitterAlpha_Model (shader_glitter,
default 21, LEGO-AnimUV). Their shapes get box-projected UVs, an
NiTexturingProperty with a stored 128 px mipmapped fleck texture
(NiSourceTexture + NiPersistentSrcTextureRendererData, as the client's own
env_ag_ocean-maelstrom.nif) and two NiTextureTransformControllers looping
the base map's translation (glitter_size, glitter_density, glitter_speed).
The shader lays the texture over the vertex color by its alpha and outputs
the vertex alpha, so transparent glitter blends as S01_Alpha does.

Satin colors (satin_colors, LEGO's opal colors) stay in S01_Alpha but get
satin_opacity and are whitened by satin_whiten.

NifFile reads the base map's scroll speed (uvScroll) from the controllers;
the icon draws still flecks, the UGC 3D view and the LXFML viewers moving
ones. stats.json counts the glitter groups. With shader_glitter 0 and no
satin colors the files are the same bytes as before (tested). Also keeps
glow_emissive for the icon (it was reset by the icon settings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 12:53:52 -05:00
parent 9e4f2818c3
commit 7bba8344fc
24 changed files with 966 additions and 93 deletions

View File

@@ -69,7 +69,8 @@ lod_cull=10000
shader_opaque=01
combine_transparent=0
# Metal and glow colors in NiLODNodes of their own, drawn with the client's metal and emissive shaders (the default).
# Metal, glow and glitter colors in NiLODNodes of their own, drawn with the client's metal, emissive and animated UV
# shaders (the default).
# Not how live looked: live's models were all LEGO plastic (S01), which 0 (off) keeps, byte for byte.
# shader_metal: mapShaders id for metal colors (Materials.xml types in metal_material_types and LU Toolbox's metallic
# colors), S<id>_Metal_Model: 88 is Polished Metal.
@@ -89,6 +90,26 @@ brushed_material_types=brushedSteel,matteSteel
# brushed_colors: LEGO color ids drawn as brushed steel whatever their type, comma separated (empty: the default, the
# drum lacquered 298,300,1002,1004; none: no colors)
brushed_colors=298,300,1002,1004
# shader_glitter: for glitter colors (glitter_material_types and glitter_colors), S<id>_Glitter_Model and, for
# transparent ones, S<id>_GlitterAlpha_Model: 21 is LEGO-AnimUV, which lays a white fleck texture stored in the .nif
# over the color and moves it. 0: off, glitter stays plastic.
# glitter_size: the fleck texture's tile in model units (a stud is 0.8); glitter_density: flecks in a tile;
# glitter_speed: 1 moves the flecks a tile in 7 s one way and 11 s the other, 0 keeps them still.
# glitter_colors: LEGO color ids that are glitter whatever their type (empty: the default, 114,117, which LEGO's color
# data calls glitter; none: no colors)
shader_glitter=21
glitter_material_types=glitter
glitter_colors=114,117
glitter_size=1.6
glitter_density=50
glitter_speed=1
# Satin (opal) colors stay transparent plastic (the client has no satin shader) but are made milky:
# satin_colors: color ids (empty: the default, LEGO's satin colors 360,362,363,364,365,366,367,376; none: off),
# satin_opacity: their transparent bricks' opacity in percent (instead of transparent_opacity),
# satin_whiten: how far their color goes towards white, in percent.
satin_colors=360,362,363,364,365,366,367,376
satin_opacity=75
satin_whiten=20
# Remove faces that can't be seen from anywhere (optimize_resolution: detail of the renders that decide it;
# hsr_ground_plane: 1 also removes what can only be seen from below the model)