Skip to content

Planning

Daynlight edited this page Dec 17, 2025 · 6 revisions

Planning

This section is about planning, decisions and trade-offs.

TOC

Generating Points

Concept

  1. We separate whole viewport to blocks.
  2. We use derivate for checking if changes are static.

Graphite Rendering Strategy

Overview

Efficient rendering for math visualizations with large datasets and hot-reload support.

Core Concepts

1. SSBO (Shader Storage Buffers)

What: GPU-side storage for point data
Why: Large buffers, read/write from shaders, better performance than VBO
Use: Store all math function points on GPU

2. LOD (Level of Detail)

What: Adaptive point density based on zoom
Why: Render fewer points when zoomed out, more when zoomed in
Levels:

  • Far view: Every 10th point
  • Medium: Every 2nd point
  • Close: All points

3. Chunking System

What: Split dataset into regions (~1000 points each)
Why: Update only changed chunks, not entire dataset
Benefit: Fast updates during hot-reload

4. Partial Updates

What: Only re-upload modified chunks to GPU
Why: Minimal CPUโ†’GPU transfer
How: Track dirty chunks, use glBufferSubData()

Pipeline

CPU: Generate points โ†’ Organize into chunks โ†’ Mark dirty chunks GPU: Read from SSBO โ†’ Apply LOD โ†’ Render visible points Update: Recompute dirty chunks โ†’ Upload to GPU (partial)

Trade-offs

SSBO vs VBO:

  • SSBO: Larger, flexible, compute-ready (requires OpenGL 4.3+)
  • VBO: Simpler, widely supported

Decision: SSBO for scalability

Chunk Size:

  • Small: Fine updates, more overhead
  • Large: Less overhead, coarse updates

Decision: ~1000 points per chunk

Implementation Phases

  1. Fix current bug (only last point renders)
  2. Basic SSBO rendering all points
  3. Add chunking + partial updates
  4. Implement LOD system
  5. Test & optimize

Performance Target

  • 1M+ points at 60 FPS
  • Smooth hot-reload updates
  • Interactive zoom/pan

Status

Current: Refactoring (bug fix needed)
Next: SSBO implementation
Priority: Resume after rest

TODO

  • Footer
  • Sidebar
  • ApiRef
  • Architecture
  • Changelog
  • Community
  • Credits
  • Examples
  • Faq
  • Home
  • Installation
  • Math
  • PackageManager
  • Planning
  • Rendering Engine
  • Roadmap
  • Troubleshooting
  • Tutorials
  • Usage
  • Versions
  • Writing Scripts

Graphite Wiki Sidebar

Getting Started

References

Project & Versions

Community

Clone this wiki locally