Forward Rendering Forward rendering
forward renders a shader-based render path. It supports the calculation of light per pixel (including normal maps and light cookies) and real-time shading from a parallel light. In the default settings, a few of the brightest lights are rendered in per-pixel calculation of light mode. The rest of the light calculates the illumination of the object vertex.
Depending on the light source that affects the object, the forward rendering path renders the object with a single or multiple channels. In forward rendering, the light source itself will be treated differently depending on their settings and intensity.
Implementation Details
In forward rendering, the lightest light sources that affect an object use pixel-by-light mode. Next, up to 4 point lights are calculated as vertex-by-pixel rendering. Other light sources will be calculated in the form of spherical harmonic
(spherical harmonics) , and the spherical harmonic technique can be calculated quickly but only with approximate values. Determine whether a light source is a per-pixel light source according to the following rules:
- A light source that is set to be unimportant (not Important) is calculated in the form of a vertex or spherical harmony
- Brightest directional light is a pixel light source
- Render mode is set important (Important) light source is the pixel light source
- If the number of pixel light sources based on the above rules is less than the number of pixel lights in the quality setting (Pixel light count), more light sources will be rendered in pixel-wise to reduce brightness
render each object in the following ways:
- The underlying channel renders a pixel-by-point light and all the vertex/sphere-by-layer harmonic light.
- Other pixel-by-image light are rendered in the attached channel, requiring one channel for each light source
Assuming that light sources a to H have the same color and intensity, and that their rendering modes are automatic (auto), they are strictly sorted by their name。 The brightest light source is rendered in pixel-per-light mode (A through D), and then up to 4 lights are rendered in per-vertex illumination mode (d to G), and other light sources are rendered in spherical tones (g to h).
Note that there is overlap between the different light groups, such as the last pixel-by-point light that is rendered in the light-per-vertex mode, which reduces the potential for objects and lights to appear when moving
"Light Jump"Phenomenon.
Base Pass Basic channel
The underlying channel renders the object with a pixel-by-direction light and all spherical harmonic light. This channel is also responsible for rendering the illumination map, ambient light, and spontaneous light in the shader. The direction light rendered in this channel can produce shadows. It is important to note that objects that use a light map do not get light from the spherical and light.
Additional Passes Additional channels
Additional channels are used to render other pixel-wise light sources that affect objects. The lights rendered in these channels cannot produce shadows (so forward rendering supports a directional light that can produce shadows).
Performance Considerations Performance Considerations
Render spherical and light quickly. They spend very little CPU time and actually do not have to spend any GPU computing time (in other words, the underlying channel calculates the spherical harmonic illumination, but because the spherical harmonic light is computed, the time spent calculating them is the same regardless of the number of spherical harmonic lights).
The disadvantages of spherical harmonic light sources are:
- They calculate the vertex of the object rather than the pixel. This means that they do not support shadow masks and discovery maps.
- The spherical harmonic light is only very low frequency. The spherical harmonic light does not produce a sharp illumination transition. They also affect scattered light only (the frequency of the spherical harmonic light is too low for the highlights).
- Spherical harmony is not local, and the spherical and spot light and spotlight near the surface may "look incorrect".
In general, the effect of spherical and light is good enough for small dynamic objects.
Unity Render Path Rendering Paths_2_forward Rendering forward rendering