This original article was first published on the WeChat public account: Byte-Flow.
Reprinting is prohibited without the permission of the author (WeChat ID: Byte-Flow).
I have posted some articles about Shader programming before, but some readers have reported that they are too fragmented. I hope that a series can be compiled here to facilitate systematic learning of Shader programming.
Since mainstream Shader programming websites, such as ShaderToy and gl-transitions, all develop Shaders based on GLSL, and there is not much difference in syntax between MSL and GLSL, the following series of articles will mainly introduce Shader programming using GLSL.
Later Shader programming will use VSCode + ShaderToy plug-in as the programming environment. The steps are as follows:
-
Download and install VSCode https://code.visualstudio.com/download;
-
Install the ShaderToy plug-in;
-
Create a new file with the suffix .frag and copy and paste the code of this article;
-
Right-click the current code, select ShaderToy:Show GLSL Preview, and then you can happily debug special effects.
Image stretching and deformation problem