Skip to content

Commit b2d136a

Browse files
authored
Merge pull request #373 from lukajk1/fix/typos-in-docs
fix minor typos in 'your first shaderpack'
2 parents cf6dc88 + b4eed5e commit b2d136a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/content/docs/current/Guides/Your First Shaderpack/0_intro.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77
---
88

99

10-
## Foreward
10+
## Foreword
1111
This tutorial is based on one written by [saadam1n](https://github.com/saadam1n/MinecraftShaderProgramming). This newer tutorial has been necessitated by the fact that since the tutorial was written, the general state of development on Minecraft shaders has advanced somewhat, and other developers have identified several areas where this can be improved.
1212

1313
## Prerequisites
@@ -36,10 +36,10 @@ For the next part it is important to note that since most of the game's developm
3636

3737
## How Shaders Work
3838

39-
A "shader" is, by definition, any program that is executed on the GPU. For Minecraft, these shader programs (also know as passes) can be sorted into two distinct categories: fullscreen passes, which execute for the entire screen, and gbuffers passes, which execute only for specific geometry. Each individual program is composed of several shader stages, two of which are required: a vertex shader, which executes once for each vertex of the geometry, and a fragment shader, which executes once for every pixel that covers the geometry. You can optionally include a compute, geometry, and/or tessellation stage for each pass.
39+
A "shader" is, by definition, any program that is executed on the GPU. For Minecraft, these shader programs (also known as passes) can be sorted into two distinct categories: fullscreen passes, which execute for the entire screen, and gbuffers passes, which execute only for specific geometry. Each individual program is composed of several shader stages, two of which are required: a vertex shader, which executes once for each vertex of the geometry, and a fragment shader, which executes once for every pixel that covers the geometry. You can optionally include a compute, geometry, and/or tessellation stage for each pass.
4040

4141
:::tip[CPU vs GPU]
42-
Odds are, all your previous code has been executed on the CPU. Shaders are instead executed on the GPU (also know as a graphics or video card). CPUs are great at performing complex sequential tasks, whereas GPUs are great are executing simple tasks in parallel. In fact, modern high-end graphics cards are capable of performing *trillions* of calculations per second! You can read more about the differences [here](https://www.intel.com/content/www/us/en/products/docs/processors/cpu-vs-gpu.html).
42+
Odds are, all your previous code has been executed on the CPU. Shaders are instead executed on the GPU (also known as a graphics or video card). CPUs are great at performing complex sequential tasks, whereas GPUs are great at executing simple tasks in parallel. In fact, modern high-end graphics cards are capable of performing *trillions* of calculations per second! You can read more about the differences [here](https://www.intel.com/content/www/us/en/products/docs/processors/cpu-vs-gpu.html).
4343
:::
4444

4545
For a full list of programs and what they do, see the [Iris Docs](/current/reference/programs/overview/).

src/content/docs/current/Guides/Your First Shaderpack/1_composite.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Every shader's first line must be a version declaration. GLSL has two profiles:
6464
out vec2 texcoord;
6565
```
6666

67-
This is a variable declaration, but a special one. The `out` keyword means that the value will be passed to the fragment shader. The fragment shader can then have a corresponding `in` declaration which allows it to recieve this value. In older versions of GLSL, both `in` and `out` were represented with the `varying` keyword, thus variables passed between programs are often referred to as 'varyings'.
67+
This is a variable declaration, but a special one. The `out` keyword means that the value will be passed to the fragment shader. The fragment shader can then have a corresponding `in` declaration which allows it to receive this value. In older versions of GLSL, both `in` and `out` were represented with the `varying` keyword, thus variables passed between programs are often referred to as 'varyings'.
6868

6969
:::note[Note]
7070
Values passed from vertex shaders to fragment shaders are interpolated! This means that if one vertex has a value of 0, and another has a value of 1, then a pixel halfway between these two vertices will have a value of 0.5. This can be prevented by adding the `flat` keyword the `in` and `out` declarations.

src/content/docs/current/Guides/Your First Shaderpack/2_gbuffers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ normal = gl_NormalMatrix * gl_Normal; // this gives us the normal in view space
9292
normal = mat3(gbufferModelViewInverse) * normal; // this converts the normal to world/player space
9393
```
9494

95-
If you reload your shader, you will notice that there is an error that we have not defined `gbufferModelViewInverse`. To get this value, we declare it as a `uniform` before the `main` function. Uniforms are accessable by any shader program and have the same value wherever you access them. They are calculated on the CPU and uploaded to the GPU.
95+
If you reload your shader, you will notice that there is an error that we have not defined `gbufferModelViewInverse`. To get this value, we declare it as a `uniform` before the `main` function. Uniforms are accessible by any shader program and have the same value wherever you access them. They are calculated on the CPU and uploaded to the GPU.
9696

9797
```glsl
9898
uniform mat4 gbufferModelViewInverse;
@@ -157,7 +157,7 @@ if (color.a < alphaTestRef) { // alpha test
157157
```
158158

159159
- The first step multiplies the color by `glcolor` to get the biome tint.
160-
- The second step multiplies the color by Minecraft's defualt lighting color. You should remove this, as we are going to do our own lighting.
160+
- The second step multiplies the color by Minecraft's default lighting color. You should remove this, as we are going to do our own lighting.
161161
- Finally, if the color's alpha (transparency) is less than `alphaTestRef` (this is set by Iris, but usually 0.1), we `discard`, which tells the shader program to return and not write anything. This potentially saves us some texture writes.
162162

163163
## Writing Extra Data

src/content/docs/current/Guides/Your First Shaderpack/4_shadows.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This is actually all we need to get Iris rendering a shadow map. Let's now go ba
6262

6363
## Reading the Shadow Map
6464

65-
The shadow map is accessable as `shadowtex0`, so let's add this as a `sampler2D`.
65+
The shadow map is accessible as `shadowtex0`, so let's add this as a `sampler2D`.
6666

6767
```glsl
6868
uniform sampler2D shadowtex0;

0 commit comments

Comments
 (0)