Skip to content

Commit 30f5003

Browse files
committed
add vs code extension links, clean up some development info
1 parent 6293be5 commit 30f5003

4 files changed

Lines changed: 19 additions & 31 deletions

File tree

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,24 @@ This tutorial is based on one written by [saadam1n](https://github.com/saadam1n/
1616
:::
1717

1818
You will need:
19-
- A suitable text editor for modifying shader code. One popular choice is [Visual Studio Code](https://code.visualstudio.com/), but any program which can edit text files is sufficient. A simpler but popular editor is [Notepad++](https://notepad-plus-plus.org/).
19+
- A suitable text editor for modifying shader code (see below).
2020
- A computer capable of running OpenGL 3.3. If your computer was manufactured in the last 15 years it likely supports OpenGL 3.3. Note that whilst OpenGL works on macOS, Apple will not update the drivers to support any version past OpenGL 4.1 and some things may not work correctly.
2121
- A willingness to learn. Shaders are hard, and you can't just pick them up overnight. Do not expect to complete this tutorial and become the next Sonic Ether.
2222
- An instance of Minecraft with Iris, Optifine, or Oculus installed. Since this tutorial is in the Iris documentation, it is assumed you are using Iris.
2323

24+
## Development Environment
25+
26+
Any text editor is suitable for shader development. One popular choice is [Visual Studio Code](https://code.visualstudio.com/), but any program which can edit text files is sufficient. A simpler but popular editor is [Notepad++](https://notepad-plus-plus.org/).
27+
28+
If you are using Visual Studio Code (which we recommend), there are a couple of extensions you can use which can help with development.
29+
30+
- [GLSL Syntax for VS Code](https://marketplace.visualstudio.com/items?itemName=GeForceLegend.vscode-glsl)
31+
- [Language Server for Minecraft Shaderpacks](https://marketplace.visualstudio.com/items?itemName=GeForceLegend.vscode-mcshader)
32+
2433
It's helpful to be able to see your game logs as the game is running. In the vanilla Minecraft launcher, you can do this by enabling 'keep the Launcher open while games are running' and 'Open output log when Minecraft: Java Edition starts" in the settings.
2534
If you do not use the vanilla launcher, but your launcher does not support viewing logs in realtime, a popular choice is [Prism Launcher](https://prismlauncher.org/).
26-
In Iris, it is also useful to enable debug mode. You can do this by pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> in the shader selection screen.
35+
36+
It is also useful to enable debug mode. You can do this by pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> in the shader selection screen. For more info, see [debugging shaders](/current/reference/miscellaneous/debugging_shaders/).
2737

2838

2939
## OpenGL and GLSL
@@ -43,3 +53,4 @@ Odds are, all your previous code has been executed on the CPU. Shaders are inste
4353
:::
4454

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

src/content/docs/current/Reference/Miscellaneous/debug_mode.mdx

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/content/docs/current/How To/debugging_shaders.mdx renamed to src/content/docs/current/Reference/Miscellaneous/debugging_shaders.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ The 'Use no error context' setting will prevent the game from loading on some AM
1616
# Finding Compilation Errors
1717
Iris does not have proper support for line numbers in error messages. Line numbers in error messages correspond to the patched version of your shader code, which will not necessarily line up with the line numbers in your original code, especially if you have made use of the `#include` directive. The patched shader output can be found in the `.minecraft/patched_shaders`. Here's an example.
1818

19-
![`deferred2.fsh: ERROR: 0:336: 'something' : undeclared identifier`](../../../../assets/debugging/compilationerror.webp)
19+
![`deferred2.fsh: ERROR: 0:336: 'something' : undeclared identifier`](../../../../../assets/debugging/compilationerror.webp)
2020
In this error message, we can see that the error occurs on line 336 of `deferred2.fsh`.
2121

22-
![line 336 says "something = 0;"](../../../../assets/debugging/patchederror.webp)
22+
![line 336 says "something = 0;"](../../../../../assets/debugging/patchederror.webp)
2323
Opening `.minecraft/patched_shaders/005_deferred2.fsh` and navigating to line 336, we can see the line causing the error. Using the surrounding context, and perhaps the find+replace option in your text editor/IDE, you should be able to find the offending line.
2424

2525
# Attaching a Debugger

src/content/docs/current/Reference/Miscellaneous/patcher.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ sidebar:
88

99
The source code of a shader pack is not the final code that is compiled and executed. In order to ensure maximum compatibility, Iris runs the shader code through [glsl-transformer](https://github.com/IrisShaders/glsl-transformer), which generates **patched shader code**. This is the code that actually ends up on the GPU. In the context of developing shaders, there are several important consequences to note:
1010

11-
- Since the patcher removes non-necessary whitespace in the code, line numbers in errors will not match up with the line numbers in your code
11+
- Since the patcher removes non-necessary whitespace in the code, line numbers in errors will not match up with the line numbers in your code.
1212
- You cannot name your functions or variables in a similar manner as internal Iris variables:
1313
- `iris_`
1414
- `irisMain`
1515
- `moj_import`
16-
- The patcher will sometimes fix code that should otherwise fail
17-
- Conversely, the patcher may not be flawless. If you're experiencing a bug and have exhausted all other possibilites, its worth checking the patched shader code
16+
- The patcher will sometimes fix code that should otherwise fail.
17+
- Conversely, the patcher may not be flawless. If you're experiencing a bug and have exhausted all other possibilites, it's worth checking the patched shader code.
1818

1919
:::tip
20-
When [debug mode](/current/reference/miscellaneous/patcher/) is enabled, the patched shader code can be found in the `/patched_shaders/` folder in the root of your Minecraft directory.
20+
When [debug mode](/current/reference/miscellaneous/debugging_shaders/) is enabled, the patched shader code can be found in the `/patched_shaders/` folder in the root of your Minecraft directory.
2121
:::
2222

2323
More information can be found [here](https://github.com/IrisShaders/Iris/blob/1.21/docs/usage/debugging.md).

0 commit comments

Comments
 (0)