diff --git a/src/content/docs/reference/Buffers/colortex.mdx b/src/content/docs/reference/Buffers/colortex.mdx index aa62592..74327bc 100644 --- a/src/content/docs/reference/Buffers/colortex.mdx +++ b/src/content/docs/reference/Buffers/colortex.mdx @@ -16,21 +16,21 @@ There are 16 color attachements available through the `colortex0` through `color *Note*: The `final.fsh` program appears to write to `colortex0`, however it actually writes to a display buffer with the resolution of the Minecraft window and `RGBA` format (usually equates to `RGBA8`) regardless of the size or format of `colortex0`. If `colortex0` is set to non-clearing, any output written by `final.fsh` will not impact `colortex0`. #### Writing to ColorTex buffers -Any [`begin`](/reference/programs/begin), [`prepare`](/reference/programs/prepare), [`gbuffers`](/reference/programs/gbuffers), [`deferred`](/reference/programs/deferred), or [`composite`](/reference/programs/composite) program can write to a colortex buffer, the buffers to write to can be selected with the [`RENDERTARGETS`](/reference/directives/constants/rendertargets) or [`DRAWBUFFERS`](/reference/directives/constants/drawbuffers) directive. +Any [`begin`](/reference/programs/begin), [`prepare`](/reference/programs/prepare), [`gbuffers`](/reference/programs/gbuffers), [`deferred`](/reference/programs/deferred), or [`composite`](/reference/programs/composite) program can write to a colortex buffer, the buffers to write to can be selected with the [`RENDERTARGETS`](/reference/constants/rendertargets) or [`DRAWBUFFERS`](/reference/constants/drawbuffers) directive. Additionally, you can read and write to the first 6 colortex buffer in Optifine or any colortex buffer in Iris using `colorimgN` where `N` is replaced with the colortex index. This is the only way to write to colortex buffers from compute shaders, but also works in any program. For more information on image load/store, see the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Image_Load_Store). #### Buffer size -These buffers default to the display resolution, although this can be configured with the [`size.buffer`](/reference/directives/shadersproperties/buffer_size) define in shaders.properties. However, changing the buffer size will prevent any [`gbuffer`](/reference/programs/gbuffers) program from writing to the texture. +These buffers default to the display resolution, although this can be configured with the [`size.buffer`](/reference/shadersproperties/buffer_size) define in shaders.properties. However, changing the buffer size will prevent any [`gbuffer`](/reference/programs/gbuffers) program from writing to the texture. #### Buffer format/precision All buffers default to `RGBA` format (which is `RGBA8` on most systems), but this can be configured as described in the [Texture Formats](/reference/buffers/texture_format) section. #### Buffer clear -By default all buffers clear their values after each frame to solid black (all 0s including alpha), except `colortex0` which clears to the [`fogColor`](/reference/uniforms/general/fogcolor) with 1.0 alpha, and `colortex1` which clears to solid white (all 1s including alpha). This clearing behavior can be configured with the [`colortexNClear`](/reference/directives/constants/buffer_clear) directive, and the clear color can be configured with the [`colortexNClearColor`](/reference/directives/constants/buffer_clear_color) directive. +By default all buffers clear their values after each frame to solid black (all 0s including alpha), except `colortex0` which clears to the [`fogColor`](/reference/uniforms/general/fogcolor) with 1.0 alpha, and `colortex1` which clears to solid white (all 1s including alpha). This clearing behavior can be configured with the [`colortexNClear`](/reference/constants/buffer_clear) directive, and the clear color can be configured with the [`colortexNClearColor`](/reference/constants/buffer_clear_color) directive. #### Ping-Pong buffers -Each colortex sampler actually contains two buffers, which allows you to read and write to the same buffer in a composite/deferred pass. The buffer flipping behavior can be controlled with the [`flip..`](/reference/directives/shadersproperties/buffer_flip) directive. +Each colortex sampler actually contains two buffers, which allows you to read and write to the same buffer in a composite/deferred pass. The buffer flipping behavior can be controlled with the [`flip..`](/reference/shadersproperties/buffer_flip) directive. #### Legacy Aliases The first 8 colortex buffers have legacy aliases, although their names are often confusing and their use is not recommended. Except as noted below, either name can be used interchangably. The names are as follows: diff --git a/src/content/docs/reference/Buffers/noisetex.mdx b/src/content/docs/reference/Buffers/noisetex.mdx index fe8a69e..83884dd 100644 --- a/src/content/docs/reference/Buffers/noisetex.mdx +++ b/src/content/docs/reference/Buffers/noisetex.mdx @@ -8,4 +8,4 @@ sidebar: ### `uniform sampler2D noisetex;` -This buffer stores a generated RGB white noise texture. The resolution of this texture can be configured with the [`noiseTextureResolution`](/reference/directives/constants/noisetextureresolution) constant, and defaults to 256x256. The texture is always square, meaning its width and height are equal. \ No newline at end of file +This buffer stores a generated RGB white noise texture. The resolution of this texture can be configured with the [`noiseTextureResolution`](/reference/constants/noisetextureresolution) constant, and defaults to 256x256. The texture is always square, meaning its width and height are equal. \ No newline at end of file diff --git a/src/content/docs/reference/Buffers/shadowcolor.mdx b/src/content/docs/reference/Buffers/shadowcolor.mdx index adfc053..eda7dc4 100644 --- a/src/content/docs/reference/Buffers/shadowcolor.mdx +++ b/src/content/docs/reference/Buffers/shadowcolor.mdx @@ -14,7 +14,7 @@ import { Aside } from '@astrojs/starlight/components'; The shadow pass supplies two color attachments for outputing color/data, `shadowcolor0` and `shadowcolor1`. These samplers can be read from any program, and can be written to from the fragment stage of the [`shadow`](/reference/programs/shadow) and [`shadowcomp`](/reference/programs/shadow_comp) programs. #### Writing to ShadowColor buffers -Any [`shadow`](/reference/programs/shadow) or [`shadowcomp`](/reference/programs/shadow_comp) program can write to a shadowcolor buffer, the buffers to write to can be selected with the [`RENDERTARGETS`](/reference/directives/constants/rendertargets) or [`DRAWBUFFERS`](/reference/directives/constants/drawbuffers) directive. +Any [`shadow`](/reference/programs/shadow) or [`shadowcomp`](/reference/programs/shadow_comp) program can write to a shadowcolor buffer, the buffers to write to can be selected with the [`RENDERTARGETS`](/reference/constants/rendertargets) or [`DRAWBUFFERS`](/reference/constants/drawbuffers) directive. Additionally, you can read and write to `shadowcolor0` and `shadowcolor1` using the image bindings `shadowcolorimg0` through `shadowcolorimg1` in any program. This is the only way to write to shadowcolor buffers from compute shaders. For more information on image load/store, see the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Image_Load_Store). @@ -25,13 +25,13 @@ These buffers default to the shadow pass resolution, which can be controlled wit These buffers default `RGBA` format (which defaults to `RGBA8` on most systems), but this can be configured as described in the [Texture Formats](/reference/buffers/texture_format) section. #### Buffer clear -By default these buffers clear their values after each frame to solid white (all 1s including alpha) This clearing behavior can be configured with the [`shadowcolorNClear`](/reference/directives/constants/buffer_clear) directive, and the clear color can be configured with the [`shadowcolorNClearColor`](/reference/directives/constants/buffer_clear_color) directive. +By default these buffers clear their values after each frame to solid white (all 1s including alpha) This clearing behavior can be configured with the [`shadowcolorNClear`](/reference/constants/buffer_clear) directive, and the clear color can be configured with the [`shadowcolorNClearColor`](/reference/constants/buffer_clear_color) directive. #### Ping-Pong buffers -Each colortex sampler actually contains two buffers, which allows you to read and write to the same buffer in a composite/deferred pass. The buffer flipping behavior can be controlled with the [`flip..`](/reference/directives/shadersproperties/buffer_flip) directive. +Each colortex sampler actually contains two buffers, which allows you to read and write to the same buffer in a composite/deferred pass. The buffer flipping behavior can be controlled with the [`flip..`](/reference/shadersproperties/buffer_flip) directive. #### Legacy Alias The sampler `shadowcolor0` is also accessible through the legacy `shadowcolor` alias. #### Extended Shadowcolor -The [Feature Flag](/reference/directives/shadersproperties/flags) `HIGHER_SHADOWCOLOR` enables additional shadowcolor buffers, `shadowcolor2` through `shadowcolor7`. These are identical to the other shadowcolor buffers outside of their name. \ No newline at end of file +The [Feature Flag](/reference/shadersproperties/flags) `HIGHER_SHADOWCOLOR` enables additional shadowcolor buffers, `shadowcolor2` through `shadowcolor7`. These are identical to the other shadowcolor buffers outside of their name. \ No newline at end of file diff --git a/src/content/docs/reference/Buffers/shadowtex.mdx b/src/content/docs/reference/Buffers/shadowtex.mdx index 1f74ca6..2c3ed32 100644 --- a/src/content/docs/reference/Buffers/shadowtex.mdx +++ b/src/content/docs/reference/Buffers/shadowtex.mdx @@ -19,9 +19,9 @@ These buffers are written to by [`shadow`](/reference/programs/shadow) program, These buffers only store information in a single channel, the red component. The shadow buffer precision is hardware/driver dependent, however most hardware uses either 24-bit or 32-bit precision. The resolution of the shadow pass can be controlled with the `shadowMapResolution` constant. #### Hardware Sampling -[`shadowHardwareFiltering`](/reference/directives/constants/shadowhardwarefiltering) enables support hardware sampling (depth comparison mode) for hardware shadow filtering. This turns the shadowtex samplers into `sampler2DShadow` samplers, which when sampled take the full xyz coordinates of the shadow position. The passed z coordinate is then compared to the values in the buffer around the xy coordinate, and the result is the weighted average of these comparisons. This produces a filtering effect on the shadow with very little to no performance impact. More information can be found in the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Sampler_Object#Comparison_mode). +[`shadowHardwareFiltering`](/reference/constants/shadowhardwarefiltering) enables support hardware sampling (depth comparison mode) for hardware shadow filtering. This turns the shadowtex samplers into `sampler2DShadow` samplers, which when sampled take the full xyz coordinates of the shadow position. The passed z coordinate is then compared to the values in the buffer around the xy coordinate, and the result is the weighted average of these comparisons. This produces a filtering effect on the shadow with very little to no performance impact. More information can be found in the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Sampler_Object#Comparison_mode). -When hardware sampling is used, the texture read no longer returns the distance stored in the buffer, but the result of a filtering depth comparison. This prevents its use in algorithms such as PCSS that rely on the actual value stored in the buffer. However Iris enables the use of separate buffers for hardware sampling, `shadowtex0HW` and `shadowtex1HW`, while retaining the original functionality on the base shadowtex buffers. This requires the [`SEPARATE_HARDWARE_SAMPLERS`](/reference/directives/shadersproperties/flags) feature flag as well as setting [`shadowHardwareFiltering`](/reference/directives/constants/shadowhardwarefiltering) to true. +When hardware sampling is used, the texture read no longer returns the distance stored in the buffer, but the result of a filtering depth comparison. This prevents its use in algorithms such as PCSS that rely on the actual value stored in the buffer. However Iris enables the use of separate buffers for hardware sampling, `shadowtex0HW` and `shadowtex1HW`, while retaining the original functionality on the base shadowtex buffers. This requires the [`SEPARATE_HARDWARE_SAMPLERS`](/reference/shadersproperties/flags) feature flag as well as setting [`shadowHardwareFiltering`](/reference/constants/shadowhardwarefiltering) to true. #### Legacy Aliases The alias `waterShadow` points to the same buffer as `shadowtex0`. If `waterShadow` is present anywhere in the code, then the alias `shadow` will point to the same buffer as `shadowtex1`, otherwise it will point to the buffer `shadowtex0`. \ No newline at end of file diff --git a/src/content/docs/reference/Buffers/texture_format.mdx b/src/content/docs/reference/Buffers/texture_format.mdx index bd630bb..8a4a4c3 100644 --- a/src/content/docs/reference/Buffers/texture_format.mdx +++ b/src/content/docs/reference/Buffers/texture_format.mdx @@ -10,7 +10,7 @@ import { Aside } from '@astrojs/starlight/components'; Color attachments, such as [colortex](/reference/buffers/colortex) and [shadowcolor](/reference/buffers/shadowcolor) buffers, store values in a specific format. The default format is `RGBA` (which equates to `RGBA8` on most systems), however a shader pack can specify the format and precision of each color attachment. -The format for any color attachement can be set using the [\Format](/reference/directives/constants/buffer_format) directive. +The format for any color attachement can be set using the [\Format](/reference/constants/buffer_format) directive. The available texture formats and their meanings are described below: diff --git a/src/content/docs/reference/Directives/Constants/ambientOcclusionLevel.mdx b/src/content/docs/reference/Constants/ambientOcclusionLevel.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/ambientOcclusionLevel.mdx rename to src/content/docs/reference/Constants/ambientOcclusionLevel.mdx diff --git a/src/content/docs/reference/Directives/Constants/buffer_clear.mdx b/src/content/docs/reference/Constants/buffer_clear.mdx similarity index 91% rename from src/content/docs/reference/Directives/Constants/buffer_clear.mdx rename to src/content/docs/reference/Constants/buffer_clear.mdx index 3f73ceb..1b23439 100644 --- a/src/content/docs/reference/Directives/Constants/buffer_clear.mdx +++ b/src/content/docs/reference/Constants/buffer_clear.mdx @@ -10,7 +10,7 @@ sidebar: #### Location: any glsl shader file -This Clear directive allows a shader pack to disable clearing for a [colortex](/reference/buffers/colortex) or [shadowcolor](/reference/buffers/shadowcolor) color attachment. This means that the values written to the texture will be retained through the next frame instead of being cleared after every frame. The value the buffer is cleared to is controlled by the [`ClearColor`](/reference/directives/constants/buffer_clear_color) directive. +This Clear directive allows a shader pack to disable clearing for a [colortex](/reference/buffers/colortex) or [shadowcolor](/reference/buffers/shadowcolor) color attachment. This means that the values written to the texture will be retained through the next frame instead of being cleared after every frame. The value the buffer is cleared to is controlled by the [`ClearColor`](/reference/constants/buffer_clear_color) directive. Replace `` with the name of a sampler (e.g. `colortex2` or `shadowcolor0`). diff --git a/src/content/docs/reference/Directives/Constants/buffer_clear_color.mdx b/src/content/docs/reference/Constants/buffer_clear_color.mdx similarity index 94% rename from src/content/docs/reference/Directives/Constants/buffer_clear_color.mdx rename to src/content/docs/reference/Constants/buffer_clear_color.mdx index a730ebd..d69eeba 100644 --- a/src/content/docs/reference/Directives/Constants/buffer_clear_color.mdx +++ b/src/content/docs/reference/Constants/buffer_clear_color.mdx @@ -10,7 +10,7 @@ sidebar: #### Location: any glsl shader file -The ClearColor directive is used when clearing is enabled, and it defines the value stored in a [colortex](/reference/buffers/colortex) or [shadowcolor](/reference/buffers/shadowcolor) buffer after the clear operation (see [buffer clear](/reference/directives/constants/buffer_clear)). +The ClearColor directive is used when clearing is enabled, and it defines the value stored in a [colortex](/reference/buffers/colortex) or [shadowcolor](/reference/buffers/shadowcolor) buffer after the clear operation (see [buffer clear](/reference/constants/buffer_clear)). Replace `` with the name of a sampler (e.g. `colortex2` or `shadowcolor0`). diff --git a/src/content/docs/reference/Directives/Constants/buffer_format.mdx b/src/content/docs/reference/Constants/buffer_format.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/buffer_format.mdx rename to src/content/docs/reference/Constants/buffer_format.mdx diff --git a/src/content/docs/reference/Directives/Constants/centerDepthHalflife.mdx b/src/content/docs/reference/Constants/centerDepthHalflife.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/centerDepthHalflife.mdx rename to src/content/docs/reference/Constants/centerDepthHalflife.mdx diff --git a/src/content/docs/reference/Directives/Constants/colortex_mipmaps.mdx b/src/content/docs/reference/Constants/colortex_mipmaps.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/colortex_mipmaps.mdx rename to src/content/docs/reference/Constants/colortex_mipmaps.mdx diff --git a/src/content/docs/reference/Directives/Constants/drawbuffers.mdx b/src/content/docs/reference/Constants/drawbuffers.mdx similarity index 53% rename from src/content/docs/reference/Directives/Constants/drawbuffers.mdx rename to src/content/docs/reference/Constants/drawbuffers.mdx index d258564..6c3a706 100644 --- a/src/content/docs/reference/Directives/Constants/drawbuffers.mdx +++ b/src/content/docs/reference/Constants/drawbuffers.mdx @@ -10,8 +10,8 @@ sidebar: #### Location: any fragment stage (.fsh) of any program -The legacy version of the [`RENDERTARGETS`](/reference/directives/constants/rendertargets) directive. This directive can only reference indicies 0 through 9, so `colortex10` through `colortex15` cannot be bound with this directive. Because of this, it is recommended to use [`RENDERTARGETS`](/reference/directives/constants/rendertargets) directive instead as that can access all available buffers. +The legacy version of the [`RENDERTARGETS`](/reference/constants/rendertargets) directive. This directive can only reference indicies 0 through 9, so `colortex10` through `colortex15` cannot be bound with this directive. Because of this, it is recommended to use [`RENDERTARGETS`](/reference/constants/rendertargets) directive instead as that can access all available buffers. To use this directive replace `XYZ` with the sequence of indices of color attachments. For example, putting `/* DRAWBUFFERS:0178 */` in `composite.fsh` would configure that program to write to `colortex0`, `colortex1`, `colortex7`, and `colortex8`. The comment can be placed anywhere in the `.fsh` file. -More information on how this buffer applies to outputing values is in the [`RENDERTARGETS`](/reference/directives/constants/rendertargets) section. \ No newline at end of file +More information on how this buffer applies to outputing values is in the [`RENDERTARGETS`](/reference/constants/rendertargets) section. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/drynessHalflife.mdx b/src/content/docs/reference/Constants/drynessHalflife.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/drynessHalflife.mdx rename to src/content/docs/reference/Constants/drynessHalflife.mdx diff --git a/src/content/docs/reference/Directives/Constants/entityShadowDistanceMul.mdx b/src/content/docs/reference/Constants/entityShadowDistanceMul.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/entityShadowDistanceMul.mdx rename to src/content/docs/reference/Constants/entityShadowDistanceMul.mdx diff --git a/src/content/docs/reference/Directives/Constants/eyeBrightnessHalflife.mdx b/src/content/docs/reference/Constants/eyeBrightnessHalflife.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/eyeBrightnessHalflife.mdx rename to src/content/docs/reference/Constants/eyeBrightnessHalflife.mdx diff --git a/src/content/docs/reference/Directives/Constants/noiseTextureResolution.mdx b/src/content/docs/reference/Constants/noiseTextureResolution.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/noiseTextureResolution.mdx rename to src/content/docs/reference/Constants/noiseTextureResolution.mdx diff --git a/src/content/docs/reference/Directives/Constants/rendertargets.mdx b/src/content/docs/reference/Constants/rendertargets.mdx similarity index 91% rename from src/content/docs/reference/Directives/Constants/rendertargets.mdx rename to src/content/docs/reference/Constants/rendertargets.mdx index f0cc83f..b43d74c 100644 --- a/src/content/docs/reference/Directives/Constants/rendertargets.mdx +++ b/src/content/docs/reference/Constants/rendertargets.mdx @@ -10,7 +10,7 @@ sidebar: #### Location: any fragment stage (.fsh) of any program -This directive is used to configure which color attachments a fragment program outputs to. Replace `X,Y,Z` with the comma separated list of indices of color attachments. For example, putting `/* RENDERTARGETS: 0,3,7,13 */` in `composite.fsh` would configure that program to write to `colortex0`, `colortex3`, `colortex7`, and `colortex13`. The comment can be placed anywhere in the `.fsh` file. If the directive (or the [`DRAWBUFFERS`](/reference/directives/constants/drawbuffers) directive) is not found in the file, the first 8 buffers will be bound. +This directive is used to configure which color attachments a fragment program outputs to. Replace `X,Y,Z` with the comma separated list of indices of color attachments. For example, putting `/* RENDERTARGETS: 0,3,7,13 */` in `composite.fsh` would configure that program to write to `colortex0`, `colortex3`, `colortex7`, and `colortex13`. The comment can be placed anywhere in the `.fsh` file. If the directive (or the [`DRAWBUFFERS`](/reference/constants/drawbuffers) directive) is not found in the file, the first 8 buffers will be bound. **Note**: This directive must include the multi-line comments and should be on its own line. diff --git a/src/content/docs/reference/Directives/Constants/shadowDistance.mdx b/src/content/docs/reference/Constants/shadowDistance.mdx similarity index 75% rename from src/content/docs/reference/Directives/Constants/shadowDistance.mdx rename to src/content/docs/reference/Constants/shadowDistance.mdx index 504d104..a1b9225 100644 --- a/src/content/docs/reference/Directives/Constants/shadowDistance.mdx +++ b/src/content/docs/reference/Constants/shadowDistance.mdx @@ -12,4 +12,4 @@ sidebar: Sets the radius of the [shadow pass](/reference/programs/shadow) in blocks. The default value is 160 blocks. -By default this does not cull geometry outside that distance, only applying a scaling factor to the shadow projection matrix. However setting [`shadowDistanceRenderMul`](/reference/directives/constants/shadowdistancerendermul) to a positive value will apply culling. \ No newline at end of file +By default this does not cull geometry outside that distance, only applying a scaling factor to the shadow projection matrix. However setting [`shadowDistanceRenderMul`](/reference/constants/shadowdistancerendermul) to a positive value will apply culling. \ No newline at end of file diff --git a/src/content/docs/reference/Constants/shadowDistanceRenderMul.mdx b/src/content/docs/reference/Constants/shadowDistanceRenderMul.mdx new file mode 100644 index 0000000..f4155a3 --- /dev/null +++ b/src/content/docs/reference/Constants/shadowDistanceRenderMul.mdx @@ -0,0 +1,15 @@ +--- +title: shadowDistanceRenderMul +description: shadowDistanceRenderMul +sidebar: + label: shadowDistanceRenderMul + order: 3 +--- + +### `const float shadowDistanceRenderMul = -1.0;` + +#### Location: any glsl file + +Sets the culling distance multiplier for the [shadow pass](/reference/programs/shadow). + +By default this value is `-1`, which means geometry outside the [`shadowDistance`](/reference/constants/shadowdistance) are not culled. Setting this to a positive value applies culling to geometry outside `shadowDistance * shadowDistanceRenderMul` blocks from the camera. For example, `1.0` culls outside [`shadowDistance`](/reference/constants/shadowdistance), `0.5` culls outside half of [`shadowDistance`](/reference/constants/shadowdistance), and `2.0` culls outside twice [`shadowDistance`](/reference/constants/shadowdistance). `shadowDistanceRenderMul` has no effect on the scale of geometry in the [shadow pass](/reference/programs/shadow). \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowHardwareFiltering.mdx b/src/content/docs/reference/Constants/shadowHardwareFiltering.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/shadowHardwareFiltering.mdx rename to src/content/docs/reference/Constants/shadowHardwareFiltering.mdx diff --git a/src/content/docs/reference/Directives/Constants/shadowIntervalSize.mdx b/src/content/docs/reference/Constants/shadowIntervalSize.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/shadowIntervalSize.mdx rename to src/content/docs/reference/Constants/shadowIntervalSize.mdx diff --git a/src/content/docs/reference/Directives/Constants/shadowMapFov.mdx b/src/content/docs/reference/Constants/shadowMapFov.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/shadowMapFov.mdx rename to src/content/docs/reference/Constants/shadowMapFov.mdx diff --git a/src/content/docs/reference/Directives/Constants/shadowMapResolution.mdx b/src/content/docs/reference/Constants/shadowMapResolution.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/shadowMapResolution.mdx rename to src/content/docs/reference/Constants/shadowMapResolution.mdx diff --git a/src/content/docs/reference/Directives/Constants/shadow_mipmaps.mdx b/src/content/docs/reference/Constants/shadow_mipmaps.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/shadow_mipmaps.mdx rename to src/content/docs/reference/Constants/shadow_mipmaps.mdx diff --git a/src/content/docs/reference/Directives/Constants/sunPathRotation.mdx b/src/content/docs/reference/Constants/sunPathRotation.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/sunPathRotation.mdx rename to src/content/docs/reference/Constants/sunPathRotation.mdx diff --git a/src/content/docs/reference/Constants/voxelDistance.mdx b/src/content/docs/reference/Constants/voxelDistance.mdx new file mode 100644 index 0000000..f151392 --- /dev/null +++ b/src/content/docs/reference/Constants/voxelDistance.mdx @@ -0,0 +1,18 @@ +--- +title: voxelDistance +description: voxelDistance +sidebar: + label: voxelDistance + order: 3 + badge: + text: Iris Only + variant: tip +--- + +### `const float voxelDistance = 160.0;` + +#### Location: composite, deferred, final, prepare + +Setting [`shadow.culling = reversed`](/reference/shadersproperties/shadow_culling) in shaders.properties will create an area around the player where geometry in the shadow pass will not be culled. Outside this area, geometry will be culled as if shadow culling was enabled. This "unculled" distance is controled with `const float voxelDistance`, and the culled distance is controlled as normal with `const float shadowDistance` (and cannot be lower than `voxelDistance`). This feature is intended for packs which utilize both voxelization and a shadow map. + +It is also recommended (but not required) to use the feature flag [`REVERSED_CULLING`](/reference/shadersproperties/flags) to avoid compatibility issues with older Iris versions. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/wetnessHalflife.mdx b/src/content/docs/reference/Constants/wetnessHalflife.mdx similarity index 100% rename from src/content/docs/reference/Directives/Constants/wetnessHalflife.mdx rename to src/content/docs/reference/Constants/wetnessHalflife.mdx diff --git a/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx b/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx deleted file mode 100644 index d51d17f..0000000 --- a/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: shadowDistanceRenderMul -description: shadowDistanceRenderMul -sidebar: - label: shadowDistanceRenderMul - order: 3 ---- - -### `const float shadowDistanceRenderMul = -1.0;` - -#### Location: any glsl file - -Sets the culling distance multiplier for the [shadow pass](/reference/programs/shadow). - -By default this value is `-1`, which means geometry outside the [`shadowDistance`](/reference/directives/constants/shadowdistance) are not culled. Setting this to a positive value applies culling to geometry outside `shadowDistance * shadowDistanceRenderMul` blocks from the camera. For example, `1.0` culls outside [`shadowDistance`](/reference/directives/constants/shadowdistance), `0.5` culls outside half of [`shadowDistance`](/reference/directives/constants/shadowdistance), and `2.0` culls outside twice [`shadowDistance`](/reference/directives/constants/shadowdistance). `shadowDistanceRenderMul` has no effect on the scale of geometry in the [shadow pass](/reference/programs/shadow). \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/voxelDistance.mdx b/src/content/docs/reference/Directives/Constants/voxelDistance.mdx deleted file mode 100644 index a5653b2..0000000 --- a/src/content/docs/reference/Directives/Constants/voxelDistance.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: voxelDistance -description: voxelDistance -sidebar: - label: voxelDistance - order: 3 - badge: - text: Iris Only - variant: tip ---- - -### `const float voxelDistance = 160.0;` - -#### Location: composite, deferred, final, prepare - -Setting [`shadow.culling = reversed`](/reference/directives/shadersproperties/shadow_culling) in shaders.properties will create an area around the player where geometry in the shadow pass will not be culled. Outside this area, geometry will be culled as if shadow culling was enabled. This "unculled" distance is controled with `const float voxelDistance`, and the culled distance is controlled as normal with `const float shadowDistance` (and cannot be lower than `voxelDistance`). This feature is intended for packs which utilize both voxelization and a shadow map. - -It is also recommended (but not required) to use the feature flag [`REVERSED_CULLING`](/reference/directives/shadersproperties/flags) to avoid compatibility issues with older Iris versions. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Shaders.Properties/particles_before_deferred.mdx b/src/content/docs/reference/Directives/Shaders.Properties/particles_before_deferred.mdx deleted file mode 100644 index df3c010..0000000 --- a/src/content/docs/reference/Directives/Shaders.Properties/particles_before_deferred.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: particles.before.deferred -description: particles.before.deferred -sidebar: - label: particles.before.deferred - order: 1 ---- - -### `particles.before.deferred=` - -#### Location: shaders.properties - -The legacy version of [`particles.ordering`](/reference/directives/shadersproperties/particles_ordering) which is supported by Optifine. If set to `true` all particles will be rendered before the deferred pass, otherwise particles will be rendered after the deferred pass. This ordering is overwritten by [`particles.ordering`](/reference/directives/shadersproperties/particles_ordering) by Iris if both are present. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Shaders.Properties/alphaTest.mdx b/src/content/docs/reference/Shaders.Properties/alphaTest.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/alphaTest.mdx rename to src/content/docs/reference/Shaders.Properties/alphaTest.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/backFace.mdx b/src/content/docs/reference/Shaders.Properties/backFace.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/backFace.mdx rename to src/content/docs/reference/Shaders.Properties/backFace.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/beacon_beam_depth.mdx b/src/content/docs/reference/Shaders.Properties/beacon_beam_depth.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/beacon_beam_depth.mdx rename to src/content/docs/reference/Shaders.Properties/beacon_beam_depth.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/blend.mdx b/src/content/docs/reference/Shaders.Properties/blend.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/blend.mdx rename to src/content/docs/reference/Shaders.Properties/blend.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/buffer_flip.mdx b/src/content/docs/reference/Shaders.Properties/buffer_flip.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/buffer_flip.mdx rename to src/content/docs/reference/Shaders.Properties/buffer_flip.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/buffer_size.mdx b/src/content/docs/reference/Shaders.Properties/buffer_size.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/buffer_size.mdx rename to src/content/docs/reference/Shaders.Properties/buffer_size.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/clouds.mdx b/src/content/docs/reference/Shaders.Properties/clouds.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/clouds.mdx rename to src/content/docs/reference/Shaders.Properties/clouds.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/flags.mdx b/src/content/docs/reference/Shaders.Properties/flags.mdx similarity index 96% rename from src/content/docs/reference/Directives/Shaders.Properties/flags.mdx rename to src/content/docs/reference/Shaders.Properties/flags.mdx index 42c9691..7355105 100644 --- a/src/content/docs/reference/Directives/Shaders.Properties/flags.mdx +++ b/src/content/docs/reference/Shaders.Properties/flags.mdx @@ -35,6 +35,6 @@ The following are currently valid options: `HIGHER_SHADOWCOLOR` (required for [Extended Shadowcolor](/reference/buffers/shadowcolor)) -`REVERSED_CULLING` (recommended, but not required for [Reverse Shadow Culling](/reference/directives/constants/voxeldistance)) +`REVERSED_CULLING` (recommended, but not required for [Reverse Shadow Culling](/reference/constants/voxeldistance)) `BLOCK_EMISSION_ATTRIBUTE` (recommended, but not required for [Block Emission: at_midBlock.w] as of [iris-1.7.0-snapshotmc1.20.4-a787322]) \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Shaders.Properties/frustum_culling.mdx b/src/content/docs/reference/Shaders.Properties/frustum_culling.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/frustum_culling.mdx rename to src/content/docs/reference/Shaders.Properties/frustum_culling.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/moon.mdx b/src/content/docs/reference/Shaders.Properties/moon.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/moon.mdx rename to src/content/docs/reference/Shaders.Properties/moon.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/oldHandLight.mdx b/src/content/docs/reference/Shaders.Properties/oldHandLight.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/oldHandLight.mdx rename to src/content/docs/reference/Shaders.Properties/oldHandLight.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/oldLighting.mdx b/src/content/docs/reference/Shaders.Properties/oldLighting.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/oldLighting.mdx rename to src/content/docs/reference/Shaders.Properties/oldLighting.mdx diff --git a/src/content/docs/reference/Shaders.Properties/particles_before_deferred.mdx b/src/content/docs/reference/Shaders.Properties/particles_before_deferred.mdx new file mode 100644 index 0000000..48375da --- /dev/null +++ b/src/content/docs/reference/Shaders.Properties/particles_before_deferred.mdx @@ -0,0 +1,13 @@ +--- +title: particles.before.deferred +description: particles.before.deferred +sidebar: + label: particles.before.deferred + order: 1 +--- + +### `particles.before.deferred=` + +#### Location: shaders.properties + +The legacy version of [`particles.ordering`](/reference/shadersproperties/particles_ordering) which is supported by Optifine. If set to `true` all particles will be rendered before the deferred pass, otherwise particles will be rendered after the deferred pass. This ordering is overwritten by [`particles.ordering`](/reference/shadersproperties/particles_ordering) by Iris if both are present. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Shaders.Properties/particles_ordering.mdx b/src/content/docs/reference/Shaders.Properties/particles_ordering.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/particles_ordering.mdx rename to src/content/docs/reference/Shaders.Properties/particles_ordering.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/program_enabled.mdx b/src/content/docs/reference/Shaders.Properties/program_enabled.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/program_enabled.mdx rename to src/content/docs/reference/Shaders.Properties/program_enabled.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/rain_depth.mdx b/src/content/docs/reference/Shaders.Properties/rain_depth.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/rain_depth.mdx rename to src/content/docs/reference/Shaders.Properties/rain_depth.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/scale.mdx b/src/content/docs/reference/Shaders.Properties/scale.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/scale.mdx rename to src/content/docs/reference/Shaders.Properties/scale.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/separateAo.mdx b/src/content/docs/reference/Shaders.Properties/separateAo.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/separateAo.mdx rename to src/content/docs/reference/Shaders.Properties/separateAo.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/separateEntityDraws.mdx b/src/content/docs/reference/Shaders.Properties/separateEntityDraws.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/separateEntityDraws.mdx rename to src/content/docs/reference/Shaders.Properties/separateEntityDraws.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadowBlockEntities.mdx b/src/content/docs/reference/Shaders.Properties/shadowBlockEntities.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadowBlockEntities.mdx rename to src/content/docs/reference/Shaders.Properties/shadowBlockEntities.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadowEntities.mdx b/src/content/docs/reference/Shaders.Properties/shadowEntities.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadowEntities.mdx rename to src/content/docs/reference/Shaders.Properties/shadowEntities.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadowPlayer.mdx b/src/content/docs/reference/Shaders.Properties/shadowPlayer.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadowPlayer.mdx rename to src/content/docs/reference/Shaders.Properties/shadowPlayer.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadowTerrain.mdx b/src/content/docs/reference/Shaders.Properties/shadowTerrain.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadowTerrain.mdx rename to src/content/docs/reference/Shaders.Properties/shadowTerrain.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadowTranslucent.mdx b/src/content/docs/reference/Shaders.Properties/shadowTranslucent.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadowTranslucent.mdx rename to src/content/docs/reference/Shaders.Properties/shadowTranslucent.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadow_culling.mdx b/src/content/docs/reference/Shaders.Properties/shadow_culling.mdx similarity index 65% rename from src/content/docs/reference/Directives/Shaders.Properties/shadow_culling.mdx rename to src/content/docs/reference/Shaders.Properties/shadow_culling.mdx index 4507746..87fbfd7 100644 --- a/src/content/docs/reference/Directives/Shaders.Properties/shadow_culling.mdx +++ b/src/content/docs/reference/Shaders.Properties/shadow_culling.mdx @@ -12,4 +12,4 @@ sidebar: Controls culling in the [`shadow`](/reference/programs/shadow) pass. Enabling it will prevent geometry which would not cast a shadow through the view frustum from rendering. Disabling it will prevent any geometry within the shadow distance from being culled. -Iris adds an additional option, `reversed`, which disables culling within a specific radius of the player as defined in [`voxelDistance`](/reference/directives/constants/voxeldistance), while retaining culling outside of that distance. It is also recommended (but not required) to use the feature flag [`REVERSED_CULLING`](/reference/directives/shadersproperties/flags) to avoid compatibility issues with older Iris versions. \ No newline at end of file +Iris adds an additional option, `reversed`, which disables culling within a specific radius of the player as defined in [`voxelDistance`](/reference/constants/voxeldistance), while retaining culling outside of that distance. It is also recommended (but not required) to use the feature flag [`REVERSED_CULLING`](/reference/shadersproperties/flags) to avoid compatibility issues with older Iris versions. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Shaders.Properties/shadow_enabled.mdx b/src/content/docs/reference/Shaders.Properties/shadow_enabled.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/shadow_enabled.mdx rename to src/content/docs/reference/Shaders.Properties/shadow_enabled.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/sun.mdx b/src/content/docs/reference/Shaders.Properties/sun.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/sun.mdx rename to src/content/docs/reference/Shaders.Properties/sun.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/supportsColorCorrection.mdx b/src/content/docs/reference/Shaders.Properties/supportsColorCorrection.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/supportsColorCorrection.mdx rename to src/content/docs/reference/Shaders.Properties/supportsColorCorrection.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/underwaterOverlay.mdx b/src/content/docs/reference/Shaders.Properties/underwaterOverlay.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/underwaterOverlay.mdx rename to src/content/docs/reference/Shaders.Properties/underwaterOverlay.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/vignette.mdx b/src/content/docs/reference/Shaders.Properties/vignette.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/vignette.mdx rename to src/content/docs/reference/Shaders.Properties/vignette.mdx diff --git a/src/content/docs/reference/Directives/Shaders.Properties/voxelizeLightBlocks.mdx b/src/content/docs/reference/Shaders.Properties/voxelizeLightBlocks.mdx similarity index 100% rename from src/content/docs/reference/Directives/Shaders.Properties/voxelizeLightBlocks.mdx rename to src/content/docs/reference/Shaders.Properties/voxelizeLightBlocks.mdx diff --git a/src/content/docs/reference/Uniforms/General/alphaTestRef.mdx b/src/content/docs/reference/Uniforms/General/alphaTestRef.mdx index 01b6ffe..5ca547d 100644 --- a/src/content/docs/reference/Uniforms/General/alphaTestRef.mdx +++ b/src/content/docs/reference/Uniforms/General/alphaTestRef.mdx @@ -12,7 +12,7 @@ import { Aside } from '@astrojs/starlight/components'; ### `uniform float alphaTestRef;` -This value stores the alpha value that Iris recommends you discard pixels bellow. This value is commonly `0.1`, but can change in certain cases (therefore it is recommended to use the uniform over a hardcoded value). The value is also affected by the [`alphaTest`](/reference/directives/shadersproperties/alphatest) directive. It is normally used like this: +This value stores the alpha value that Iris recommends you discard pixels bellow. This value is commonly `0.1`, but can change in certain cases (therefore it is recommended to use the uniform over a hardcoded value). The value is also affected by the [`alphaTest`](/reference/shadersproperties/alphatest) directive. It is normally used like this: ```glsl if (albedoOut.a < alphaTestRef) discard; ``` \ No newline at end of file diff --git a/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx b/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx index 2f77653..5407053 100644 --- a/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx +++ b/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx @@ -8,4 +8,4 @@ sidebar: ### `uniform float centerDepthSmooth;` -This uniform stores the value in the depth buffer `depthtex0` at the center of the screen, smoothed over time. The speed of the smoothing can be controlled with [`centerDepthHalflife`](/reference/directives/constants/centerdepthhalflife). \ No newline at end of file +This uniform stores the value in the depth buffer `depthtex0` at the center of the screen, smoothed over time. The speed of the smoothing can be controlled with [`centerDepthHalflife`](/reference/constants/centerdepthhalflife). \ No newline at end of file diff --git a/src/content/docs/reference/Uniforms/General/heldBlockLightValue.mdx b/src/content/docs/reference/Uniforms/General/heldBlockLightValue.mdx index dcda30a..3e24770 100644 --- a/src/content/docs/reference/Uniforms/General/heldBlockLightValue.mdx +++ b/src/content/docs/reference/Uniforms/General/heldBlockLightValue.mdx @@ -9,4 +9,4 @@ sidebar: ### `uniform int heldBlockLightValue;` The light strength of the item held in the player's hand. This ranges from `0`-`15` for vanilla blocks, however some modded blocks may have a higher value. -**Note:** if [`oldHandLight`](/reference/directives/shadersproperties/oldhandlight) is not set to `false`, `heldBlockLightValue` will take its value from the hand with the highest light value for legacy support. \ No newline at end of file +**Note:** if [`oldHandLight`](/reference/shadersproperties/oldhandlight) is not set to `false`, `heldBlockLightValue` will take its value from the hand with the highest light value for legacy support. \ No newline at end of file diff --git a/src/content/docs/reference/Uniforms/General/wetness.mdx b/src/content/docs/reference/Uniforms/General/wetness.mdx index 2d0c55c..a9fdd1c 100644 --- a/src/content/docs/reference/Uniforms/General/wetness.mdx +++ b/src/content/docs/reference/Uniforms/General/wetness.mdx @@ -9,6 +9,6 @@ sidebar: ### `uniform float wetness;` This uniform outputs the current strength of rain and is non-zero when there is currently a rain storm (e.g. weather set rain). The value ranges between `0` to `1` where `0` means no rain and `1` means rain storm, the value is interpolated between those values during transitions in weather. -The transition is significantly slower, and can be controlled with [`wetnessHalfLife`](/reference/directives/constants/wetnesshalflife). +The transition is significantly slower, and can be controlled with [`wetnessHalfLife`](/reference/constants/wetnesshalflife). See also - [`rainStrength`](/reference/uniforms/general/rainstrength) \ No newline at end of file diff --git a/src/content/docs/reference/overview.mdx b/src/content/docs/reference/overview.mdx index 02b7fa8..170cf5e 100644 --- a/src/content/docs/reference/overview.mdx +++ b/src/content/docs/reference/overview.mdx @@ -22,5 +22,5 @@ There on the left, look in the nav bar! \ No newline at end of file