Overview
TeeChart’s OpenGL rendering engine provides hardware-accelerated graphics for superior performance and visual quality, especially with 3D charts, large datasets, and real-time visualization. TheTTeeOpenGL component enables OpenGL rendering for any TChart.
Getting Started
Basic OpenGL Setup
Source:VCL/TeeNew/OpenGL_Editor.pas:16
Required Units
OpenGL Canvas Features
3D Object Rendering
Source:VCL/TeeNew/OpenGL_Canvas.pas:77
Texture Mapping
Apply bitmap textures to 3D shapes:Advanced OpenGL Features
Surface Rendering
Source:VCL/TeeNew/OpenGL_Surface.pas
High-performance 3D surface charts:
Anti-Aliasing
Source:VCL/TeeNew/OpenGL_AntiAlias.pas
Enable OpenGL anti-aliasing for smooth lines:
Light Direction Control
Source:VCL/TeeNew/OpenGL_LightDirection.pas
Control 3D lighting for realistic effects:
Performance Examples
High-Performance Surface
Source:VCL/TeeNew/OpenGL_TriSurface.pas
Triangulated surface for complex 3D data:
Real-Time Animation
Source:VCL/TeeNew/OpenGL_Football.pas
Animate 3D objects with timer:
OpenGL Configuration
Runtime Editor
Source:VCL/TeeNew/OpenGL_Editor.pas:36
Programmatic Configuration
Integration with TeeMaker
TeeMaker 3D Objects
TeeMaker uses OpenGL for hardware-accelerated 3D object rendering: Source:VCL/TeeMaker/TeeMakerMain.pas:27
GLSL Shaders
Custom shader support for advanced effects: Source:VCL/TeeMaker/TeeGLSLShaders.pas
Performance Characteristics
When to Use OpenGL
Ideal For:- 3D charts with 100,000+ points
- Real-time rotation/animation
- Complex surface plots
- Multiple series visualization
- Interactive 3D exploration
- 2D Lines: 2-5x faster than GDI
- 3D Surfaces: 10-50x faster than software rendering
- Real-time Updates: 60+ FPS with large datasets
- Rotation: Hardware accelerated, smooth at any angle
Benchmark Results
FromVCL/RingBuffer/readme.md:32:
OpenGL canvas is the fastest way in Windows and VCL to paint many lines and points. Skia canvas is faster than GDI+. Old legacy GDI is not that slow, but lacks antialias so lines become “jaggy”.
Troubleshooting
OpenGL Not Available
Performance Issues
-
Reduce Anti-Aliasing
-
Disable Shadows
-
Optimize Point/Line Count
Memory Management
OpenGL Extensions
Querying Extensions
Source:VCL/TeeMaker/TeeMakerMain.pas:41
TeeMaker includes OpenGL extension viewer:
Advanced Features
- Vertex Buffer Objects (VBO) - Fast geometry rendering
- Frame Buffer Objects (FBO) - Off-screen rendering
- GLSL Shaders - Custom visual effects
- Multi-sampling - High-quality anti-aliasing
Cross-Platform Notes
Windows
- Uses standard OpenGL 2.0+ implementation
- Hardware acceleration via graphics driver
- Best performance with discrete GPU
Linux
Source: OpenGL samples useOpenGLLinux unit
macOS
- OpenGL deprecated but still functional
- Consider Metal for future projects
Expert Tips
1. Initialize Early
2. Batch Updates
3. Use Appropriate Series Types
4. Monitor Performance
See Also
- Custom Drawing - Canvas drawing techniques
- Performance - Optimization strategies
- TeeMaker - 3D object creation with OpenGL
- TeeChart OpenGL Documentation
