- Home /
Psychedelic camera effect
Hello, everyone!
First of all, thanks to everyone at this forum. I'm developing my first game and solved most of my problems by reading pre-existing questions. You are amazing!
Now there's something I need to do and I haven't found a way of doing it so far. I'm developing a 2D game using C# and I want something like a drugs effect. Change colors with psychedelic like pink, green, yellow, red. (Don't ask, I'm not the game designer)
I thought maybe I should use a camera rendering effect, but I've never done any camera rendering.
Also, and this is an extra, but related (so I don't post twice, I think it's better): I need a blur effect. I made this death cam with a dark/transparent background color with the scores and the "try again" button and I want a blur effect there. I read it could be very resource consuming, but I'll give it a try (also, it's a simple 2D game, so I think I can take some extra resources without compromising performance).
Again, thank you very much and I hope you can help me!
I really haven't tried anything yet because I don't know where to begin. Sorry!
You should look at fullscreenshaders. But to use them you must first learn to code shadows. This is really complicated. $$anonymous$$ore then learning c# in my opinion. Better take an existing solution. $$anonymous$$aybe from the asseststore.
Answer by jn327 · Jul 29, 2015 at 08:58 PM
Best to use an image effect yeah. One thing you could do is use the VignetteAndChromaticAberration effect and change it's intensity randomly, with a sine wave or mathf.pingpong in code. Something like:
VignetteAndChromaticAberration chromatic_Vignette = Camera.main.GetComponent<VignetteAndChromaticAberration> ();
chromatic_Vignette.chromaticAberration = Mathf.PingPong(Time.time, 2));
You'd get an effect like the following: https://www.youtube.com/watch?v=XLj5dhtMauo
You can also have a different effect that displaced the current screen render depending on a texture, I've made a package and put it on my dropbox: https://www.dropbox.com/s/kdddre20y1h7vg0/WavyScreen.unitypackage?dl=0
That's really close to what I'm looking! Thanks! I'll tell you how it goes
Hi @jn327 : I need to do something like this! The Dropbox link no longer works. Any other link to get the package?
Hey, it must have been deleted as I can't find it anymore, sorry about that. No matter as it probably would have all been legacy and half depreciated now that unity has merged all the effects into the post processing stack (see https://docs.unity3d.com/$$anonymous$$anual/PostProcessing-Stack.html), I've yet to mess around with it so I cant offer you much advice on its usage, but its probably the best approach.
If you're using a version of unity that doesn't support the post processing stack then you'll probably need the Standard Assets in your project (see https://docs.unity3d.com/540/Documentation/$$anonymous$$anual/HOWTO-InstallStandardAssets.html) Basically you'll want to attach the vignette effect to your main camera and then in script that you want to modify the vignette effect from use the code I posted above, you'll probably need to include 'using UnityStandardAssets.ImageEffects;' in said script (see https://answers.unity.com/questions/1018636/how-can-you-access-and-change-the-values-of-the-vi.html).