I have a shader that does some wave vertex animation using _Time.y built-in shader parameter. At runtime it works fine, but in editor it’s strange. It seems to either update every EditorApplication update (when AnimatedMaterials is on) or only update when the material editor receives an event (like moving the inspector scrollbar).
Is this expected?
I actually want to just enable and disable the preview of the wave animation in editor. I thought that using AnimatedMaterial property would be enough, but the fact that it randomly updates when clicking options in the custom material editor is distracting!
In editor the _Time value appears to be updated separately for the scene view, game view, and material preview. There does not appear to be a nice way to control this behavior so you’ll just have to deal with it being weird unless you want to resort to using your own time variable you pass to shaders globally. Even then the material preview window doesn’t update in real time so it’ll still “pop”.
I really don’t mind about the game view or the material preview that much, as I mainly use the scene view. However, it just feels like a bug to me to have an option in the scene view to disable animation on materials, but that doesn’t prevent the material inspector to randomly update the _Time built-in parameter when an event is sent (like mouse click or similar).
I’ll try to simplify my case and send a bug report just to double check.