Lighting and Rendering in Unity

One: Lighting in Unity

——Directional Light: Simulate sunlight. It has nothing to do with the position, it is a parallel light, and the rotation angle can be adjusted to simulate day and night
——Spot Light: simulate the light of car lights, flashlights, and stage lights ——Point
Light: simulate light bulbs
——Area Light: This type of light source cannot be applied in real time Lighting, only applicable to light map baking, it can only act on static objects, and generate light maps through baking, thus reducing performance overhead

General parameter settings for lighting
—Color: color of light
—Intensity: intensity of light
—Shadow Type: shadow type
—Cookie: projection under light
—Culling Mask: similar to Camera, you can set different layers of lighting Rendering
—Mode: real-time rendering mode, mixed rendering mode and baking mode. In baking mode, it can only be applied to static objects. Lightmaps are generated by baking, reducing performance overhead

Real-time global illumination and baked global illumination
Global illumination is referred to as GI. In order to be closer to the real world, it is actually composed of global illumination and indirect illumination.
There are three lighting modes, real-time rendering mode, hybrid rendering mode and baking mode. When a light acts on the For static objects and dynamic objects, using mixed rendering mode can reduce performance overhead.

Select the lighting mode as mixed rendering mode, so that static objects can use baking mode for light map calculation, and dynamic objects can continue to use real-time lighting calculation Subtractive
is A mode with the least performance overhead, and there will be some unsupported effects at the same time. Baked Indirect is a mode with the most advanced effects.
Adjusting the lighting effect is a slow job. You can set various parameters of the shadow in the Quality of Project Setting (whether Turn on the shadow, how far to display the shadow, the type of shadow, etc.) or add a light probe (Light Probe Group)


Two: Skybox

——Self-made skybox

Find an expanded image of a cube and import it into Unity, select Texture Shape to

create a new material for Cube, set Shader and Cubemap, and assign the material to the Skybox Material set by Lighting

Lighting settings

Skybox Material: Skybox material
Environment Lighting: Ambient light settings (ambient light source, ambient light intensity)
Environment Reflections: Ambient light reflection


Three: reflection probe 

Reflection probes are a solution for simulating the lighting information of surrounding objects. It is a simulated lighting effect that allows objects to be affected by the lighting or materials of surrounding objects. If you do not use reflection probes, objects will only
reflect the skybox, for example Objects in an interior should reflect information from walls and interior scenes instead of skyboxes


四:PostProcessing

Use the Package Manager to install the PostProcessing plug-in.
PostProcessing can be mounted on the camera to achieve various effects.


Five: Rendering path settings


The rendering path determines how lighting is applied to the Unity Shader. Therefore, if you want to deal with light sources, you need to specify its rendering path for each Pass
——Forward: Forward rendering, this rendering mode is generally used, and you need to pay attention to using this mode. The more lights in the scene, the slower the rendering performance
——Deferred: Deferred rendering is the best rendering mode, but it also requires powerful hardware support. It does not support real anti-aliasing and cannot handle translucent objects——Legacy Vertex Lit:
This is a vertex Rendering, the effect is relatively poor. Devices with poor performance can use this vertex-level rendering

Guess you like

Origin blog.csdn.net/LLLLL__/article/details/126997273