- Home /
Create white "flash" (like an edit) on whole view?
A very typical effect -- there's a big explosion, and the whole scene (i.e., the entire camera view) flashes white for a few frames.
(This is also trendy with many editors of TV commercials .. when you change shots you "cut through white" and it gives a sort of trendy white flash effect with the cut.)
To alternately explain what I mean, it's like when you get a bright flash (the whole scene) indicating "someone took a photo".
I've tried a few solutions like adding a cheesy white 50% plane in front of the lens, but I guess there's probably a conventional way to do this I don't know about?
Could this relate to Image Effects? (is for ipad only BTW)
Surprisingly couldn't find anything like this using the search function. Thanks !
So you tried a plane in front of the camera with 0 opacity then fading up quickly to 'flash'?
Did that not work? Or was not satisfactory?
That would probably be the way I would do it anyway.
@Eric5h5 - exactly !! :)
@3agle - I sure did. But it just does not feel right somehow.
You know when you're program$$anonymous$$g, and you just know someone is going to come along and say "Oh, you don't know about THIS?" ... it seems like there must be some more elegant way, than having a plate sitting there all the time.
BTW, I think in an editing sense the best pattern to achieve that feel is...
_whiteness = Random.Range(0.2,1.0);
weirdWhiteSprite.color.a = _whiteness;
yield;
weirdWhiteSprite.color.a = 0.2 * _whiteness;
yield;
weirdWhiteSprite.color.a = 0.0;
yield;
i.e., jump from 0 to 100 {or, some random max}, then next frame cut that way down, and then you're out. (I based that on analyzing some typical TVCs, that ridiculous effect was so popular for awhile there.)
PS edited twice due to damn HT$$anonymous$$L symbols woe.
Nah, that's framerate-dependent. It should be based on time, not frames...depending on how many frames per second it's running, and whether vsync is off, that could very well not even be visible since it wouldn't be drawn by the monitor. See my answer.
Ah, a fantastic point, thanks. To be clear, the three frames in my example would run at perhaps 60fps on certain machines, perhaps 30fps on others and so on - am I right there?
I have assumed yield; on it's own is the same as the next FixedUpdate() .. no?
If it doesn't "feel" right, maybe what it needs is an easing function (Google "penner easing"). It will fade in a non-linear way and have more "punch." Also you could get the free Strumpy Shader Editor and make yourself a shader with some kind of custom blending mode that will give you a saturated overbright/ blown-out effect ins$$anonymous$$d of a simple fade-to-white.
Answer by Eric5h5 · Sep 06, 2012 at 04:06 PM
Use a 2x2 pixel white texture on a GUITexture, set to cover the entire screen--position (.5, .5), scale (1, 1), 0 for pixel inset values--then fade it out over time. (Like with this.) Also, disable the GUITexture when it's not actively in use...100% transparent pixels covering the entire display is really quite bad for fill-rate.
A GUITexture is a plane sitting in front of the camera, but it's quite a bit easier to manage than a "real" plane. Image effects would also effectively use a plane in front of the camera, but would be limited to Pro and possibly not as efficient, and anyway is more complicated while not really gaining any benefits.
No, actually people don't complain about GUITexture performance. They complain about OnGUI code performance, which is a different thing.
GUITexture performance ....... intriguing, thanks for that. A practical upshoot of this is that using a GUITexture, in an of itself, is not lamer than, well, putting a "normal" sprite in front of the camera. Cheers!
How to make it flicker when looking at enemy? Like in slender but want to use it as a warn to player...
Answer by eabramson · Sep 06, 2012 at 08:56 PM
If you use an HDR image, you might get some blooming that looks more like overexposing the shot, Hollywood style. Don't know if you could do that on mobile though.
Answer by Screenhog · Sep 06, 2012 at 04:30 PM
iTween has a section of scripts called CameraFade (CameraFadeAdd, CameraFadeFrom, etc.). You could just use that with a small white texture and fade it in or out as needed.
Isn't iTween using OnGUI to do that fade? I've been using that but it could be slow compared to Eric's answer. I don't believe it's fading between cameras - you could do that with render to texture and 2 cameras with alpha blending on the faded in texture I guess....
How to make it flicker when looking at enemy? Like in slender but want to use it as a warn to player...
@blackpanther get the frame and turn on and off the white thing every x frames (or something like this)...
Answer by srmojuze · Aug 14, 2013 at 04:37 PM
You could also use Image Effects (Pro only) > Screen Overlay.
Your answer
Follow this Question
Related Questions
Camera layering with post processing? 0 Answers
Multiple post processing profiles? 2 Answers
How to make camera position relative to a specific target. 1 Answer
Change color of Standard Assets Vignette 0 Answers
How to use Post Processing AND a Camera Script,How to use a camera script AND post processing? 0 Answers