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: src/content/docs/current/Guides/Your First Shaderpack/2_gbuffers.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ In the previous tutorial, we had a variable called `texcoord`, which gave us the
60
60
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`.
61
61
62
62
```glsl
63
-
lmcoord / (30.0 / 32.0) - (1.0 / 32.0);
63
+
lmcoord = lmcoord / (30.0 / 32.0) - (1.0 / 32.0);
64
64
```
65
65
66
66
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.
Copy file name to clipboardExpand all lines: src/content/docs/current/Reference/Miscellaneous/debugging_shaders.mdx
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,34 +28,31 @@ Graphics debuggers are very useful when developing shaders, as they can be used
28
28
## RenderDoc
29
29
[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.
30
30
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
33
32
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`.
35
34
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.
40
37
:::
41
38
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)
45
40
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.
49
42
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`.
51
44
52
45
:::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!
54
47
:::
55
48
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
+
56
53
## Nsight
57
54
[Nsight](https://developer.nvidia.com/nsight-graphics) is an NVIDIA exclusive graphics debugger. It can provide much more detailed performance statistics.
58
55
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.
60
57
61
58
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