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.
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 Product
Even though there is a reflection, note that the size, location, and quality of the reflections are off.
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.
- Red Box: Add the Main Camera as the Trigger
- 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.
- 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.
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!