You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/fragment/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,7 @@
136
136
<divclass="col-md-9" role="main">
137
137
138
138
<h1id="fragment-shaders">Fragment Shaders</h1>
139
-
<p>Fragment shaders are the shaders that run directly on geometryafter vertex shaders usually. They can do a lot of things, such as texturing, fog, and normal map effects.</p></div>
139
+
<p>Fragment shaders are the shaders that run directly on geometry, usually after vertex shaders. They can do a lot of things, such as texturing, fog, and normal map effects.</p></div>
<p>Chromatic Aberration is an effect commonly observed in images, when the camera can't focus all color channels onto a point. This results in different colors being in slightly different positions.</p>
148
-
<p>In shaders, this effect can be simulated by offsetting the position at which we sample each color channel. This is quite simple, but the value by which you offset needs to be quite small to look any good.</p>
148
+
<p>In shaders, this effect can be simulated by offsetting the position at which we sample each color channel. This is quite simple, but the value by which you offset needs to be quite small in order to look any good.</p>
149
149
<p>Let's first assume a couple variables we have access to.</p>
<p>Using <ahref="https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)">swizzling</a>, or accessing only a specific component of a vector, we can easily only get the value we need. Notice that for the last channel, I use a vector 2 instead of a float, because of course, we need to get the alpha channel as well. We'll just use the blue offset to sample the alpha channel.</p>
168
+
<p>Using <ahref="https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)">swizzling</a>, or accessing only a specific component of a vector, we can easily get only the value we need. Notice that for the last channel, I use a vec2 instead of a float, because, of course, we need to get the alpha channel as well. We'll just use the blue offset to sample the alpha channel.</p>
<p>So, we've constructed our output color with the offset channels. This is often times enough, but realistically, you'll only see chromatic aberration near the very edges of images, and not so much the center.</p>
173
+
<p>So, we've constructed our output color with the offset channels. This is oftentimes enough, but realistically, you'll only see chromatic aberration near the very edges of images, and not so much at the center.</p>
174
174
<p>To make this effect more realistic, we can simulate that.</p>
175
-
<p>We have the current normalized position in <code>normalizedCoords</code>. Now this ranges from 0 to 1, but with a bit of clever math we can get something cool.</p>
175
+
<p>We have the current normalized position in <code>normalizedCoords</code>. At the moment this ranges from 0 to 1, but with a bit of clever math we can get something cool.</p>
<p>So you see, the values range from 0.5 at the bottom left, to 0.5 at the top right. This means that in the center, the values are 0.0, or close to it. We're effectively reducing our offset by how close it is to the center. </p>
187
+
<p>So, you see, the values range from 0.5 at the bottom left, to 0.5 at the top right. This means that in the center, the values are 0.0, or around it. We're effectively reducing our offset by how close it is to the center. </p>
188
188
<p>This means that the effect will only really be visible around the edges, which is exactly what we want.</p>
189
-
<p>However, it's probably not going to be that visible, as we've effectively halved it, seeing how we're multiplying by at most, 0.5. So we can modify our absolute value line to increase it.</p>
189
+
<p>However, it's probably not going to be that visible, as we've effectively halved it, seeing as how we're multiplying by at most, 0.5. So, we can modify our absolute value line to increase it.</p>
Copy file name to clipboardExpand all lines: articles/vertex/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,7 @@
136
136
<divclass="col-md-9" role="main">
137
137
138
138
<h1id="vertex-shaders">Vertex Shaders</h1>
139
-
<p>Vertex shaders don't get a lot of recognition. They are integral to how we see graphics though, especially 3D graphics.</p>
139
+
<p>Vertex shaders don't get a lot of recognition, but they are integral to how we see graphics, especially 3D graphics.</p>
140
140
<p>Vertex shaders are responsible for running on vertices, or the points in our 3D model for example. They might handle converting world coordinates into screen-space coordinates, or perhaps procedural geometry deformation.</p>
141
141
<p>They also pass a lot of data into fragment shaders, to enable them function properly (such as colors, or UVs).</p></div>
Copy file name to clipboardExpand all lines: index.html
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -148,8 +148,8 @@
148
148
<divclass="col-md-9" role="main">
149
149
150
150
<h1id="welcome-to-the-library-of-shaders">Welcome to the Library of Shaders</h1>
151
-
<p>The Library of Shaders is an open-source project that intends to release <strong>copyright and license free</strong> examples and explanations for shader effects, in order to empower developers to learn and develop shader effects.</p>
152
-
<p>All shader code is written to be valid <strong>GLSL</strong> or <strong>OpenGL Shading Language</strong>. We define a few variables which match the <ahref="https://www.shadertoy.com/new">ShaderToy</a> environment for ease of testing, but they can be swiftly adapted.</p>
151
+
<p>The Library of Shaders is an open-source project that intends to release <strong>copyright and license free</strong> examples and explanations of miscellaneous shader effects, in order to empower developers to learn and develop shader effects themselves.</p>
152
+
<p>All shader code here is written to be valid <strong>GLSL</strong> or <strong>OpenGL Shading Language</strong>. We define a few variables which match the <ahref="https://www.shadertoy.com/new">ShaderToy</a> environment for ease of testing, but they can be easily adapted as needed.</p>
153
153
<h2id="variables">Variables</h2>
154
154
<pre><codeclass="language-js">Shader Inputs
155
155
uniform vec3 iResolution; // viewport resolution (in pixels)
<p>All contributions are welcomed, and the contribution guide can be viewed on the <ahref="https://github.com/Snorfield/The-Library-Of-Shaders">github repository</a>. This library is built by developers for developers, and we appreciate everyone's help.</p>
170
170
<h2id="licensing-and-copyright">Licensing and Copyright</h2>
171
-
<p>This entire library and all work inside it is licensed <strong>Creative Commons Zero</strong>. You can do anything you want with it, including clone the entire website. The license information is avalible on the <ahref="https://github.com/Snorfield/The-Library-Of-Shaders/blob/main/LICENSE">repository</a>.</p></div>
171
+
<p>This entire library, and all work inside it, is licensed <strong>Creative Commons Zero</strong>. You can do anything you want with it, including clone the entire website. The license information is avalible on the <ahref="https://github.com/Snorfield/The-Library-Of-Shaders/blob/main/LICENSE">repository</a>.</p></div>
0 commit comments