arkavo-org / arkavo-org/VRMMetalKit

Crowd: GPU hardware occlusion queries for background avatars

Open
#199 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
6
Forks
2
Avg merge
18h 51m
Merged PRs (30d)
26

Description

## Source
Romero perf review (item 2b — frame-elimination work).

## Problem
`CharacterPrioritySystem` buckets avatars into "full 3D" and "cached sprite" tiers, but does not skip avatars that are fully occluded by foreground geometry. In crowd scenes, most non-speaking avatars are occluded by the speaker's bust and never sample any visible pixel.

## Proposed change
Add a third tier: "fully occluded — skip entirely." Use `MTLVisibilityResultMode` on a bounding-box proxy during the depth prepass; the query result feeds the next frame's tier assignment (one-frame latency is fine for crowd avatars).

## Affected
- `Sources/VRMMetalKit/Renderer/Systems/CharacterPrioritySystem.swift` (or equivalent)
- `Sources/VRMMetalKit/Renderer/VRMRenderer.swift` (visibility query setup)

## Related
- #91 — crowd scalability (natural sub-issue)
- #154 — frustum culling (complementary; frustum is a precondition)
- #156 (measure)

Contributor guide

Open the contributing guide

Research direction

Start with Sources/VRMMetalKit/Renderer/Systems/CharacterPrioritySystem.swift and Sources/VRMMetalKit/Renderer/VRMRenderer.swift, then trace the existing depth prepass and visibility-query setup. Confirm how MTLVisibilityResultMode can drive the next frame's tier assignment. Done means fully occluded avatars use a third skip tier while the existing full-3D and cached-sprite tiers continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.