Render brush model entities (*N) as positioned BSP geometry #18

Closed
opened 2026-03-17 01:50:27 +00:00 by kit · 0 comments
Owner

Entities that use brush models (*1, *2, etc.) are currently shown as placeholder boxes. Their actual geometry is embedded in the BSP as sub-models but we don't extract or render them as separate positioned objects.

Problem

Brush model entities include func_door, func_illusionary, func_breakable, func_wall, func_rotating, func_movelinear, func_tracktrain, etc. These are visible in-game but rendered incorrectly in the web client:

  • _tryLoadModel() skips *N models (correctly — they're not MDL files)
  • They stay as placeholder boxes forever
  • Static ones like func_illusionary and func_wall may already have their geometry baked into worldspawn model 0, making the placeholder box redundant
  • Dynamic ones like func_door need their brush geometry extracted and positioned per-entity

What needs to happen

BSP sub-model extraction

  • BSP model lump contains entries for *0 (worldspawn), *1, *2, etc.
  • Each sub-model references a range of faces in the BSP
  • Extract geometry for each sub-model and create a Three.js mesh

Entity positioning

  • When an entity has a *N model, look up the corresponding BSP sub-model mesh
  • Position/rotate it according to the entity's streamed transform
  • Dynamic brush entities (doors, elevators) update position each tick

Static vs dynamic

  • Static brush entities (func_illusionary, func_wall, func_detail) could be baked once
  • Dynamic brush entities (func_door, func_breakable, func_rotating) need per-tick transform updates like other entities

Current workaround

Until this is implemented, brush model entities are hidden by the entity visibility filter (#17) since they can't be rendered properly.

Relates to

  • #4 (BSP rendering — sub-model data is already in the BSP)
  • #17 (entity visibility — brush model entities currently hidden)
Entities that use brush models (`*1`, `*2`, etc.) are currently shown as placeholder boxes. Their actual geometry is embedded in the BSP as sub-models but we don't extract or render them as separate positioned objects. ## Problem Brush model entities include `func_door`, `func_illusionary`, `func_breakable`, `func_wall`, `func_rotating`, `func_movelinear`, `func_tracktrain`, etc. These are visible in-game but rendered incorrectly in the web client: - `_tryLoadModel()` skips `*N` models (correctly — they're not MDL files) - They stay as placeholder boxes forever - Static ones like `func_illusionary` and `func_wall` may already have their geometry baked into worldspawn model 0, making the placeholder box redundant - Dynamic ones like `func_door` need their brush geometry extracted and positioned per-entity ## What needs to happen ### BSP sub-model extraction - BSP model lump contains entries for `*0` (worldspawn), `*1`, `*2`, etc. - Each sub-model references a range of faces in the BSP - Extract geometry for each sub-model and create a Three.js mesh ### Entity positioning - When an entity has a `*N` model, look up the corresponding BSP sub-model mesh - Position/rotate it according to the entity's streamed transform - Dynamic brush entities (doors, elevators) update position each tick ### Static vs dynamic - Static brush entities (`func_illusionary`, `func_wall`, `func_detail`) could be baked once - Dynamic brush entities (`func_door`, `func_breakable`, `func_rotating`) need per-tick transform updates like other entities ## Current workaround Until this is implemented, brush model entities are hidden by the entity visibility filter (#17) since they can't be rendered properly. ## Relates to - #4 (BSP rendering — sub-model data is already in the BSP) - #17 (entity visibility — brush model entities currently hidden)
kit closed this issue 2026-03-17 12:21:23 +00:00
Sign in to join this conversation.
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#18
No description provided.