Repository navigation
ThorVG Unity Graphics Analysis
Audience: Programmers | Mixed
Thread Context: N/A (research/reference)
Platform/Backend Scope: Cross-engine reference
Analysis of three sources for graphics techniques and libraries applicable to SparkEngine: ThorVG (vector graphics engine), the Unity Graphics repo (SRP/URP/HDRP/ShaderGraph), and awesome-graphics-libraries (33+ libraries across 14 categories). The original document produced 35 recommendations across rendering, post-processing, asset pipeline, UI, shader tooling, and resource management.
As of the 2026-06-08 codebase verification, many of the Tier 1 post-processing and library-integration items have been implemented — notably Bloom, Tonemapping + Color Grading, Auto-Exposure, GTAO, tinyexr, FastNoiseLite/FastNoise2, meshoptimizer, the Volume system, cached shadow atlas, light layers, and a shader variant system. Each item is annotated below.
Status legend: Implemented — concrete subsystem/file exists. Partial — core exists, refinement incomplete. Open — not yet built.
ThorVG is a production-ready C++ vector graphics engine (~150KB) supporting SVG and Lottie with CPU/SIMD, OpenGL, and WebGPU backends (used by Tizen, Samsung, Godot). Key patterns:
- Dirty Region Tracking (16x16 grid, double-buffered dirty lists) — redraw only changed UI cells.
-
Retained Scene Graph with Update Flags — bitwise
RenderUpdateFlag(Path, Color, Transform, Image, Blend) per node. -
Backend-Agnostic RenderMethod Interface —
prepare()returns opaqueRenderData;renderShape()/renderImage();beginComposite()/endComposite(). -
Compositor Stack with Pooled Render Targets — per-node masking/blending with
needComposition()skip for simple scenes. - State Machine for Update/Render Separation — Synced→Painting→Updating→Drawing→Synced.
- SVG/Lottie Loading Architecture — independent loaders producing one scene graph; Lottie enables data-driven UI animation.
Status note: SparkEngine now has a 2D scene graph (Engine/2D/SceneGraph2D.h), partially covering ThorVG patterns #2/#3. UI dirty-region tracking, the compositor stack, and SVG/Lottie loading remain Open.
Libraries identified as gap-fillers, with current status:
| Library | Category | Status (2026-06-08) | Evidence |
|---|---|---|---|
| meshoptimizer | Mesh processing | Implemented | Graphics/MeshOptimizer.h |
| PMP | Mesh processing | Open | editor-side remeshing not found |
| Basis Universal | Texture compression | Open | no transcoder bundled; raw PNG/JPG path |
| AMD Compressonator | Texture compression | Open | — |
| tinyexr | HDR/EXR loading | Implemented |
ThirdParty/Utils/tinyexr/, Graphics/EXRLoader.h
|
| msdfgen / msdf-atlas-gen | Font rendering | Partial |
Engine/Text/FontSystem.h exists; MSDF specifically not confirmed |
| Slang | Shader cross-compilation | Open | — |
| ShaderConductor | Shader cross-compilation | Open | SparkShaderCompiler still HLSL-centric |
| Jolt Physics | Physics | Implemented | Jolt is the engine's physics backend |
| Intel Embree | CPU ray tracing | Open / unverified | — |
| Intel OIDN | Denoising | Partial |
Graphics/DenoiserInterface.h exists; OIDN binding unverified |
| RTXGI-DDGI SDK | GI | Partial | DDGI present (Graphics/Neural/NeuralRadianceCache.h, GI stubs); reference-SDK study open |
| Voxel Cone Tracing | GI | Implemented | wired per Advanced Techniques Phase Q |
| FastNoise2 | Procedural | Implemented | Graphics/FastNoise2SIMD.h |
| FastNoiseLite | Procedural (shader) | Implemented | Graphics/FastNoiseLite.h |
| ozz-animation | Animation | Open / unverified | engine has its own animation system |
Reference engines (Filament, Wicked) remain useful C++ references, not integrations.
-
Pipeline Asset / Feature Toggles with shader stripping — Partial (
ShaderVariantSystem.hexists; build-time stripping tied to runtime config unverified). - Render Graph Compilation Caching — Partial (RenderGraph present; verify cross-frame caching).
- Hybrid Tile/Cluster Light Culling (Big Tile pre-pass) — Partial (clustered culling present; coarse Big-Tile pre-pass not confirmed).
-
Cached Shadow Atlas — Implemented (
Graphics/CachedShadowAtlas.h). -
PCSS soft shadows — Partial (
ShadowAtlaspresent; PCSS quality path unverified). - Contact Shadows — Partial / unverified (mentioned in ScreenSpaceEffects).
-
Light Layers/Categories — Implemented (
Graphics/LightLayers.h). -
Adaptive Probe Volumes (APV) — Implemented (
Graphics/AdaptiveProbeVolumes.{h,cpp}). -
Reflection Probe Texture Cache — Implemented (
Graphics/ReflectionProbeCache.h).
-
Volume System for Parameter Blending — Implemented (
Graphics/VolumeSystem.h). -
Bloom — Implemented (
Graphics/BloomEffect.{h,cpp}). -
Auto-Exposure / Eye Adaptation — Implemented (in
PostProcessingPipeline; grep-confirmed auto-exposure references). -
Tonemapping (ACES/Filmic/Neutral) — Implemented (
Graphics/TonemapColorGrading.{h,cpp}). -
Color Grading (LGG, curves, white balance) — Implemented (
Graphics/TonemapColorGrading.{h,cpp}).
-
Shader Variant Keyword + stripping system — Partial (
Graphics/ShaderVariantSystem.h). -
Material Inheritance — Partial (
MaterialDefinition.hpresent; parent/child override unverified). - Shader Graph Block Nodes / Master Stack — Partial (ShaderGraphCompiler exists per original context).
-
GTAO (Ground Truth AO) — Implemented (
Graphics/GTAOEffect.h). - SSAO Temporal Denoising — Partial (GTAO present; explicit AO temporal accumulation unverified).
- Bilateral Upsample (shared utility) — Open / unverified.
-
Froxel Volumetric Fog — Implemented (
Graphics/FroxelVolumetricFog.{h,cpp}). - GPU-Driven Rendering (persistent CBs, HiZ occlusion) — Implemented (GPU-driven culling + HiZ baseline).
- RTHandle System (scale-based RT allocation) — Open / unverified.
-
Pipeline State Pre-warming — Partial (
PipelineStateCacheexists; pre-warm-at-load unverified).
| # | Recommendation | Source | Status (2026-06-08) |
|---|---|---|---|
| 1 | Volume system for spatial parameter blending | Unity HDRP | Implemented |
| 2 | Bloom | Unity HDRP | Implemented |
| 3 | Auto-exposure / eye adaptation | Unity HDRP | Implemented |
| 4 | Tonemapping (ACES/Filmic/Neutral) | Unity HDRP | Implemented |
| 5 | Color grading | Unity HDRP | Implemented |
| 6 | meshoptimizer integration | awesome-graphics | Implemented |
| 7 | Basis Universal transcoder | awesome-graphics | Open |
| 8 | msdfgen MSDF font rendering | awesome-graphics | Partial (FontSystem exists) |
| 9 | Cached shadow atlas | Unity HDRP | Implemented |
| 10 | UI dirty region tracking | ThorVG | Open |
| 11 | Shader variant keyword + stripping | Unity SRP | Partial |
| 12 | FastNoiseLite (HLSL) | awesome-graphics | Implemented |
| # | Recommendation | Source | Status (2026-06-08) |
|---|---|---|---|
| 13 | PCSS soft shadows | Unity HDRP | Partial |
| 14 | Light layers/categories | Unity HDRP | Implemented |
| 15 | Retained 2D scene graph with update flags | ThorVG |
Partial (SceneGraph2D.h) |
| 16 | Compositor stack with pooled RTs for UI | ThorVG | Open |
| 17 | Persistent GPU material constant buffers | Unity SRP Batcher | Partial |
| 18 | GPU occlusion culling (prev-frame HiZ) | Unity | Implemented |
| 19 | Intel OIDN denoiser | awesome-graphics |
Partial (DenoiserInterface.h) |
| 20 | tinyexr HDR/EXR support | awesome-graphics | Implemented |
| 21 | ShaderConductor cross-compilation | awesome-graphics | Open |
| 22 | RTHandle scale-based allocation | Unity SRP Core | Open |
| 23 | SSAO temporal denoising | Unity HDRP | Partial |
| 24 | Bilateral upsample shared utility | Unity HDRP | Open |
| 25 | Reflection probe texture cache | Unity HDRP | Implemented |
| # | Recommendation | Source | Status (2026-06-08) |
|---|---|---|---|
| 26 | Voxel Cone Tracing | awesome-graphics | Implemented |
| 27 | RTXGI-DDGI study | awesome-graphics | Partial (DDGI present) |
| 28 | Froxel volumetric fog | Unity HDRP | Implemented |
| 29 | Adaptive Probe Volumes | Unity HDRP | Implemented |
| 30 | Jolt Physics migration | awesome-graphics | Implemented (Jolt is the backend) |
| 31 | SVG/Lottie via ThorVG | ThorVG | Open |
| 32 | GTAO upgrade | Unity HDRP | Implemented |
| 33 | FastNoise2 SIMD noise | awesome-graphics | Implemented |
| 34 | Slang shading language | awesome-graphics | Open |
| 35 | NVIDIA vk_lod_clusters (Nanite-like) | awesome-graphics | Partial (mesh clusters/meshlets present; full virtualized geometry in progress) |
Genuinely open items: Basis Universal transcoder (#7), UI dirty-region tracking (#10), ThorVG compositor stack (#16), ShaderConductor/Slang cross-compilation (#21/#34), RTHandle scale-based allocation (#22), bilateral upsample utility (#24), SVG/Lottie loading (#31). Most post-processing and core lighting recommendations are done; MSDF fonts, PCSS quality, shader stripping, and SSAO temporal denoising are partial.
- Original analysis date: 2026-03-22 (type: Decision).
- Verified against codebase 2026-06-08.
-
Annotations / updates made:
- Added per-recommendation status markers across all three sources and all 35 prioritized items.
- Confirmed implemented: Volume system, Bloom, auto-exposure, tonemapping, color grading, meshoptimizer, tinyexr, FastNoiseLite, FastNoise2, cached shadow atlas, light layers, GTAO, froxel fog, APV, reflection probe cache, GPU occlusion culling, Voxel Cone Tracing, Jolt.
- Confirmed open: Basis Universal, UI dirty-region tracking, ThorVG compositor stack, ShaderConductor/Slang, RTHandle, bilateral upsample, SVG/Lottie.
- Noted the new
Engine/2D/SceneGraph2D.hpartially satisfies ThorVG retained-scene-graph patterns. - Stripped AI-session frontmatter, the "Quick Wins" duplicate list (now reflected by status), and the cross-source signal table's redundancy.
Published from 2b03dc797148. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Platform Certification
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers