Skip to content

Commit 4098f55

Browse files
committed
add debugging info, end flash documentation
1 parent a93302e commit 4098f55

File tree

10 files changed

+150
-44
lines changed

10 files changed

+150
-44
lines changed

package-lock.json

Lines changed: 26 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
68 KB
Loading
38.4 KB
Loading
47.5 KB
Loading

src/content/docs/aperture/migration.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ sidebar:
77
order: 1
88
---
99

10+
:::caution[Warning]
11+
**This guide is currently extremely outdated. Aperture has since moved to Slang.**.
12+
:::
13+
1014
:::note[Note]
1115
This guide is intended for those already familiar with shader development.
1216
:::
1317

14-
:::caution[Warning]
15-
**Aperture is still in early development and not for public use.** Things can and will change, and parts of this section may be incomplete or outright incorrect.
16-
:::
1718

1819
Aperture is a new take on shader packs utilizing TypeScript to create an extensible pipeline.
1920

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Debugging Shaders
3+
description: How to debug your Iris shaderpack.
4+
sidebar:
5+
label: Debugging Shaders
6+
order: 1
7+
---
8+
9+
# Debug Mode
10+
In debug mode, Iris will display any shader compilation errors directly. Debug mode can be enabled by pressing `ctrl`+`D` and restarting the game.
11+
12+
:::caution[Warning]
13+
The 'Use no error context' setting will prevent the game from loading on some AMD drivers if debug mode is enabled. If you recieve a GLFW error when trying to load the game after enabling debug mode, you can disable the setting by editing `.minecraft/config/sodium-otions.json` and setting the value of `use_no_error_g_l_context` to `false`.
14+
:::
15+
16+
# Finding Compilation Errors
17+
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.
18+
19+
![`deferred2.fsh: ERROR: 0:336: 'something' : undeclared identifier`](../../../../assets/debugging/compilationerror.webp)
20+
In this error message, we can see that the error occurs on line 336 of `deferred2.fsh`.
21+
22+
![line 336 says "something = 0;"](../../../../assets/debugging/patchederror.webp)
23+
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.
24+
25+
# Attaching a Debugger
26+
Graphics debuggers are very useful when developing shaders, as they can be used to inspect the state of the GPU at a certain point in the pipeline, and gather detailed performance metrics.
27+
28+
## RenderDoc
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+
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`.
33+
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.
35+
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!
40+
:::
41+
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+
45+
46+
```bash title="Finding librenderdoc.so"
47+
$ find / -type f -name "librenderdoc.so" 2>/dev/null
48+
```
49+
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.
51+
52+
:::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.
54+
:::
55+
56+
## Nsight
57+
[Nsight](https://developer.nvidia.com/nsight-graphics) is an NVIDIA exclusive graphics debugger. It can provide much more detailed performance statistics.
58+
59+
The [Nsight and RenderDoc loader](https://modrinth.com/mod/nsight-loader) mod can be used to inject Nsight into the game.
60+
61+
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.

src/content/docs/current/Reference/Shaders.Properties/features.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,10 @@ Enables or disables weather (rain & snow) geometry and rain splash particles. Bo
129129
This directive requires an Iris version supporting [`CAN_DISABLE_WEATHER`](/current/reference/shadersproperties/flags/), and is recommended to be used with that feature flag specified.
130130

131131
----------------
132+
133+
## endFlashShadows <Badge text="Iris Exclusive" variant="tip" size="medium" />
134+
```properties
135+
endFlashShadows=<true|false>
136+
```
137+
138+
If enabled, shadows in the End will be projected from the End flashes instead of a random point in the sky. [`shadowLightPosition`](/current/reference/uniforms/world/#shadowlightposition) will also be set equal to [`endFlashPosition`](/current/reference/uniforms/world/#endflashposition).

src/content/docs/current/Reference/Shaders.Properties/overview.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,19 @@ Feature flags are an Iris system to query the activation state of certain featur
8787
### Features / Options
8888
| Directive | Description | Tag |
8989
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
90-
| [clouds](/current/reference/shadersproperties/features/#clouds) | Enables or disables vanilla cloud rendering | |
91-
| [moon](/current/reference/shadersproperties/features/#moon) | Enables or disables rendering of the moon texture in `gbuffers_skytextured` | |
90+
| [clouds](/current/reference/shadersproperties/features/#clouds) | Enables or disables vanilla cloud rendering | |
91+
| [moon](/current/reference/shadersproperties/features/#moon) | Enables or disables rendering of the moon texture in `gbuffers_skytextured` | |
9292
| [sun](/current/reference/shadersproperties/feature/#sun) | Enables or disables rendering of the sun texture in `gbuffers_skytextured` | |
93-
| [sky](/current/reference/shadersproperties/features/#sky) | Enables or disables rendering of vanilla sky in `gbuffers_skybasic` | <Badge text="Iris Exclusive" variant="tip"/> |
94-
| [stars](/current/reference/shadersproperties/features/#stars) | Enables or disables rendering of stars in the sky in `gbuffers_skybasic` | <Badge text="Iris Exclusive" variant="tip"/> |
95-
| [underwaterOverlay](/current/reference/shadersproperties/features/#underwateroverlay) | Enables or disables the water texture overlay when the player is underwater | |
96-
| [vignette](/current/reference/shadersproperties/features/#vignette) | Enables or disables rendering of the vignette overlay | |
97-
| [oldHandLight](/current/reference/shadersproperties/features/#oldhandlight) | Sets heldBlockLightValue to use whichever hand's value is higher (for legacy support) | |
98-
| [oldLighting](/current/reference/shadersproperties/features/#oldlighting) | Enables the "old lighting", which applies a lighting multiplier in the color attribute based on the block's orientation | |
99-
| [separateAo](/current/reference/shadersproperties/features/#separateao) | Controls whether vanilla ambient occlusion is stored in the `rgb` or `a` components of the color vertex attribute | |
100-
| [supportsColorCorrection](/current/reference/shadersproperties/features/#supportscolorcorrection) | Allows the shader to perform its own conversion to a different color space | <Badge text="Iris Exclusive" variant="tip"/> |
101-
| [weather](/current/reference/shadersproperties/features/#weather) | Enables or disables weather (rain & snow) geometry and rain splash particles. | <Badge text="Iris Exclusive" variant="tip"/> |
93+
| [sky](/current/reference/shadersproperties/features/#sky) | Enables or disables rendering of vanilla sky in `gbuffers_skybasic` | <Badge text="Iris Exclusive" variant="tip"/> |
94+
| [stars](/current/reference/shadersproperties/features/#stars) | Enables or disables rendering of stars in the sky in `gbuffers_skybasic` | <Badge text="Iris Exclusive" variant="tip"/> |
95+
| [underwaterOverlay](/current/reference/shadersproperties/features/#underwateroverlay) | Enables or disables the water texture overlay when the player is underwater | |
96+
| [vignette](/current/reference/shadersproperties/features/#vignette) | Enables or disables rendering of the vignette overlay | |
97+
| [oldHandLight](/current/reference/shadersproperties/features/#oldhandlight) | Sets heldBlockLightValue to use whichever hand's value is higher (for legacy support) | |
98+
| [oldLighting](/current/reference/shadersproperties/features/#oldlighting) | Enables the "old lighting", which applies a lighting multiplier in the color attribute based on the block's orientation | |
99+
| [separateAo](/current/reference/shadersproperties/features/#separateao) | Controls whether vanilla ambient occlusion is stored in the `rgb` or `a` components of the color vertex attribute | |
100+
| [supportsColorCorrection](/current/reference/shadersproperties/features/#supportscolorcorrection)| Allows the shader to perform its own conversion to a different color space | <Badge text="Iris Exclusive" variant="tip"/> |
101+
| [weather](/current/reference/shadersproperties/features/#weather) | Enables or disables weather (rain & snow) geometry and rain splash particles. | <Badge text="Iris Exclusive" variant="tip"/> |
102+
| [endFlashShadows](/current/reference/shadersproperties/features/#endflashshadows) | Causes shadows to be cast by the current end flash. | <Badge text="Iris Exclusive" variant="tip"/> |
102103

103104

104105
### Rendering

0 commit comments

Comments
 (0)