Procedural Foliage Shader
A high-performance wind and interaction system for dense forest environments.
← Back
to Portfolio
UE5 / HLSL / TOOLING
Final Result
[INSERT VIDEO OR HIGH-RES GIF]
Node Graph Breakdown
Vertex displacement logic utilizing world-space noise.
The Challenge
Standard vertex wind often looks "soupy." The goal was to create a hierarchical wind system where branches sway differently than leaves, while keeping the instruction count under 150 for mobile targets.
Implementation
I utilized the Red Channel of the vertex colors to mask wind influence, ensuring the trunk stays rooted while the canopy moves.
// Sample HLSL Vertex Displacement
// Calculate wind based on vertex color
float mask = input.VertexColor.r;
float3 wind = sin(_Time.y * _Speed + (worldPos.xz * _NoiseScale));
input.Position.xyz += wind * mask * _Intensity;
Key Takeaways
- Optimized for draw call batching.
- Reduced shader complexity by 15%.
- Implemented custom "pivot painter" logic via Python.