Summary
Request to add a volumetric fire/flame effect example to the three.js examples collection, particularly showcasing TSL (Three.js Shading Language) implementation for WebGPU compatibility.
Motivation
Fire effects are a highly requested feature in the three.js community, while the TSL fire particle example on the official website is good demonstrating how to create realistic volumetric flames. Three.Fire provides a more advanced effect and benefits, unfortunately it’s written in GLSL.
Current Project
The current project THREE.Fire has such benefits:
- Proven Implementation: Already has a working awesome GLSL-based volumetric fire shader with ray marching
- Real-world Usage: Based on “Real-Time procedural volumetric fire” by Alfred et al.
- Complete Package: Includes React components, TypeScript definitions, and comprehensive examples
- Performance Optimized: Features configurable quality settings and efficient noise generation
TSL Migration Intent
My goal has been to modernize the existing GLSL implementation to TSL format to:
- WebGPU Compatibility: Enable fire effects to work with both WebGL and WebGPU renderers
- Modern Shader Architecture: Leverage TSL’s node-based system for better maintainability
- Future-Proofing: Align with three.js’s direction toward TSL as the primary shading language
- Educational Value: Demonstrate TSL patterns for complex effects like volumetric rendering
Technical Challenges Encountered
After spending 2 days attempting the GLSL→TSL migration, I’ve encountered several challenges:
- TSL Varying Syntax: Difficulty with proper
varyingassignment patterns in TSL - Ray Marching Translation: Complex loops and sampling operations don’t translate directly
- Limited Documentation: TSL examples for complex effects are scarce
- Debugging Complexity: TSL compilation errors are often cryptic
Unfortunately, even with AI assistance (Claude), the shader expertise gap proved significant for completing this migration successfully.
Proposed Solution
Anyone who keen could help the community by:
- Creating an Official Example: Add
webgl_materials_fire.htmlandwebgpu_materials_fire.htmlexamples - TSL Implementation Guide: Provide a reference implementation showing proper TSL patterns for:
- Volumetric ray marching
- Noise generation and turbulence
- Custom varying handling
- Complex fragment shader logic
- Documentation: Include shader migration guidelines (GLSL→TSL) for advanced effects
Expected Benefits
- Community Value: Frequently requested feature becomes officially supported
- Educational Resource: Demonstrates advanced TSL techniques
- WebGPU Adoption: Encourages migration to modern rendering backend
- Ecosystem Growth: Enables more sophisticated three.js applications
Additional Context
The existing THREE.Fire implementation includes all the mathematical foundations needed:
- Simplex noise functions
- Cylindrical coordinate fire shaping
- Turbulence displacement
- Ray marching with configurable iterations
- Proper alpha blending and transparency
Files of Interest
- Original GLSL:
src/FireShader.ts - Attempted TSL:
src/materials/nodes/FireNodeMaterial.ts - Examples:
examples/directory with vanilla Javascript implementations
Request
Would anyone be interested in either:
- Implement the migration on the repo, or
- Providing guidance on proper TSL patterns for complex volumetric effects?
Any assistance would be greatly appreciated by the broader three.js community working with advanced shader effects.
While I may not offer much for anyone who can do it, but a coffee will be a sure thing I can offer.


