Untiy 3d Shaderlab_ 7th _ forward Render path _4_forward render path Summary

Source: Internet
Author: User

Forward Rendering Path Summary

It is now possible to summarize the situation of forwardbase and Forwardadd adapted to the forward rendering path.
Adaptability of materials under 7.4.1 forward rendering path
These two types of passes cannot be dyed when the camera is vertexlit, but can be rendered by the rendered path to the camera Forward and Deferred .
7.4.2 How Unity Sets the light source for the forward render path

        within Forwardbase Pass, _worldspacelightpos0 and _ The LightColor0 will only contain a valid combination of the first pixel row light . In the absence of pixel parallel light, _woridsapcelightpos0 may also contain 1 location data for the pixel point light source, but there is no valid _LIGHTCOLOR0 data. Within the Forwardadd, _worldspacelightpos0 and _lightcolor0 will only contain pixel light sources, and in accordance with the intensity, the order of the parallel light priority is performed once for each pixe! light source.
      in Forwardbase, when there is no Forwardadd pass, the combination of unity_4lightpos[x, Y, z]0, and Unity_lightcolor[4] contains the data of the point light source, According to the principle of pixel intensity, but not the parallel light, when there is Forwardadd, then forwardbase inside Unity_4lightpos[x,  y,  z]0 only contains vertex point light source. Within Forwardadd, Unity_4lightpos[x,  y,  z]0 do not contain valid data. Unity_lightatten0 data is used to switch between 1.0 and 0.0, indicating whether the corresponding unity_4lightpos[x,  y, z]0 is a valid light source data.
       UNITY_LIGHTPOSITION[4] never contain any valid data within Forwardbase and Forwardadd, Oddly, its X component is always 1.0, and it only contains dead data that is not purged in time until it switches back to forward and deferred mode from camera's vertexlit mode.

Speaking so much, in fact for the forward render path, you can simply use the Shade4pointlights function in Unitycg.cginc to calculate the illumination of the vertex light source in forwardbase. For pixel light sources, you must use _WORLDSPACELIGHTPOS0 and _lightcolor0 to calculate.

Untiy 3d Shaderlab_ 7th _ forward Render path _4_forward render path Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.