Skip to content

Commit 01be3c7

Browse files
committed
texture filtering and chunk fade
1 parent 2f5df2e commit 01be3c7

File tree

4 files changed

+75
-30
lines changed

4 files changed

+75
-30
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: mc_chunkFade
3+
description: The fade-in progress of the geometry
4+
sidebar:
5+
label: mc_chunkFade
6+
order: 2
7+
badge:
8+
text: Iris Only
9+
variant: tip
10+
---
11+
12+
import { Badge } from '@astrojs/starlight/components';
13+
14+
### `mc_chunkFade` <Badge text="Iris Exclusive" variant="tip" size="medium" />
15+
16+
**Valid Programs**: `gbuffers_*.vsh`
17+
18+
---
19+
20+
The fade-in progress of the geometry. This value is a `float` automatically declared in all gbuffers programs which represents the progress of the chunk fade animation introduced in Minecraft version 1.21.11.
21+
22+
In `gbuffers_terrain.vsh`, the value will be a float in the range 0-1. In all other gbuffers programs, it will be declared as `const float mc_chunkFade = -1.0;`.
23+
24+
The variable will only be declared if the `FADE_VARIABLE` [feature flag](/current/reference/shadersproperties/flags/) is available and enabled.

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ Then you could check for this with
3131

3232
The following is an index of all supported feature flags. Any feature flag marked as "**Required For Use**" must be set in `iris.features.required` or `iris.features.optional` in order to use the feature, otherwise Iris will throw an error.
3333

34-
| Feature Flag | Required For Use | Description |
35-
| ---------------------------------------------- | :--------------: | -------------------------------------------------------------------------------------------------------------------- |
36-
| `BLOCK_EMISSION_ATTRIBUTE` || Queries support for the [block emission attribute](/current/reference/attributes/at_midblock/) (`at_midBlock.w`) |
37-
| `CAN_DISABLE_WEATHER` || Queries support for the [`weather`](/current/reference/shadersproperties/features/#weather) directive |
38-
| `COMPUTE_SHADERS` || Queries support for compute shaders |
39-
| `CUSTOM_IMAGES` | ✔️ | Enables [custom images](/current/reference/buffers/custom_images/) |
40-
| `ENTITY_TRANSLUCENT` || Queries support for [`gbuffers_entities_translucent`](/current/reference/programs/gbuffers#iris-additional-programs) |
41-
| `HIGHER_SHADOWCOLOR` | ✔️ | Enables [additional shadowcolor](/current/reference/buffers/shadowcolor/#extended-shadowcolor) buffers |
42-
| `PER_BUFFER_BLENDING` || Queries hardware support for per-buffer blending |
43-
| `REVERSED_CULLING` || Queries support for [reverse shadow culling](/current/reference/constants/voxeldistance/) |
44-
| `SEPARATE_HARDWARE_SAMPLERS` | ✔️ | Enables [separate hardware shadow samplers](/current/reference/buffers/shadowtex/#hardware-sampling) |
45-
| `SSBO` | ✔️ | Enables [SSBOs](/current/reference/buffers/ssbo/) |
46-
| `TESSELATION_SHADERS` / `TESSELLATION_SHADERS` | ✔️ | Enables tessellation shaders |
34+
| Feature Flag | Required For Use | Description |
35+
| ---------------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
36+
| `BLOCK_EMISSION_ATTRIBUTE` || Queries support for the [block emission attribute](/current/reference/attributes/at_midblock/) (`at_midBlock.w`) |
37+
| `CAN_DISABLE_WEATHER` || Queries support for the [`weather`](/current/reference/shadersproperties/features/#weather) directive |
38+
| `COMPUTE_SHADERS` || Queries support for compute shaders |
39+
| `CUSTOM_IMAGES` | ✔️ | Enables [custom images](/current/reference/buffers/custom_images/) |
40+
| `ENTITY_TRANSLUCENT` || Queries support for [`gbuffers_entities_translucent`](/current/reference/programs/gbuffers#iris-additional-programs) |
41+
| `HIGHER_SHADOWCOLOR` | ✔️ | Enables [additional shadowcolor](/current/reference/buffers/shadowcolor/#extended-shadowcolor) buffers |
42+
| `PER_BUFFER_BLENDING` || Queries hardware support for per-buffer blending |
43+
| `REVERSED_CULLING` || Queries support for [reverse shadow culling](/current/reference/constants/voxeldistance/) |
44+
| `SEPARATE_HARDWARE_SAMPLERS` | ✔️ | Enables [separate hardware shadow samplers](/current/reference/buffers/shadowtex/#hardware-sampling) |
45+
| `SSBO` | ✔️ | Enables [SSBOs](/current/reference/buffers/ssbo/) |
46+
| `TESSELATION_SHADERS` / `TESSELLATION_SHADERS` | ✔️ | Enables tessellation shaders |
47+
| `FADE_VARIABLE` | ✔️ | Enables [the chunk fade attribute](/current/reference/attributes/mc_chunkFade) (`mc_chunkFade`) |
48+
| `TEXTURE_FILTERING` | ✔️ | Reports to Iris that the shader supports texture filtering, and enables the [`textureFilteringMode`](/current/reference/uniforms/rendering#texturefilteringmode) uniform|

src/content/docs/current/Reference/Uniforms/overview.mdx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,24 @@ Below is an index of all uniforms available in Iris. Uniforms marked as <Badge t
124124
| [logicalHeightLimit](/current/reference/uniforms/biome/#logicalheightlimit) | int | | Logical height of the current dimension | <Badge text="Iris Exclusive" variant="tip"/> |
125125

126126
## Rendering
127-
| Uniform | Type | Value range | Description | Tag |
128-
| ------------------------------------------------------------------- | ----- | ---------------- | ----------------------------------------------------------------- | --- |
129-
| [near](/current/reference/uniforms/rendering/#near) | float | 0.05 | Near clipping plane distance | |
130-
| [far](/current/reference/uniforms/rendering/#far) | float | (0, - ) | Current render distance in blocks | |
131-
| [alphaTestRef](/current/reference/uniforms/rendering/#alphatestref) | float | [0,1] | Cutout alpha discard threshold | |
132-
| [chunkOffset](/current/reference/uniforms/rendering/#chunkoffset) | vec3 | | Chunk offset for terrain model space position | |
133-
| [entityColor](/current/reference/uniforms/rendering/#entitycolor) | vec4 | [0,1] | Entity tint color | |
134-
| [blendFunc](/current/reference/uniforms/rendering/#blendfunc) | ivec4 | | Alpha blending function multipliers: (srcRGB, dstRGB, srcA, dstA) | |
135-
| [atlasSize](/current/reference/uniforms/rendering/#atlassize) | ivec2 | [0, - ) | Resolution of the texture atlas, `0` if not bound | |
136-
| [renderStage](/current/reference/uniforms/rendering/#renderstage) | int | | "Render stage" of the current geometry | |
137-
| [fogColor](/current/reference/uniforms/rendering/#fogcolor) | vec3 | [0,1] | Horizon fog color | |
138-
| [skyColor](/current/reference/uniforms/rendering/#skycolor) | vec3 | [0,1] | Upper sky color | |
139-
| [fogDensity](/current/reference/uniforms/rendering/#fogdensity) | float | [0,1] | Relative fog density | |
140-
| [fogStart](/current/reference/uniforms/rendering/#fogstart) | float | (0, - ) | Starting fog distance in blocks | |
141-
| [fogEnd](/current/reference/uniforms/rendering/#fogend) | float | (0, - ) | Ending fog distance in blocks | |
142-
| [fogMode](/current/reference/uniforms/rendering/#fogmode) | int | 2048, 2049, 9729 | Fog type used for vanilla fog | |
143-
| [fogShape](/current/reference/uniforms/rendering/#fogshape) | int | 0,1 | Fog shape used for vanilla fog | |
127+
| Uniform | Type | Value range | Description | Tag |
128+
| ----------------------------------------------------------------------------------- | ----- | ---------------- | ----------------------------------------------------------------- | -------------------------------------------- |
129+
| [near](/current/reference/uniforms/rendering/#near) | float | 0.05 | Near clipping plane distance | |
130+
| [far](/current/reference/uniforms/rendering/#far) | float | (0, - ) | Current render distance in blocks | |
131+
| [alphaTestRef](/current/reference/uniforms/rendering/#alphatestref) | float | [0,1] | Cutout alpha discard threshold | |
132+
| [chunkOffset](/current/reference/uniforms/rendering/#chunkoffset) | vec3 | | Chunk offset for terrain model space position | |
133+
| [entityColor](/current/reference/uniforms/rendering/#entitycolor) | vec4 | [0,1] | Entity tint color | |
134+
| [blendFunc](/current/reference/uniforms/rendering/#blendfunc) | ivec4 | | Alpha blending function multipliers: (srcRGB, dstRGB, srcA, dstA) | |
135+
| [atlasSize](/current/reference/uniforms/rendering/#atlassize) | ivec2 | [0, - ) | Resolution of the texture atlas, `0` if not bound | |
136+
| [renderStage](/current/reference/uniforms/rendering/#renderstage) | int | | "Render stage" of the current geometry | |
137+
| [fogColor](/current/reference/uniforms/rendering/#fogcolor) | vec3 | [0,1] | Horizon fog color | |
138+
| [skyColor](/current/reference/uniforms/rendering/#skycolor) | vec3 | [0,1] | Upper sky color | |
139+
| [fogDensity](/current/reference/uniforms/rendering/#fogdensity) | float | [0,1] | Relative fog density | |
140+
| [fogStart](/current/reference/uniforms/rendering/#fogstart) | float | (0, - ) | Starting fog distance in blocks | |
141+
| [fogEnd](/current/reference/uniforms/rendering/#fogend) | float | (0, - ) | Ending fog distance in blocks | |
142+
| [fogMode](/current/reference/uniforms/rendering/#fogmode) | int | 2048, 2049, 9729 | Fog type used for vanilla fog | |
143+
| [fogShape](/current/reference/uniforms/rendering/#fogshape) | int | 0,1 | Fog shape used for vanilla fog | |
144+
| [textureFilteringMode](/current/reference/uniforms/rendering/#texturefilteringmode) | int | 0,1,2 | User selected texture filtering mode | <Badge text="Iris Exclusive" variant="tip"/> |
144145

145146
## Matrices
146147
| Uniform | Type | Value range | Description | Tag |

src/content/docs/current/Reference/Uniforms/rendering.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sidebar:
66
order: 8
77
---
88
import { Aside } from '@astrojs/starlight/components';
9+
import { Badge } from '@astrojs/starlight/components';
910

1011
These uniforms store information related to rendering, such as near/far planes, chunk offsets, fog parameters, and more.
1112

@@ -203,3 +204,20 @@ This uniform encodes the fog shape used for vanilla fog, based on the current bi
203204
- `1`: cylinder
204205

205206
----------------
207+
208+
209+
## textureFilteringMode <Badge text="Iris Exclusive" variant="tip" size="medium" />
210+
```glsl
211+
uniform int textureFilteringMode;
212+
```
213+
214+
This uniform reports the texture filtering mode selected by the user in the Sodium quality settings. It will have one of the following values.
215+
- `0`: Disabled/Nearest Filtering
216+
- `1`: RGSS (Rotated-Grid Supersampling)
217+
- `2`: Anisotropic Filtering
218+
219+
**The `TEXTURE_FILTERING` [feature flag](/current/reference/shadersproperties/flags/) must be enabled for this uniform to be defined.** If this feature is not enabled, the user will not be able to select texture filtering options in the Sodium settings.
220+
221+
----------------
222+
223+

0 commit comments

Comments
 (0)