Add entity render color and material override streaming #39

Merged
kit merged 1 commit from feature/11-entity-render-color into dev 2026-03-19 13:25:08 +00:00
Owner

Summary

  • Stream entity render color (RGBA) as 4 bytes in the binary snapshot protocol, applied multiplicatively in the uber-shader via entityColor uniform
  • Stream Entity:SetMaterial() and Entity:SetSubMaterial() overrides via JSON text messages, using Lua metatable hooks to capture changes without per-frame polling
  • Startup sweep on webstream.Start() captures pre-existing material overrides
  • Client stores original materials and applies/restores overrides per-entity, with deferred application when models load after the override arrives
  • Entity panel shows active material overrides
  • Also adds half-lambert lighting, $nofog, $normalmapalphaenvmapmask, improved envmap masking/fresnel, and several new shader types (patch, worldvertexalpha, treeleaf, decal, etc.)

Test plan

  • Entity render color tints visible in web client
  • Entity:SetMaterial("path") override appears on web client
  • Entity:SetMaterial("") restores original material
  • Material override messages visible in network panel
  • Entity panel shows override info when present

Closes #11

## Summary - Stream entity render color (RGBA) as 4 bytes in the binary snapshot protocol, applied multiplicatively in the uber-shader via `entityColor` uniform - Stream `Entity:SetMaterial()` and `Entity:SetSubMaterial()` overrides via JSON text messages, using Lua metatable hooks to capture changes without per-frame polling - Startup sweep on `webstream.Start()` captures pre-existing material overrides - Client stores original materials and applies/restores overrides per-entity, with deferred application when models load after the override arrives - Entity panel shows active material overrides - Also adds half-lambert lighting, `$nofog`, `$normalmapalphaenvmapmask`, improved envmap masking/fresnel, and several new shader types (patch, worldvertexalpha, treeleaf, decal, etc.) ## Test plan - [x] Entity render color tints visible in web client - [x] `Entity:SetMaterial("path")` override appears on web client - [x] `Entity:SetMaterial("")` restores original material - [x] Material override messages visible in network panel - [x] Entity panel shows override info when present Closes #11
Stream Entity:SetColor (render color) as RGBA bytes in the binary
snapshot protocol, and Entity:SetMaterial/SetSubMaterial overrides
via JSON text messages. Render color is applied multiplicatively in
the shader. Material overrides use Lua metatable hooks to capture
changes as they happen, with a startup sweep for pre-existing
overrides. The client stores original materials and applies/restores
overrides per-entity, including deferred application when models
load after the override arrives.

Also adds half-lambert lighting, $nofog, $normalmapalphaenvmapmask,
improved envmap masking/fresnel, and several new shader types
(patch, worldvertexalpha, treeleaf, decal, etc).

Closes #11

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kit merged commit a996ce464c into dev 2026-03-19 13:25:08 +00:00
kit deleted branch feature/11-entity-render-color 2026-03-19 13:25:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kit/gmod-web-stream!39
No description provided.