Skip to content

Commit 8a3609f

Browse files
authored
Merge pull request #4 from all-the-good-names-are-taken/main
Proofreading
2 parents 5997bc7 + df09dc1 commit 8a3609f

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Library of GLSL shaders and explanations to empower developers to learn shader d
99
So you want to add your own articles or other stuff to this project. That's awesome, there's just a few rules for contribution.
1010

1111
### Rule 1
12-
Use the ShaderToy uniforms in all your code.
12+
Use the ShaderToy uniforms in all of your code.
1313

1414
```js
1515
Shader Inputs

docs/articles/fragment/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Fragment Shaders
22

3-
Fragment shaders are the shaders that run directly on geometry after vertex shaders usually. They can do a lot of things, such as texturing, fog, and normal map effects.
3+
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.
44

docs/articles/post/ChromaticAberration.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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.
44

5-
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.
5+
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.
66

77
Let's first assume a couple variables we have access to.
88

@@ -33,7 +33,7 @@ float green = texture(iChannel0, normalizedCoords + greenOffset).g;
3333
vec2 blueAlpha = texture(iChannel0, normalizedCoords + blueOffset).ba;
3434
```
3535

36-
Using [swizzling](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)), 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.
36+
Using [swizzling](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)), 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.
3737

3838
Now, we can join it all together.
3939

@@ -45,11 +45,11 @@ fragColor = vec4(red, green, blueAlpha);
4545

4646
## Edge Strengthing
4747

48-
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.
48+
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.
4949

5050
To make this effect more realistic, we can simulate that.
5151

52-
We have the current normalized position in `normalizedCoords`. Now this ranges from 0 to 1, but with a bit of clever math we can get something cool.
52+
We have the current normalized position in `normalizedCoords`. At the moment this ranges from 0 to 1, but with a bit of clever math we can get something cool.
5353

5454
First, let's shift our coordinates over.
5555

@@ -71,17 +71,17 @@ float green = texture(iChannel0, normalizedCoords + (shiftedCoords * greenOffset
7171
vec2 blueAlpha = texture(iChannel0, normalizedCoords + (shiftedCoords * blueOffset)).ba;
7272
```
7373

74-
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.
74+
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.
7575

7676
This means that the effect will only really be visible around the edges, which is exactly what we want.
7777

78-
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.
78+
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.
7979

8080
```js
8181
shiftedCoords = abs(shiftedCoords) * 2.0;
8282
```
8383

84-
Doubling it brings it back to the original strength, but you can increase this or decrease it however you want to tweak the strength.
84+
Doubling it brings it back to the original strength, but you can increase or decrease this however you want to tweak the strength.
8585

8686

8787
## Full Program
@@ -111,3 +111,4 @@ void mainImage( out vec4 fragColor, in vec2 fragCoord )
111111

112112

113113

114+

docs/articles/post/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Post Processing Shaders
22

3-
Post processing shaders are, well, they are what they sound like. These shaders run after, or post, processing happens.
3+
Post processing shaders are what they sound like. These shaders run after (post-) processing happens.
44

55
Instead of affecting how objects are drawn, they can apply final visual effects, before the user sees the frame.
66

docs/articles/vertex/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vertex Shaders
22

3-
Vertex shaders don't get a lot of recognition. They are integral to how we see graphics though, especially 3D graphics.
3+
Vertex shaders don't get a lot of recognition, but they are integral to how we see graphics, especially 3D graphics.
44

55
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.
66

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Welcome to the Library of Shaders
22

3-
The Library of Shaders is an open-source project that intends to release **copyright and license free** examples and explanations for shader effects, in order to empower developers to learn and develop shader effects.
3+
The Library of Shaders is an open-source project that intends to release **copyright and license free** examples and explanations of miscellaneous shader effects, in order to empower developers to learn and develop shader effects themselves.
44

5-
All shader code is written to be valid **GLSL** or **OpenGL Shading Language**. We define a few variables which match the [ShaderToy](https://www.shadertoy.com/new) environment for ease of testing, but they can be swiftly adapted.
5+
All shader code here is written to be valid **GLSL** or **OpenGL Shading Language**. We define a few variables which match the [ShaderToy](https://www.shadertoy.com/new) environment for ease of testing, but they can be easily adapted as needed.
66

77

88
## Variables
@@ -32,4 +32,4 @@ All contributions are welcomed, and the contribution guide can be viewed on the
3232

3333
## Licensing and Copyright
3434

35-
This entire library and all work inside it is licensed **Creative Commons Zero**. You can do anything you want with it, including clone the entire website. The license information is avalible on the [repository](https://github.com/Snorfield/The-Library-Of-Shaders/blob/main/LICENSE).
35+
This entire library, and all work inside it, is licensed **Creative Commons Zero**. You can do anything you want with it, including clone the entire website. The license information is avalible on the [repository](https://github.com/Snorfield/The-Library-Of-Shaders/blob/main/LICENSE).

0 commit comments

Comments
 (0)