Skip to main content

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

In manim.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

FeatureCairoOpenGLVTK
2D Quality⭐⭐⭐⭐⭐⭐⭐
3D Quality⭐⭐⭐⭐⭐
Performance⭐⭐⭐⭐⭐⭐⭐
Text/LaTeX⭐⭐⭐⭐⭐⭐⭐
Stability⭐⭐⭐⭐⭐⭐⭐⭐
Export FormatsImage/VideoImage/VideoVTK Files
GPU Acceleration
Scientific Use⭐⭐⭐⭐⭐

Choosing the Right Renderer

Decision Tree

Use Cases

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

Cause: OpenGL drivers not availableSolution:
Cause: VTK not installedSolution:
Cause: Cairo is optimized for 2DSolution: Switch to VTK or OpenGL for 3D:
Cause: Complex geometry or wrong rendererSolution:
  • Use lower quality for testing: -ql
  • Use OpenGL for faster preview
  • Reduce geometry resolution

Best Practices

Most code works across all renderers:
Verify your scene works across renderers:

Next Steps

VTK Renderer

Detailed VTK renderer guide

VTK Export

Learn about VTK file export

Configuration

Configure renderer settings

CLI Options

All command-line options