[Unity Shaders] Mobile Shader Adjustment-customizes the Shader and shadersadjustment for Mobile phones.

Source: Internet
Author: User

[Unity Shaders] Mobile Shader Adjustment-customizes the Shader and shadersadjustment for Mobile phones.

This series mainly references the book "Unity Shaders and Effects Cookbook" (thanks to the author of the original book) and adds a bit of personal understanding or expansion.

Here are all the illustrations in this book. Here is the code and resources required for this book (you can also download them from the official website ).

========================================================== ===================================================== =====



Preface


In the previous article, we learned some tips to optimize the Shader. This time, we will learn more techniques to implement a more complex Shader: Normal-Mapped Specular Shader. These techniques include: using two new variables halfasview or approxview of the illumination function, reducing the number of textures used and better compressing textures.



Preparations


  1. Create a new scene and a sphere, and add a parallel light.
  2. Create a new Shader and Material, which can be named MobileShader.
  3. Assign Shader to Material and assign Material to sphere.

Implementation
Finally, the result is as follows:


Explanation
Finally, we will summarize all the technologies we have used: optimizing variable types, sharing UV coordinates, reducing the number of processed light sources, allowing the Shader to work only on a specific Renderer, and replacing the exact value with an approximate value, and reduce or compress textures.











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.