Skip to content

Commit 8657459

Browse files
committed
update debugging steps now that xirreal's mod works on Linux
1 parent c6b8811 commit 8657459

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In the previous tutorial, we had a variable called `texcoord`, which gave us the
6060
Minecraft calculates two values that represent how lit a block is: the exposure to emissive blocks (torches, lava, glowstone, etc.) and the exposure to the sky. These values are stored in `gl_MultiTexCoord1` as "lightmap coordinates", where the x channel encodes block exposure and the y channel sky exposure. The actual range of these values varies between Minecraft versions, but by multiplying it by `gl_TextureMatrix[1]` we instead get it in the approximate range [0.033, 0.97]. This still isn't very useful but we can fix this ourselves. Let's add a new line below the one assigning `lmcoord`.
6161

6262
```glsl
63-
lmcoord / (30.0 / 32.0) - (1.0 / 32.0);
63+
lmcoord = lmcoord / (30.0 / 32.0) - (1.0 / 32.0);
6464
```
6565

6666
This now gets us the correct light level. You will notice now that if you reload the shader, lighting is now broken. We will fix this later on.

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,31 @@ Graphics debuggers are very useful when developing shaders, as they can be used
2828
## RenderDoc
2929
[RenderDoc](https://renderdoc.org/) is an open source and cross platform graphics debugging tool. The method for hooking it into the game is operating system dependent.
3030

31-
### Windows
32-
The [Nsight and RenderDoc loader](https://modrinth.com/mod/nsight-loader) mod can be used to inject RenderDoc into the game on Windows. Simply select RenderDoc in the popup that appears when the game launches, and within RenderDoc, select `File`>`Attach to Running Instance` and select the game. It will likely appear as `javaw`.
31+
### Using the Mod
3332

34-
If the mod is not available for your version of the game, you can use process injection to hook into the game. Navigate to `Tools`>`Settings` and enable `Enable process injection (restart required)`, then restart the application.
33+
The [GFX-Debuggers](https://modrinth.com/mod/gfx-debuggers) mod can be used to inject RenderDoc into the game on Windows. Simply select RenderDoc in the popup that appears when the game launches, and within RenderDoc, select `File`>`Attach to Running Instance` and select the game. It will likely appear as `javaw`.
3534

36-
You can then select `File`>`Inject into Process`. Start the game, quickly search for `java` in the list, and press `Refresh`. Select the game, and press `Inject`.
37-
38-
:::caution[Warning]
39-
Process injection must happen before Minecraft initialises OpenGL. You need to be quick!
35+
:::tip[Tip]
36+
If the mod isn't available for your version of Minecraft, try using the latest version anyway.
4037
:::
4138

42-
### Linux
43-
On Linux, the game must be made to initialise RenderDoc by itself. This can be done by setting the `LD_PRELOAD` environment variable to the path to `librenderdoc.so`. This can commonly be found at `/usr/lib64/renderdoc/librenderdoc.so`, but you can find the exact path with the below command.
44-
39+
### Without the Mod (Windows)
4540

46-
```bash title="Finding librenderdoc.so"
47-
$ find / -type f -name "librenderdoc.so" 2>/dev/null
48-
```
41+
On Windows, if the mod doesn't work for you for some reason (or you are not using Fabric), you can use process injection to hook into the game. Navigate to `Tools`>`Settings` and enable `Enable process injection (restart required)`, then restart the application.
4942

50-
The method for setting the value of the environment variable is launcher dependent. In [Prism Launcher](https://prismlauncher.org/), the option can be found in the `Settings` tab when editing an instance.
43+
You can then select `File`>`Inject into Process`. Start the game, quickly search for `java` in the list, and press `Refresh`. Select the game, and press `Inject`.
5144

5245
:::caution[Warning]
53-
The launcher you are using *must* have permission to access the `librenderdoc.so` file. Applications running in a sandboxed environment like Flatpak do not have general filesystem access by default.
46+
Process injection must happen before Minecraft initialises OpenGL. You need to be quick!
5447
:::
5548

49+
### Without the Mod (Linux)
50+
51+
On Linux, the game must be made to initialise RenderDoc by itself. This can be done by setting the `LD_PRELOAD` environment variable to the path to `librenderdoc.so`. This can commonly be found at `/usr/lib64/renderdoc/librenderdoc.so`, but you can find the exact path with the below command.
52+
5653
## Nsight
5754
[Nsight](https://developer.nvidia.com/nsight-graphics) is an NVIDIA exclusive graphics debugger. It can provide much more detailed performance statistics.
5855

59-
The [Nsight and RenderDoc loader](https://modrinth.com/mod/nsight-loader) mod can be used to inject Nsight into the game.
56+
The [GFX-Debuggers](https://modrinth.com/mod/gfx-debuggers) mod can be used to inject Nsight into the game.
6057

6158
Alternatively, you can launch your launcher of choice from within Nsight by pointing it to the launcher executable, and it should automatically hook into Minecraft.

0 commit comments

Comments
 (0)