Reflections in Unity

Marble Floor with simple reflections

Using reflections can lend credence to the realistic look you’re trying to achieve. This is especially true when you’re working with a reflective material or object, like a marble floor. Fortunately, Unity has made it easy to create more realistic reflections without the need for complex and complicated steps.

Reflection Probes

One way to achieve reflections is to use a Reflection Probe. This probe acts like a camera by looking at the data around it and captures it. The probe then generates a Cubemap that allows it to reflect what’s in the environment and can change according.

Step 1: Create the Probe

In order to edit the probe, you must first create it.

Start by adding it into the Hierarchy window by

Right Click -> Light -> Reflection Probe

This in turn will create a reflection probe in the shape of a wireframe cube in your scene

Step 2: Move and Modify the Shape of the Cube

Next, move the cube to the object you want the reflections on.

In this case, because I want the reflections on the floor, I moved the cube towards the middle of the marble floor and had it intrude a bit underneath the floor. This is to ensure the reflection probe takes into account the floor as well.

Next, with the probe selected, click on the 3 connected dots connecting them in the Inspector Panel.

This in turn will allow you to resize the cube.

Resize it to your need and reclick on the 3 connected dots in the Inspector Panel to exit out of Edit mode.

The final size of the reflection probe

The Final Product

Even though there is a reflection, note that the size, location, and quality of the reflections are off.

Notice the reflection of the doors is right below the wall panels

One might wonder if reflection probes can’t create realistic reflections, why would anyone use it. The main reason is the lower processing power needed to generate realistic reflections. For instance, if you’re making a mobile game or an object that you want reflections on but is miniscule in the overall scene, using reflection probes is the best way to achieve realistic reflections without dedicating a lot of processing power to create said reflections.

Screen Space Reflections

On the other hand, if you have the processing power to support more realistic reflections, like a computer or console, you can instead use screen space reflections. Screen Space Reflections, or SSR, is great when you want to create reflections on wet, shiny, or mirrored surfaces. However, because it uses Unity’s Post-Processing package, you’ll need to implement it if you have not.

Step 1: Create Post Processing Profile and Add Screen Space Reflections

After downloading the Post Processing package, you can create a Post Processing Profile by

Right-click in the Project Window -> Create -> Post-processing Profile

Next, with the new profile selected, click on Add Effect in the Inspector Panel and add Screen-Space Reflections

Step 2: Add Post Process Layer and Volume to the Main Camera

Depending on the Unity version you’re currently using, you might have to add both the Post-Process Layer and Post-Process Volume onto your Main Camera in order for SSR to work. You can add both by clicking on Add Component in the Inspector panel when viewing the Main Camera’s properties

Step 2a: Post Process Layer

Due to how the Post Process method works in Unity, there might be a few more steps.

  1. Red Box: Add the Main Camera as the Trigger
  2. Green Box: Add a new Layer. In this case, I called my new layer “Post”. In addition, change the Layer to the layer you just created.
  3. Blue Box: Change the layer to the new layer you just created.

Step 2b: Post Process Volume

Fortunately, Post Process Volume is straightforward. Just add the Post Process Profile you created in Step 1 in the slot next to the Profile.

Step 3: Modify the Properties of SSR

Now you can play around with the settings and watch it change before your eyes in the Scene view.

Final Product

The reflections are much more realistic this time and the size stays consistent to the actual object.

Furthermore, if you move around the scene, not only does the reflection stays with the object, the size also stays the same!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deploy Cisco virtual devices on an on-premise ESXi

Automatic Attendance System Error Solution

Destroying Game Objects in Unity Using a Simple Cube and Box Collider

RPA Analytics Solution , Automation Analytics , RPA Insight, Build RPA Center Of Excellence

Why you should learn Symfony in 2017

Adding a Background Image in Flutter

Google FooBar: Google’s secret hiring process

7 Must-Have Resources for Ionic App Developers

Resources for Ionic App Developers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Josh Vang

Josh Vang

More from Medium

Darwinia and Crab networks

Linguistic Evolution: Importance of Language

Blog 16: Literature Response to “Elliptical”

GPU Grant to Support TU Delft’s AI Research