Unity basic tips: how to set the object reflection sky box effect and set the sky box

Tip: After the article is written, the table of contents can be automatically generated. For how to generate it, please refer to the help document on the right.

Article directory

  • Preface
  • 1. Set up the skybox
  • 2. Set the effect of object reflection sky box


Preface

This article is about some small knowledge and tips about the Unity engine written by the author to accumulate knowledge. The author will update it from time to time here, hoping to help everyone.        


提示:以下是本篇文章正文内容,下面案例可供参考

1. Set up the skybox

First we open Unity, my version is 2020.3.40f1c1.

Then we prepare a picture ready to set up the skybox.

Then we set the shape of the image's material to a box (Cube).

After setting up, don’t forget to click Apply under the Inspector panel.

 

 After Apply, a material ball will be automatically generated in your Project folder. At the same time, the name will be consistent with the name of your picture and can be modified by yourself.

 Drag this material ball into the scene, and then the sky box of your scene will switch to the material effect you dragged.

 If there is no effect after dragging, it means that the sky box is not opened and displayed in the scene.

 At this time, we only need to open the Skybox under the star-like button above and select it, and the skybox in the scene will appear.

2. Set the effect of object reflection sky box

First, we create a plane and a square object in the scene. I take the square object as an example.

 Then we create a new material, and the name of the material is Smooth.

 Then we place the created material on the block object in the scene.

 When we looked at the block object at this time, we found that the attribute panel of the block object had a Smooth material.

 We adjust the parameters of Metallic and Smoothness to 1. Metallic can set the degree of reflective sky box, and Smoothness can set the smoothness of the object surface to give it a metallic texture.

 

After adjustment, we can find changes in the objects in the scene. At this time, the reflection effect is a bit blurry.

 At this time, when we open Lighting under Rendering under Windows, a panel will pop up.

Then we find the Environment Lighting property and Environment Reflections property under Environment.

Adjust the parameter of Intensity Multiplier to 0 (it can adjust the influence of the light of the sky box on the object), and then adjust the parameter of Resolusion to (this is to adjust the resolution of the sky box reflected by the object). It is recommended to be 1024.

After setting the above two parameters, check the reflection effect of the scene objects on the sky box.

 

 Turn off the sky box for better viewing.


Guess you like

Origin blog.csdn.net/qq_62947662/article/details/132294204
sky