Background
A client has requested that we add Unity’s dithered LOD Crossfade feature to all our shaders for flexibility. However, I have reservations about this since Unity doesn’t use it on any of their shaders besides the SpeedTree shader.
Questions
- Is there a default increase in cost from simply supporting the feature on my shaders, even when the effect isn’t executing?
- I noticed that the SpeedTree shader has a flag to disable batching when using LOD Fading. Can I assume that normal batching behavior applies when it isn’t fading?
Thanks for any help you can provide.
No, there is no additional cost if you do it right. Put your implementation behind preprocessor (LOD_FADE_CROSSFADE or LOD_FADE_PERCENTAGE or both). Unity will enable those keywords only when the transition is happening. Your shader will be unchanged otherwise.
The cost of the transition depends on your implementation. I guess that is one of the reasons why Unity doesn’t use it in built-in shaders. There are several ways how to implement it and different platforms work best with different methods.
1 Like
@Michal_1
Okay. I kinda figured that was the case, but I thought I’d ask since you can never be sure with Unity. And yeah, I planned to use the same setup as the SpeedTree shaders since it looked like that would prevent any extra cost when not using the feature.
Thanks for the help.