- Home /
Changing render time (framerate) of a shader
Hi
Is it possible to adjust update time of a shader? For example i have a blur shader and i just want to update it 5 times in a second.
I want to make a blury background in pause/gameover menu for a mobile game. It is too expensive to use blur effects for mobile platform. So i wanted to render it for one time and use it as a background.
Thanks.
Does your menu-background change in any way? Because if it does not, you could just render your blurry background once (in a renderer of your choice) and use it as a texture
I'm pretty sure @equus_ligneus was suggesting that, if you're using a static background, to arrange the objects in a 3d package and render them out to an image file. This could even be done in unity editor, just apply the blur, take a screenshot of the game view and then crop it in an image editor of your choice. Then you remove the blur, and put the image behind your menu.
It is static but could change. Every gameover state will be different because player will be in different position. So i should generate this texture in play mode with no cpu spike.
Well, then I don't think you'll get past RenderTextures... And cpu-spikes for that matter (depends on your screen resolution in contrast to your cpu speed). Either do your blurring as a post processing effect or render your current view to an image, apply the blur and use it as an image in your gui. Because as far as I know, setting the frame rate for one specific shader is not possible.