[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.