fix(ugc): glitter sparkles that move on placed models

Why the glitter never moved: player models (LOT 14) are wrapped in
weeblewobble.kfm (RenderComponentWrapper 9845), so the client makes them
an LWOSkinnedRenderComponent, whose Run (0x00d6d3d0) updates the scene
graph (and so any NiTextureTransformController) only while animation is
enabled, and LWOModelBehaviorComponent::EnableAnimation (0x00be2740)
turns it off for modelType 2, which every placed property model is. The
root flags 0x102 added earlier are only read by the base render
component. Nothing in a placed model's .nif can move.

What does move: shader classes set globals in their own per-frame Run.
Distortion Directional (Ocean) (mapShaders 79, Run 0x010b90c0) slides
its texture layers by fixed shares of a tile a second, as the game's own
pond ripples (S79__pond_ripplesShape). Glitter bricks now get a sparkle
group, S79_GlitterSparkle_Model: their triangles lifted 0.005 off the
brick, vertex colors white tinted by the brick, UVs placed per brick,
alpha tested (ShaderCommon's alpha test phase, GREATEREQUAL 127), with a
stored texture of flat sparkles at alpha 230: one layer's sparkle alone
averages under the test, two meeting pass, so sparkles flash and go out
as the layers cross. The flecks stay (LEGO-AnimUV, now without the
controllers and flags that never ran). The icon and the dashboard's 3D
view leave the sparkles out.

New settings: shader_glitter_sparkle (79, 0 off), glitter_sparkle_size,
glitter_sparkle_amount, glitter_sparkle_tint, glitter_sparkle_brightness;
glitter_speed is now how fast sparkles flash (the sparkle tile). Only
glitter output changes; non-glitter models are byte-identical.

Check in game: reprocess a property with glitter models, then look at
them from a few angles and distances, on each graphics quality:
- sparkles flash on and off all over the glitter bricks, continuously
- no flickering fight between the sparkles and the brick surface
- transparent glitter bricks still see-through, flecks still visible
- nothing drawn where there is no glitter brick; icons unchanged
  apart from the flecks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 00:27:55 -05:00
parent 63bfaf545e
commit fb7850fb9f
19 changed files with 562 additions and 248 deletions

View File

@@ -92,9 +92,16 @@ brushed_material_types=brushedSteel,matteSteel
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.
# over the color (still: the client never updates a placed model). 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.
# shader_glitter_sparkle: the glitter bricks' sparkles, S<id>_GlitterSparkle_Model over both glitter groups (only with
# shader_glitter). 79 is Distortion Directional (Ocean), whose texture layers the client moves every frame on its
# own: a sparkle flashes where two layers' sparkles meet. (Nothing else can move on a placed model: the client never
# updates its scene graph, so texture controllers in the .nif never run.) 0: no sparkles.
# glitter_sparkle_size: a sparkle's diameter in model units; glitter_sparkle_amount: percent of each moving layer
# covered (about its square's share of the brick sparkles at once); glitter_speed: how fast sparkles flash and go
# out (1: about half a second each, 0.1 to 4); glitter_sparkle_tint: percent of the brick's color the sparkles take;
# glitter_sparkle_brightness: percent.
# glitter_random: 1 places each brick's flecks its own way (turned and moved by the brick), 0 the same on every brick.
# 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)
@@ -103,7 +110,12 @@ glitter_material_types=glitter
glitter_colors=114,117
glitter_size=1.6
glitter_density=50
shader_glitter_sparkle=79
glitter_sparkle_size=0.1
glitter_sparkle_amount=5
glitter_speed=1
glitter_sparkle_tint=30
glitter_sparkle_brightness=100
glitter_random=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),