Skip to content

Add PVS (Potentially Visible Set) culling system#61

Draft
Copilot wants to merge 13 commits intomainfrom
copilot/design-pvs-culling-system
Draft

Add PVS (Potentially Visible Set) culling system#61
Copilot wants to merge 13 commits intomainfrom
copilot/design-pvs-culling-system

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 15, 2026

Complete PVS culling system for offline visibility pre-computation and runtime occlusion culling.

Core Components

  • PVSTypes.h - Cell/object IDs, grid coordinates, config structs
  • PVSBitSet.h - SIMD-accelerated bitset for visibility storage with ForEachSetBit() fast iteration
  • PVSData.h - 3D grid management with pre-computed inverse cell sizes for O(1) lookups
  • PVSCulling.h - Runtime query interface with frustum culling integration

SIMD Acceleration

  • SIMDUtils.h - Cross-platform (SSE/NEON/scalar) vectorized operations
  • Bitwise OR/AND, popcount, batch AABB intersection, batch distance calculation
  • 2-4x speedup on bitset operations

Baking Pipeline

  • PVSBaker.h - Offline visibility computation (distance-based, raycast, custom)
  • PVSBakedData.h - Serialization format with versioning and compression stats
  • PVSSampling.h - Sample generation (random, stratified, Halton, Fibonacci sphere)

Large World Support

  • PVSStreamingManager.h - Sector-based streaming with LRU eviction
  • Automatic load/unload based on viewer distance
  • Cross-sector visibility queries

BVH (lib core)

  • BVH.h - Template-based acceleration structure with SAH build
  • Ray/AABB/point queries
  • Ray-AABB intersection in Shapes.h

Usage

// Bake visibility offline
PVSBaker baker;
baker.AddObjects(sceneObjects);
PVSBakedData data;
baker.Bake(config, data);
data.Save(archive);

// Runtime query
PVSCulling culling;
culling.LoadFromBakedData(data);
culling.ForEachVisiblePrimitive(cameraPos, view, [](auto* p) {
    // render
});

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 15, 2026 11:11
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title [WIP] Design PVS culling system Add PVS (Potentially Visible Set) culling system Feb 15, 2026
Copilot AI requested a review from bluesky013 February 15, 2026 11:13
Copilot AI and others added 2 commits February 16, 2026 01:30
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS (Potentially Visible Set) culling system Add PVS culling system with SIMD acceleration Feb 16, 2026
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS culling system with SIMD acceleration Add PVS culling system with SIMD acceleration and baker workflow Feb 16, 2026
Copilot AI and others added 2 commits February 20, 2026 01:41
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS culling system with SIMD acceleration and baker workflow Add PVS culling system with SIMD acceleration and offline baking Feb 20, 2026
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS culling system with SIMD acceleration and offline baking Add PVS culling system with SIMD acceleration and streaming Feb 20, 2026
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS culling system with SIMD acceleration and streaming Add PVS culling system with SIMD acceleration, streaming, and BVH support Feb 24, 2026
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title Add PVS culling system with SIMD acceleration, streaming, and BVH support Add PVS (Potentially Visible Set) culling system Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants