Transmutation: Camera Effects

25 Aug

Unity has some image effect standard assets that allow some pretty cool things to be able to happen to the camera.

Image Effects

Importing Image Effects

I started to fiddle with and check out all of the image effects on the camera, what they did, and which ones I thought would be appropriate to use.

I had Noise Grain: But chose not to continue trying to make it work.

Noise Grain.JPG

It didn’t add anything to the game play or make it feel more interesting. It was cool but didn’t change the atmosphere or experience that I was going for. Noise Grain is out.

I came across motion blur. It felt like if a person was to get radiation this is probably what they’re going to see.


0.92 Motion Blur.gif

Maximum Motion Blur

This was great, but I’d have to find a way to make sure that the player’s current radiation level on each character was affecting the amount of motion blur that the camera put out.

Motion Blur Script.JPG

Access the Proper Motion Blur Script

Because of the camera switching players and there only being 1 camera, it was easy to find the parent object constantly and get that parent object (player)’s radiation level. Then make the motion blur amount to 100th of the radiation level. Because the radiation level goes from a scale to 0-100, and the motion blur from 0-0.92. The divide amount is a set variable so there’s no magic numbers. But the / halfDivideAmount – I’ll get to that in a bit.

So the motion blur would increase with the players radiation and become more intense with the more radiation the current player had. Until it reached its maximum of 0.92. It looked pretty crazy but I knew I wasn’t going to leave it at that.

Next was bloom (makes colours brighter and more vibrant). Transmutation relies on the emphasis of lighting. Bloom just makes it more beautiful.

This slideshow requires JavaScript.

I fiddled with the Bloom Intensity for a while to try and find the right value. Bloom 3 was a really nice amount. 15 Was really cool, but obviously too much. So I decided to roll with three and give it a proper play test.

This slideshow requires JavaScript.

If a few mutants or radioactive goop puddles ended up close enough to each other it proved to still be a bit too ridiculous. I’d also recently discovered ToneMapping. This is a hard one to explain. “Monitors (along with others) all have a limited dynamic range (LDR) that is inadequate to reproduce the full range of light intensities present in natural scenes. Tone mapping addresses the problem of strong contrast reduction from the scene radiance to the displayable range while preserving the image details and color appearance important to appreciate the original scene content.” (WikiPedia). It evens out the amount of colour per pixel that’s close enough to each other to fit withing a 255 RGB (W & B) range? Or something? Anywho, It works!

This slideshow requires JavaScript.

I was still able to have the 3 intensity of Bloom and have the ToneMapping work its magic to make sure radioactive goop puddles didn’t become a pile of suns.

I thought about making the bloom scale with the players radiation level much like the motion blur. But after play testing with the tonemapping activated and the bloom set at 3, I was content. Although at the start while the level is much more empty and less bloomy, letting the game take it’s course and spawn mutants and radioactive goop puddles never became overwhelming but only more beautiful as time went on.

It came to a point where I found more image effects that seemed like they would be applicable if someone was suffering from radiation. Vortex!


Vortex allowed me to make vortex in the middle of the screen. I thought that along with the player getting motion blurring with radiation, why not have the vortex change between two values to give the effect of wobbling. I started with an angle of 25 to -25 (A range of 50).

This slideshow requires JavaScript.

Then I had to design the system to make it change between these two values. I wanted the angle to have a maximum and minimum value but change how fast it wobbles between the two based on the players current radiation level.

Vortex Script.JPG


Much like the motion blur, I needed to make the script I’m making access the ImageEffects.Vortex to get the angle of the vortex.

  • Start the current vortex angle on 0.01f (It’s not noticeable).
  • Have a countingUp bool = true (To make sure the vortex starts adding).
  • Make the camera get the parent player (because this changes)
  • Determine how fast the angle is going to change based on the current players radiation level.
  • Start the angle changing. If the current vortex angle is not maximum – Start making it ++ towards the maximum value by deltatime * vortexRate.
  • If the angle is at the desired maximum, start making it — down towards the negative value.
  • Set the vortex angle to the currentVortex.

When this came into play along with Bloom and Motion Blur – having maximum angles of 25 and -25 was a bit too much. It was completely mind boggling, It was really hard to comprehend what was happening and what you were supposed to be looking at or doing.

I changed the maximum and minimum values to be 10 and -10 (range of 20). The range of 20 made it still easily recognizable to understand whats going on and what you’re actually doing. Changing between the max and minimum at a rate of (makeFloat 5) was an ideal speed.
For Example: If the current player’s radiation was 50.
The vortex rate would be: (50 / 5) = 10.
Then the angle is changing by + or – by (Time.deltaTime (which is anywhere between 0.03 to 0.075 on my computer) * 10) which is anywhere from 0.3 or 0.75 per frame.
In a span of 5 frames at a rate of 0.75 the angle would change 3.75. And if there is a range of 20 it would be changing from max to min in 5.333(more) seconds.
At 90 radiation: The vortex rate would be 90 / 5 =18.
0.075 * 18. In 5 frames it would change 6.75. It would change from max to min range in 2.96296(more). That amount doesn’t make ME sick. And I hope it doesn’t make others sick. So as the radiation increases so does the speed of rate the angle of the vortex. If the rate needs to be smaller or higher all I have to do is adjust the makeFloat value.

At this point I also changed the maximum amount of motion blur. And as I mentioned earlier. The HalfDivideAmount. Read the big block of Green text.

Motion Blur Script

50% of motion blur at almost maximum radiation along with Bloom and Vortex was the perfect amount.

The one last image effect that I thought would add to the radiation would be something that resembles the player blacking out. Like A Vignette?


There was also an image effect for that too. And much like the motion blur.

Vignette Script.JPG

I’d need to access the Vignette script directly and apply the exact same principles. Because the vignette intensity goes from 0-1 (then anything over 1 makes the game white) and 1 intensity would make the entire screen black – the player wouldn’t be able to see what they’re doing from about 80 radiation and on wards. So 50% (0.5) intensity on TOP of all the other image effects would be more than enough to represent the player blacking out / dying.

Vignette Game.JPG

Are you ready? READY FOR THE MAGIC?

Until next time –



Leave a comment

Posted by on August 25, 2016 in C#, Game Dev, Post FX


Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: