Definition: WebGL (Web Graphics Library) is a JavaScript API that shows hardware-accelerated 3D and 2D graphics directly in the web browser, without plugins, downloads or installations. WebGL uses the GPU (graphics processing unit) for real-time rendering and is based on the OpenGL ES standard.
In B2B mechanical engineering, WebGL enables: interactive product viewers in the browser, 3D configurators without app installation, virtual showrooms and booths, technical visualizations for sales and support, and cross-platform 3D presentations (desktop, tablet, mobile).
Advantage: Customers can explore machines in 3D without installing software. They only open a link in the browser.
English: WebGL (Web Graphics Library) German: WebGL, Web-3D-Grafik
How It Works
GPU-accelerated rendering in the browser
WebGL gives JavaScript direct access to the graphics card:
- The browser loads a web page with WebGL code
- JavaScript calls the WebGL API
- The GPU renders the 3D scene in real time
- The result appears in an HTML5 canvas element
Difference from conventional web graphics: Normal images and videos are static or pre-rendered. WebGL calculates 3D graphics in real time on the GPU, like desktop software, but in the browser.
OpenGL ES as the basis
WebGL is based on OpenGL ES 2.0/3.0 (a mobile graphics standard):
- Originally developed for smartphones
- Adapted to desktop GPUs for the web
- Gives low-level control over the graphics pipeline
- Shader-based (GLSL for visual effects)
WebGL 2.0 (current standard)
Available since 2017, with extended functions:
- Improved texture processing
- 3D textures and volume rendering
- Instanced rendering (many identical objects, rendered efficiently)
- Better performance for complex scenes
B2B Applications
Interactive product viewers
Customers explore machines directly in the browser:
Workflow:
1. The customer opens the product page in the browser
2. The WebGL viewer loads the 3D model of the machine
3. The customer rotates, zooms and explores details
4. No app installation is necessary
Use: Packaging machines, CNC milling machines, printing machines, conveyor systems.
Advantage over photos:
- 360° view from all angles
- Zoom in on details
- Interactive instead of static
3D product configurators
Customers configure machines in real time:
Example: configuring a CNC milling machine
- The customer selects the axis configuration (3-axis, 5-axis)
- Selects the tool magazine size
- Adds or removes the protective enclosure
- The 3D model updates in real time
- The price is calculated live
Technology: WebGL renders the configuration immediately. No server rendering is necessary.
Advantage: Fast visualization of complex configurations without waiting time.
Virtual showrooms and booths
Digital exhibition spaces in the browser:
Use: Virtual factory halls with machine layouts, digital booths (in addition to physical trade shows), product portfolio visualization.
Workflow:
- The visitor opens a link
- WebGL loads the 3D environment
- Navigation with mouse or touch (like in a video game)
- Click on machines for details
Advantage: Customers all over the world can visit the showroom. No travel is necessary.
Technical documentation and support
3D instructions for service technicians:
Use: Maintenance instructions with 3D exploded views, spare parts catalogs (3D view of the components), remote support (the expert shows a 3D model, the technician follows in the browser).
Advantage: Easier to understand than 2D drawings. No CAD program is necessary.
WebGL Frameworks for B2B
Three.js (most used)
A high-level framework that makes WebGL development easier:
Advantages:
- Abstracts the complex WebGL API
- Large community, many examples
- Supports common 3D formats (OBJ, FBX, glTF)
- CAD integration is possible
B2B use: Product viewers, configurators, virtual tours.
Code example concept (simplified):
- Load the 3D model
- Place the camera and lights
- Start the rendering loop
- Add interaction (rotation, zoom)
Babylon.js
An alternative to Three.js, specialized in complex scenes:
Advantages:
- Optimized for large, detailed 3D models
- Integrated physics engine (for simulations)
- VR/AR support (WebXR)
B2B use: Complex machines with many components, simulations (motion sequences), VR showrooms in the browser.
A-Frame (WebVR/AR)
A framework for immersive web experiences:
Use: WebAR product presentations (place the machine in the customer's environment), WebVR showrooms (VR headset in the browser).
Advantage: Simplified VR/AR development, based on Three.js.
WebGL vs. Native Apps
When to use WebGL (browser-based)?
✅ Advantages:
- No installation (a link is sufficient)
- Cross-platform (Windows, Mac, Linux, mobile)
- Easy sharing (send a URL)
- No app store approval necessary
- Updates are available immediately (no download)
Ideal for: Product presentations, configurators, quick demos, a wide target audience.
When to use native apps (AR/VR)?
✅ Advantages:
- Access to device hardware (camera, GPS, sensors)
- Better performance (optimized for the platform)
- Offline use is possible
- Deep integration (push notifications, etc.)
Ideal for: AR applications (machine in a real environment), VR training, complex simulations, offline scenarios.
Hybrid approach (best of both)
A combination of WebGL and native apps:
- WebGL viewer for the initial presentation (low entry barrier)
- Native AR app for the detailed view at the customer site
Example: The customer explores the machine in the WebGL viewer → interest grows → AR app to place the machine in the production hall.
Performance and Browser Support
Browser compatibility
All modern browsers support WebGL:
- ✅ Chrome, Edge (Chromium-based)
- ✅ Firefox
- ✅ Safari (iOS, macOS)
- ✅ Mobile browsers (Chrome Mobile, Safari Mobile)
WebGL 2.0 support: >95% of browsers (as of 2024).
Performance factors
Hardware:
- GPU power (a dedicated GPU is better than an integrated GPU)
- RAM (for large 3D models)
- CPU (for logic, not for rendering)
Software:
- Browser engine (Chrome/Edge are the fastest, Safari on iOS is slower)
- WebGL drivers (updated automatically with browser updates)
Optimization for B2B applications
1. Polygon reduction:
- CAD models are often too detailed (millions of polygons)
- Optimize for the web: 100,000-500,000 polygons
- Show details with texture maps instead of geometry
2. Level of detail (LOD):
- Detailed version for close-up views
- Simplified version for distant views
- Automatic switch based on the camera distance
3. Progressive loading:
- A low-poly model loads first (fast)
- High-poly details load in the background
- The user sees something immediately
4. Texture compression:
- Compressed textures (Basis Universal, KTX2)
- Faster loading - lower RAM usage
Security
WebGL security protocol
Browsers isolate WebGL code:
- No direct hardware access (only through the API)
- Sandboxing prevents system access
- Protection against GPU-based attacks
Content Security Policy (CSP)
Companies can control the use of WebGL: CSP headers allow or block WebGL - protection against unwanted 3D content
CAD data security
When you provide 3D models on the web:
- Share optimized models (not the original CAD data)
- DRM/watermarking for confidential models
- Access control (login required)
Frequently Asked Questions (FAQ)
Does WebGL work on older devices?
WebGL works on devices from approx. 2012 (smartphones) or 2010 (desktop) onward. Older devices without GPU support cannot run WebGL.
Solution: Fall back to a 2D display or show the message "Browser/device not supported".
Rule of thumb: Devices that are <5 years old support WebGL 2.0 without problems.
How large can WebGL models be?
- File size: Ideally <10 MB for fast loading (3G network ~30 s). Up to 50 MB is acceptable for detailed machines (Wi-Fi recommended).
- Polygon count: 100,000-500,000 polygons for desktop, 50,000-200,000 for mobile.
- Optimization: Progressive loading for large models (low-poly first, details load later).
Can you use WebGL for augmented reality (AR)?
Yes, through the WebXR API.
- WebXR: The standard for VR/AR in the browser, based on WebGL.
- Use: Place a machine in the production hall with the smartphone camera (WebAR).
- Limitation: Fewer features than native AR apps (ARKit, ARCore), but no installation is necessary.
- Best practice: WebGL for the initial presentation, a native AR app for precise placement.
Which 3D formats does WebGL support?
WebGL itself does not support any formats. Frameworks such as Three.js load the formats.
- Common formats: glTF 2.0 (recommended, web-optimized), OBJ (simple, but no materials), FBX (CAD export, large), USDZ (iOS AR, limited).
- Recommendation: glTF 2.0 for web viewers, OBJ as a fallback for older systems.
How is WebGL different from WebGPU?
- WebGL: The current standard (since 2011), based on OpenGL ES, wide browser support.
- WebGPU: A new standard (from 2024), based on modern GPU APIs (Vulkan, Metal, DirectX 12), better performance, more features.
- Status: WebGPU is still in development. WebGL stays the standard for B2B applications (2024).
- Future: In the medium term, WebGPU will supplement or replace WebGL, but the migration will take years.
Industry Standards and Technologies
WebGL specification:
- Khronos WebGL Specification – official WebGL standards
- WebGL 2.0 Specification – current version
- OpenGL ES – base technology
Frameworks and tools:
- Three.js – JavaScript 3D library
- Babylon.js – web-based 3D engine
- A-Frame – WebVR/AR framework
- PlayCanvas – web-based game engine
- Sketchfab – 3D model hosting with a WebGL viewer
Web standards:
- WebXR Device API – VR/AR in the browser
- glTF 2.0 – web-optimized 3D format
- WebAssembly – performance boost for WebGL
Related Topics
Web technologies:
- WebXR – VR/AR in the browser
- WebGPU – successor to WebGL
- HTML5 Canvas – 2D graphics in the browser
- WebAssembly – high-performance web code
- Progressive Web Apps – installable web apps
3D technologies:
- 3D model – 3D modeling
- Real-time rendering – rendering in real time
- glTF – web 3D format
- Three.js – WebGL framework
- Babylon.js – alternative WebGL engine
B2B applications:
- 3D product configurators – web configurators
- Product visualization – 3D product presentation
- Virtual showrooms – digital exhibition spaces
- Web-based CAD viewers – CAD in the browser
- E-commerce 3D – 3D in the online shop
AR/VR technologies:
- Augmented reality – AR basics
- Virtual reality – VR technology
- WebAR – AR in the browser
- WebVR – VR in the browser (deprecated → WebXR)
- Immersive experience – immersive presentation
Performance:
- GPU acceleration – use of the graphics card
- Level of detail (LOD) – detail level optimization
- Progressive loading – loading in stages
- Polygon reduction – geometry optimization
- Texture compression – compression of textures
