Introduction: Introduction to the concept of rendering
-
Understanding the Render Pipeline
- Understand vertex shaders
- Understand pixel/chip shaders
- Understand the MVP matrix
- Understanding the Lighting Model
- Understand the texture
- To understand the material
How do people see the world — ask questions
They see because they have light
Q. How do we see an object? A. Because light passes through the object and ends up in the human eye
Q. What are the types of light that passes through an object and enters the human eye? A. Objects emit light spontaneously and reflect light from the outside (specular and diffuse reflection)
Q. How does the world appear in different colors? A. Light entering the human eye is composed of light of different frequencies, which can activate the cones of the human eye.
Q. What color does an object end up in the human eye, and what determines it? A. Light entering the eye has different frequencies and stimulates different cones. There are three types of cones in the human eye. Red, green and blue
How to use computer to simulate the world — to analyze the problem
What problems need to be solved?
- Understanding Light Colors
- Understanding self-illumination
- Understanding mirror emission
- Understanding diffuse reflection
- Understand Light Source Types
Analyze the problems that need to be solved one by one:
1. Understand the color of light, that is, given a light entering the human eye, how does the color come out
-
Understanding the color space
- RGB: 3 colors. Understand the intuitive
- HSV: Hue, saturation, lightness. It’s a little bit more descriptive
- HLS: Hue, saturation, brightness. Similar to HSV
- Computers often use the RGB color space
- Light stimulates the cones and corresponds to RGB, so you can set the color of the light to RGB
- What about the intensity of the light? RGB color space, hue, saturation, brightness, HSV color space detail RGB, HSV and HSL color space computer color knowledge survey (1) : color gamut
2. Understand the self-illumination of objects
- Light source type. Parallel light, point light, spot light…
- For the UI layer, you can think of it as self-illuminating. How does real-time rendering of the Dundall effect realize the Dundall effect? Advanced Rendering Series 4 — Halo (Light Blur)
3. Understand specular reflection
!
- Object surface is smooth, Angle of reflection = Angle of incidence
How do we in the mirror — the reflection of light — explain the reflection and refraction of light at the microscopic level?
4. How to describe diffuse reflection
- The surface of the object is rough and the Angle of reflection is diverse
- Light enters the interior of the object and then scatters the diffuse reflection law of the surface
5. How to describe the type of light source (light direction, attenuation)
- The parallel light source
- A point source
- The spotlight
- Area Light Lighting and Rendering (IX) – Light Source Types
III. Brief introduction of illumination model — summary
-
Local lighting model: only deals with the effect of the light source on the object, not considering the light reflected from other objects
- Advantages: only the light source needs to be considered, so the calculation is simple. For each pixel can be concurrently calculated, perfect for rasterization
- Disadvantages: no consideration for reflected light. The only way to compensate is through “ambient light”.
- Formula: Object surface color = direct light (specular + diffuse) + ambient light (specular + diffuse)
- Global Illumination Model: Based on optics, it calculates the true propagation of light in the world. I haven’t studied it yet.
Lighting model BRDF – search solution
BRDF: An equation describing how a surface reflects light.
So the lighting model is to pick the appropriate BRDF to calculate the final object shading.
Direct diffuse light reflection BRDF
The direct mirror surface reflects BRDF
Indirect Light – Ambient Light BRDF
Disney is a company of its own
5. Render knowledge review — string knowledge together
-
What does the texture do?
- Sets the base color of the surface
- This base color will be used in the calculation of BRDF
-
What does the material do?
- Sets some properties of the surface of the object
- These properties set the parameters for specular and diffuse reflection of the object
VI. Implementation of partial BRDF
Diffuse diffuse
Lambert diffuse BRDF:
Why is the Lambert light in PBR divided by PI?
Environmental ambient light
Ambient light BRDF:
SSAO Principle of Environmental Mask
Specular reflection
Specular reflection BRDF:
Because I can’t understand the formula and there are many online implementations, I use the Blinn Phong formula in the DX12 dragon book
The Fresnel effect
A couple of questions
- What parts of a game do you think affect the quality of the picture?
- Why is UE4 generally thought to have better picture quality than Unity?
- Implementing the Disney lighting model in UE4 and Unity, what is the difference between the final image of the two?
- Open: what is the relationship between textures and materials?
- Expansion: only see RGB, what about the Alpha channel? What about transparent blending?
A physical-based Rendering (PBR) white paper — Hairy Nebula (Light Ink) Metal, Plastic, Stupid