Hello Unity guys!
My team is planning some heavy optimizations and we're putting together plans on turning our Shader Graphs into HLSL.
URP.
PBR shader - we already have a custom one done in Graph (not using Unity's built in version for reasons decided before I joined) and we'd like to HLSL it.
I've tried making a very stripped down glass-only shader in HLSL as a first step, but that shader ended up having a very long compile time (300 ms / 150 ms) compared to the Shader Graph (2.0, 1.8ms)
We're not 100% sure why. Working theory is that the includes we put into the shader are bloating it, but that is the point I can't find a clear answer for online.
So does anybody know these answers?
- Do unnecessary includes cause bloat to compile time or runtime performance?
- Does Shader Graph have logic to strip out what's not needed that an HLSL does not by default?