Renderer Overview
ManimVTK supports three rendering backends, each optimized for different use cases:Cairo
2D Vector Graphics
Best for 2D animations and diagrams
OpenGL
3D Hardware Acceleration
Fast real-time 3D rendering
VTK
Scientific Visualization
High-quality 3D with VTK export
Selecting a Renderer
Via Command Line
Via Configuration
Inmanim.cfg:
Cairo Renderer
The default renderer, based on the Cairo graphics library.Characteristics
- ✅ Excellent 2D quality: Sharp vector graphics
- ✅ Text rendering: High-quality text and LaTeX
- ✅ Mature and stable: Well-tested, minimal bugs
- ⚠️ 2D focused: Basic 3D support only
- ⚠️ CPU-based: No GPU acceleration
Best For
- 2D mathematical animations
- Educational diagrams
- Text-heavy content
- Precise vector graphics
Example
OpenGL Renderer
Hardware-accelerated rendering using OpenGL.Characteristics
- ✅ Fast: GPU-accelerated
- ✅ Real-time preview: Interactive viewing
- ✅ 3D support: Good 3D capabilities
- ⚠️ Less mature: May have edge cases
- ⚠️ Platform-dependent: Requires OpenGL drivers
Best For
- Interactive development
- Real-time previews
- 3D animations (lighter-weight than VTK)
- Fast iteration
Example
VTK Renderer
Scientific visualization renderer with VTK export capabilities.Characteristics
- ✅ Scientific quality: Publication-grade 3D
- ✅ VTK export: Export to .vtp, .vtm, .pvd formats
- ✅ Advanced lighting: Realistic shading
- ✅ ParaView integration: Direct export to ParaView
- ⚠️ Slower startup: VTK initialization overhead
- ⚠️ 3D focused: Best for 3D content
Best For
- Scientific visualization
- 3D surfaces and meshes
- CFD/FEA visualization
- ParaView workflows
- High-quality 3D renders
Example
VTK Renderer Guide
Detailed guide on VTK renderer features
Renderer Comparison
| Feature | Cairo | OpenGL | VTK |
|---|---|---|---|
| 2D Quality | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
| 3D Quality | ⭐ | ⭐⭐ | ⭐⭐⭐ |
| Performance | ⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
| Text/LaTeX | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
| Stability | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ |
| Export Formats | Image/Video | Image/Video | VTK Files |
| GPU Acceleration | ❌ | ✅ | ✅ |
| Scientific Use | ⭐ | ⭐⭐ | ⭐⭐⭐ |
Choosing the Right Renderer
Decision Tree
Use Cases
- Educational Videos
- Scientific Visualization
- 3D Showcases
- Development/Testing
Recommendation: CairoMost educational content is 2D:
- Equations and text
- 2D graphs
- Geometric diagrams
Renderer-Specific Features
Cairo Only
- Precise 2D rendering: Perfect for diagrams
- Text shaping: Advanced typography
- SVG-like quality: Clean vector output
OpenGL Only
- Interactive preview: Real-time interaction
- Fast rendering: GPU acceleration
- Window mode: Live preview window
VTK Only
- VTK file export: .vtp, .vtm, .pvd formats
- Scientific data: Scalar/vector fields
- Advanced shading: Physically-based rendering
- ParaView compatibility: Direct export
Switching Renderers
You can use different renderers for the same scene:Performance Considerations
Cairo
- Startup: Fast
- Rendering: Moderate (CPU-bound)
- Memory: Low to moderate
- Best for: Small to medium 2D scenes
OpenGL
- Startup: Moderate
- Rendering: Fast (GPU-accelerated)
- Memory: Moderate
- Best for: Large 3D scenes, development
VTK
- Startup: Slow (VTK initialization)
- Rendering: Moderate to slow
- Memory: Higher (complex meshes)
- Best for: Final quality renders, export
Troubleshooting
OpenGL: Black screen
OpenGL: Black screen
Cause: OpenGL drivers not availableSolution:
VTK: ImportError
VTK: ImportError
Cause: VTK not installedSolution:
Cairo: Poor 3D quality
Cairo: Poor 3D quality
Cause: Cairo is optimized for 2DSolution:
Switch to VTK or OpenGL for 3D:
Slow rendering
Slow rendering
Cause: Complex geometry or wrong rendererSolution:
- Use lower quality for testing:
-ql - Use OpenGL for faster preview
- Reduce geometry resolution
Best Practices
Use appropriate renderer for task
Use appropriate renderer for task
Write renderer-agnostic code
Write renderer-agnostic code
Most code works across all renderers:
Test with multiple renderers
Test with multiple renderers
Verify your scene works across renderers:

