How can i freeze a shader ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By horsecar123

I want to freeze my shader (not disappear) and keep it the way it is. Any idea how can i do it?

What do you mean by “freeze”? Do you want the shader to pause its execution?

Ertain | 2022-03-06 20:41

I have a blood shader randomly spreading from the enemy. I want to stop it from spreading and show only the last frame(it will keep showing the last frame without disappearing).

horsecar123 | 2022-03-06 21:44

If the shader is suppose to do something over time (e.g. spread something), then have the shader stop doing its thing after that amount of time has lapsed. For example, once the time variable that is used to calculate and show the spread has reached a certain value (3 seconds, a minute, whatever), only use that value. This is also called “clamping” a variable to a certain range.

Ertain | 2022-03-07 05:29

:bust_in_silhouette: Reply From: Inces

You can also pause node the shader is attached to. However You must search the project settings to find pause options and check to apply pause to shaders.

i cant find pause options in project settings. Are you sure this is avaliable for godot 3.4

horsecar123 | 2022-03-08 13:54

I am sorry, it seems pausing shaders is only available in VisibilityEnabler functionality, which means it can not be paused and visible at the same time.
Give me code of your shader and I will try to pause it manually

Inces | 2022-03-09 09:34