[Unity Shaders] uses Unity Render Textures to implement screen effects-brightness, saturation, and contrast in screen effects, shadersunity

Source: Internet
Author: User

[Unity Shaders] uses Unity Render Textures to implement screen effects-brightness, saturation, and contrast in screen effects, shadersunity

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


Through the previous article, we established a simplified screen effect system. In this article, we began to learn how to create more complex pixel operations to implement screen effects that are common in contemporary games.


It is very important to use screen effects to adjust the overall color of the game, which gives the designer the ability to control the game's final overall picture. For example, adjust the red, blue, and green colors of the game's final screen by adjusting the color bar, or add a certain color to make the screen look as an old movie.


In this article, we will learn more about adjusting the color of the image. That is, brightness, saturation, and contrast. Learning these ways to adjust colors gives us a good understanding of screen effects.



Implementation


A lot of code in this article is based on the previous one, so a lot of code does not need to be written ~


Finally, you will get an effect similar to the following:



Implementation
Since our previous Code has completed the core operations required to create a basic image effect, now we only need to complete the code for calculating the brightness, saturation, and contrast.
First, complete the Shader code. The following is a script. We need to add new code in the script so that we can send appropriate data information to the Shader: After completion, return Unity. We can change the brightness, saturation, and contrast in the panel. The following figure shows the result:



Explanation
Screen effects like this are very important for high-quality game images. They allow you to adjust the final screen of the game without editing all the materials in the scenario.





How does unity make special effects similar to air fluctuations?

Do you mean the desktop water ripple effects of Ubuntu?
Install compiz-config and select the water ripple effect.
The premise is that you have installed the graphics card driver. (Some special effects may cause Unity crash)

Unity light effects

This should be designed by the designer, or a plug-in is used.
 

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.