I was just brainstorming a couple ideas and wondered if this might be possible?
All the image effects really do basically is take the image after it’s rendered and modify it. In that line of thought, pretty much anything is possible.
I think you really want to know how to do it, and I can’t help you there.
-Jeremy
Thanks Jeremy. What I think I might do for now (since I wouldn’t even know where to begin creating a new image effect) is to try changing the “noise” effect. I think that may be the closest effect to what I’m thinking about.
Actually, I was thinking about this again just now for some reason, and I wouldn’t use Image Effects at all really.
What I would do is render cam1 to a texture, display that texture full screen, then switch to cam2 behind.
Then to make a cross dissolve transition, you just lerp the opacity of the texture. For slide wipes you just lerp the x or y pos of the texture.
For push transitions, also render the second camera to a texture, position it to the side of the main texture, and lerp both texture’s x or y pos.
This way you can also so squash transitions, etc.
If you want a more weird effect, then you can modify the pixels of the image with whatever algorithm, or use a normal shader for the texture itself (just put it on a quad).
Hope that fuels some further ideas for you.
-Jeremy
Yeah, I bet that would work. Thanks Jeremy!
You don’t even need render textures to do some transitions. Here’s a couple of examples: a cross-fade and a push/squish transition.
Without a render texture, the cross-fade’s main limitation is that the images have to be static for the transition. (The texture’s Apply() for any decent sized screen resolution is too slow for real-time.) Well, sort of…the fade from is static, but the fade to can be moving. Also it doesn’t quite work right in the editor unless the game window’s aspect is None, so there aren’t any black bars.
The squish is just done with two cameras, so movement in both is fine. I was actually attempting a normal push wipe by fiddling with the cameras’ projection matrix, but ended up with the squish by accident, and thought it was cooler anyway, so I gave up on the standard push.
–Eric
Absolutely brilliant Eric! This should definitely reside on the wiki, I’m sure there will be other people who will want to use this.
Thanks Eric! I’m just working on some transitions.
OK, I’ll put them on the wiki. Also, here’s a couple more. One is an arbitrary shape wipe than can grow or shrink, and have optional rotation. Thanks to Neil Carter’s “nothing” shader, though I had to add “Tags { “Queue” = “Background” }” to get it to work consistently. You can make whatever shape you like in your 3D app, centered on 0,0,0 naturally, and turn it into a prefab, also positioned at 0,0,0 and with no rotation. Make sure the shape just fills the screen when it’s positioned slightly beyond the camera’s near clip plane (by default this is .3). The easiest way to test this is to drag the prefab into the hierarchy as a child of the camera, and change its z position to .301.
Aside from the wipe time, you can change the “rotate amount” variable. 0 = no rotation, 1 = 360 degrees over the course of the wipe. Therefore .5 = 180 degrees, 2 = two full turns, etc. Positive = clockwise, negative = counter-clockwise.
The limitation here is that it doesn’t entirely play nicely with skyboxes or solid camera background colors, since one of the cameras has to get temporarily changed to “clear flags = depth only” during the wipe. It works with skyboxes under two situations: You’re doing a grow and the first camera has no skybox or background color visible in the view frustum. Or you’re doing a shrink and the second camera has no skybox or background color visible. Otherwise you get wacky behavior. The good news is that both cameras can have movement during the wipe.
The other wipe is a rectangle wipe, which can zoom in or out. In this case, the entire contents grow or shrink, not just the shape. Since it uses the camera’s rect, there aren’t any limitatons.
–Eric
I’ll look at these tomorrow, but I’ve got to say Eric, you’re an absolute genius!
Haha, nice work Eric.
-Jeremy
awesome eric ; )
I dunno about genius, but in the “Now you’ve gone too far!” department, I present my final screen wipe trick: the partial dream wipe! You know, with the swirling wavy lines and stuff. It’s only “partial” because it really needs Pro to work properly; I took it as far as I could in Indie, which is still kind of amusing, I guess.
Like the cross-fade above, it uses the “fake render texture” technique, which means the first camera’s view is static during the transition, and it doesn’t quite look right in the editor unless the game view’s aspect is set to none. But the big problem is that without render textures, the second camera’s view can’t do the wavy thing at all, alas. And for the ultimate result, you’d use a blur camera filter that increased in amount during the wipe until the halfway point, and then decreased back to zero.
Thus we finally have a concrete answer to the original question in this thread.
In addition to the fadeTime variable which does the usual thing, there’s maxScale, which is how big (horizontally) the waves get at the halfway point. Probably don’t want to go much higher than .1 with that. waveFrequency is how many waves there are, with a larger number being fewer and a smaller number being more. If you go much smaller than 1, the effect starts looking kind of spiky due to the resolution of the mesh. Make the mesh have more polygons, and the effect will be smoother, but it needs to be exactly 2x1 units in size and centered exactly on 0,0,0, with the vertices sorted in order.
–Eric
Hi ,
I am unable to download the the ,.unity-packages given here . I can download the .zip file but not .unity-package file.
any help
thanks in Advance
Right-click → Download linked file.
For the record, I implemented a full dream wipe, which you can see here (requires Pro).
–Eric