A high-performance 3D Heatmap Visualization system developed in Unity 6, specifically designed for Digital Twin applications (such as intelligent grain storage). It transforms discrete sensor data into immersive, fluid-like thermal volumes using CPU parallel processing and custom Raymarching.
- Parallel IDW Computing Core: Powered by the C# Job System (
IJobParallelFor), distributing Inverse Distance Weighting (IDW) interpolation across all CPU cores. It is highly optimized for performance-sensitive environments like WebGL. - Voxel Rendering Pipeline: Instead of traditional mesh-based interpolation, this system generates a dynamic
Texture3Dvoxel grid, eliminating visual banding and artifacts. - Advanced Raymarching Shaders:
- Dual Mode Rendering: Supports both smooth organic "Rainbow" gradients and industry-standard 20-level precise discrete color banding.
- Fluid Turbulence: Integrated 3D Simplex noise and time-based offsets to simulate the rising "heat haze" and atmospheric turbulence of high-temperature zones.
- Visual Fidelity: Implements screen-space dithering to eliminate sampling layers and HDR glowing for critical hot spots.
- Industrial Layout Support:
- Square Granary: Automatic matrix-based cubic grid generation.
- Circular Silo: Parametric cylindrical distribution based on ring/radius settings.
- Data Snapshot System: Capability to capture and compare thermal states (e.g., "Before" vs "After" ventilation) for historical data analysis.
The system treats every voxel in the
- Parsing: Deserializes sensor coordinates and real-time temperatures from JSON data.
- Mapping: Spawns physical sensor proxies and aligns them within the normalized volume bounds.
- Job Processing: Fills a
NativeArray<Color32>with interpolated thermal data. - Buffer Upload: Updates the
Texture3DGPU resource in a single frame. - Raymarching Pass: The URP shader samples the texture and performs volumetric integration with custom color mapping.
- Unity Version: Unity 6 (or 2023.3+)
- Render Pipeline: Universal Render Pipeline (URP)
- Clone the repository and open the project in Unity.
- Attach the
HeatVolumeManager_CPU.csscript to an empty GameObject. - Assign a material using either
HeatRaymarching.shaderorHeatRaymarching_Gradient.shader. - Load your JSON sensor data into the
Real Data Text Fileslot.
| Parameter | Function |
|---|---|
| Step Size | Controls sampling density. Lower values improve quality at the cost of performance. |
| Noise Scale | Adjusts the granularity of the thermal fluid pattern. |
| Glow Intensity | Adjusts the HDR brightness for areas exceeding defined high-temperature thresholds. |
| Opacity | Overall transparency of the thermal cloud. |