Fading depth of field

Hi there I have an effect where I want depth of field on a camera to fade in and out.
I’ve got the depth of field effect on the camera and setup but in game when I toggle it on there is a skip in the framerate whilst the effect renders for the first time. What i was wondering is there a way to have it actually rendering the whole time but not have it shown on screen so when I turn it on it doesn’t have the initial hiccup when it kicks in.

I tried playing with all the variables available setting iterations and spread to 0 still shows a depth effect. Any ideas

Cheers guys

Not sure what you mean by Skip in Framerate. Is the framerate dropping as this is normal due to the additional passes the renderer has to make. Check out my YouTube link in my signature to see my DOF/binoculars effect. I’m currently away from my pc but I believe I am just turning on/off my DOF effect script. I’m not getting any glitches in framerate other than a slight drop. I’ll check when I get home and if I am doing anything further, I’ll post again.

Cheers,
matt.

The frame rate hitches when you allocate or deallocate RenderTextures, which happens when you turn most full screen effects on or off. After the initial pause, the frame rate will be smooth until you switch the effect on or off again. The hitch on de-allocation will be delayed by a little bit, as it only happens when the garbage collector gets around to freeing the associated memory.

Thanks for the replies, I figured it might be something like that which is why I was wondering is there a dof effect out there that you can scale the settings back so it’s basically off. The default one Ive messed with the settings but can never get it to look off. That way I wouldn’t nee to turn the effect on and off, just scale the settings so it looks off. Many thanks