Filter non-visible entities by default, add "show invisible" toggle #17

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

Many entities that exist in the server's entity list shouldn't be rendered by default. Currently we render placeholder boxes for everything, cluttering the scene with invisible/non-renderable entities.

Problem cases

Inactive weapons

  • Players carry multiple weapons, but only the active weapon should be rendered
  • Holstered weapons still exist as entities with positions — they follow the player but shouldn't be visible
  • Need to check the entity's EF_NODRAW flag or equivalent to determine if it should render

Point entities (no visual representation)

  • sky_camera, info_player_start, env_soundscape, env_fog_controller, env_sun, env_tonemap_controller, path_track, path_corner, ai_network, soundent, etc.
  • These are logical/data entities with no model or visible presence in-game
  • Currently rendered as colored boxes

Server-only / internal entities

  • worldspawn, player_manager, gmod_gamerules, scene_manager, shadow_control, water_lod_control
  • Engine internals that are never rendered

Proposed solution

Server side

  • Add EF_NODRAW and other render flags to the streamed entity state
  • The engine already tracks whether an entity should draw — we should use that

Client side

  • Maintain a visibility rule based on:
    1. Entity has EF_NODRAW flag → hidden
    2. Entity has no model (model_id == 0) → hidden
    3. Entity classname is in a known non-renderable list → hidden
  • Default: only show entities that would actually be visible in-game
  • Add a single "Show invisible entities" checkbox to the GUI that reveals everything (useful for debugging/inspection)
  • The per-classname toggles in the Entities panel should still work on top of this

Notes

  • This should significantly clean up the default view — gm_construct has ~148 entities but only ~30-40 are actually visible in-game
  • The EF_NODRAW approach is the most reliable since the engine already knows what to draw
Many entities that exist in the server's entity list shouldn't be rendered by default. Currently we render placeholder boxes for everything, cluttering the scene with invisible/non-renderable entities. ## Problem cases ### Inactive weapons - Players carry multiple weapons, but only the active weapon should be rendered - Holstered weapons still exist as entities with positions — they follow the player but shouldn't be visible - Need to check the entity's `EF_NODRAW` flag or equivalent to determine if it should render ### Point entities (no visual representation) - `sky_camera`, `info_player_start`, `env_soundscape`, `env_fog_controller`, `env_sun`, `env_tonemap_controller`, `path_track`, `path_corner`, `ai_network`, `soundent`, etc. - These are logical/data entities with no model or visible presence in-game - Currently rendered as colored boxes ### Server-only / internal entities - `worldspawn`, `player_manager`, `gmod_gamerules`, `scene_manager`, `shadow_control`, `water_lod_control` - Engine internals that are never rendered ## Proposed solution ### Server side - Add `EF_NODRAW` and other render flags to the streamed entity state - The engine already tracks whether an entity should draw — we should use that ### Client side - Maintain a visibility rule based on: 1. Entity has `EF_NODRAW` flag → hidden 2. Entity has no model (model_id == 0) → hidden 3. Entity classname is in a known non-renderable list → hidden - Default: only show entities that would actually be visible in-game - Add a single "Show invisible entities" checkbox to the GUI that reveals everything (useful for debugging/inspection) - The per-classname toggles in the Entities panel should still work on top of this ## Notes - This should significantly clean up the default view — gm_construct has ~148 entities but only ~30-40 are actually visible in-game - The `EF_NODRAW` approach is the most reliable since the engine already knows what to draw
kit closed this issue 2026-03-17 02:43:01 +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#17
No description provided.