Uniforms are values sent from the CPU, and as such they cannot change from one shader invocation to the next within a render call. Most uniforms provided by Iris are constant across the entire frame, some values change between different geometry (such as renderstage
).
Below is an index of all Uniforms available in Iris. Uniforms marked as Iris Exclusive are only available in Iris, and uniforms marked as Optifine CU / Iris are available in Optifine only through custom uniforms but are available anywhere in Iris. Any unmarked uniforms is available in either Optifine or Iris.
Camera/Player
Uniform | Type | Value Range | Description | Tag |
---|
cameraPosition | vec3 | | Position of the camera in world space | |
eyeAltitude | float | | Y coordinate of the player in blocks | |
cameraPositionFract | vec3 | [0,1) | Fractional component of the camera position in world space | Iris Exclusive |
cameraPositionInt | ivec3 | | Integer component of the camera position in world space | Iris Exclusive |
previousCameraPosition | vec3 | | Value of cameraPosition from the previous frame | Iris Exclusive |
previousCameraPositionFract | vec3 | [0,1) | Value of cameraPositionFract from the previous frame | Iris Exclusive |
previousCameraPositionInt | ivec3 | | Value of cameraPositionInt from the previous frame | Iris Exclusive |
eyePosition | vec3 | | World space position of the player’s head model | Iris Exclusive |
relativeEyePosition | vec3 | | World space offset from the player head to the camera | Iris Exclusive |
playerBodyVector | vec3 | [0,1] | World aligned direction of player model’s body | Iris Exclusive |
playerLookVector | vec3 | [0,1] | World aligned direction of player model’s head | Iris Exclusive |
upPosition | vec3 | [0, 100] | Upwards direction in view space, length of 100 | |
eyeBrightness | ivec2 | [0, 240] | Light value at the player’s location: (block, sky) | |
eyeBrightnessSmooth | ivec2 | [0, 240] | eyeBrightness smoothed over time by eyeBrightnessHalfLife | |
centerDepthSmooth | float | [0,1] | Depth buffer value at the center of the screen, smoothed over time | |
firstPersonCamera | bool | true / false | Whether the player camera is in first person mode | Iris Exclusive |
Player Status
Uniform | Type | Value Range | Description | Tag |
---|
isEyeInWater | int | 0, 1, 2, 3 | Fluid that the camera is currently in | |
isSpectator | bool | true / false | Whether the player is currently in spectator mode | Iris Exclusive |
isRightHanded | bool | true / false | Whether the player’s main hand is set to right hand | Iris Exclusive |
blindness | float | [0,1] | Blindness effect multiplier | |
darknessFactor | float | [0,1] | Strength of the darkness effect | |
darknessLightFactor | float | [0,1] | Strength of the dimming effect from the darkness status effect | |
nightVision | float | [0,1] | Night vision effect multiplier | |
playerMood | float | [0,1] | Player mood value | |
constantMood | float | [0,1] | playerMood but it doesn’t reset at 1.0 | Iris Exclusive |
currentPlayerAir | float | [0,1] | Normalized air the player has remaining | Iris Exclusive |
maxPlayerAir | float | -1, 300 | Maximum player air when underwater | Iris Exclusive |
currentPlayerArmor | float | -1, [0,1] | Normalized armor player has equipped | Iris Exclusive |
maxPlayerArmor | float | 50 | Maximum player armor value | Iris Exclusive |
currentPlayerHealth | float | -1, [0,1] | Normalized health the player has remaining | Iris Exclusive |
maxPlayerHealth | float | -1, [0, 1024] | Maximum player health value | Iris Exclusive |
currentPlayerHunger | float | -1, [0,1] | Normalized hunger level of player | Iris Exclusive |
maxPlayerHunger | float | 20 | Maximum player hunger value | Iris Exclusive |
is_burning | bool | true / false | Whether the player is currently on fire | Optifine CU / Iris |
is_hurt | bool | true / false | Whether the player is currently taking damage | Optifine CU / Iris |
is_invisible | bool | true / false | Whether the player is invisible | Optifine CU / Iris |
is_on_ground | bool | true / false | Whether the player is currently touching the ground | Optifine CU / Iris |
is_sneaking | bool | true / false | Whether the player is currently sneaking | Optifine CU / Iris |
is_sprinting | bool | true / false | Whether the player is currently sprinting | Optifine CU / Iris |
hideGUI | bool | true / false | Whether the player’s GUI is hidden | |
Screen/System
Uniform | Type | Value Range | Description | Tag |
---|
viewHeight | float | [1,∞) | Height of the game window in pixels | |
viewWidth | float | [1,∞) | Width of the game window in pixels | |
aspectRatio | float | (0,∞) | Aspect ratio of the game window | |
screenBrightness | float | [0,1] | Screen brightness from video settings | |
frameCounter | int | [0, 720719] | Number of frames since start of program | |
frameTime | float | (0,∞) | Frame time of the previous frame in seconds | |
frameTimeCounter | float | [0, 3600) | Running time of the game in seconds | |
currentColorSpace | int | 0, 1, 2, 3, 4 | Display color space, controlled through video settings | Iris Exclusive |
currentDate | ivec3 | | System date: (year, month, day) | Iris Exclusive |
currentTime | ivec3 | | System time: (hour, minute, second) | Iris Exclusive |
currentYearTime | ivec2 | | Time since beginning of the year and until the end of the year | Iris Exclusive |
ID
Uniform | Type | Value Range | Description | Tag |
---|
entityId | int | [0, 65535] | ID of the currently rendering entity (gbuffers_entities) | |
blockEntityId | int | [-32768, 32767] | ID of the currently rendering block entity (gbuffers_block) | |
currentRenderedItemId | int | [0,65535] | Item ID of currently rendering item/armor/trim | Iris Exclusive |
currentSelectedBlockId | int | [-32768, 32767] | Block ID of block selected by the player | Iris Exclusive |
currentSelectedBlockPos | vec3 | | Player space position of the center of the block selected by the player | Iris Exclusive |
heldItemId | int | [0, 65535] | Item ID of the item in the player’s hand | |
heldItemId2 | int | [0, 65535] | Item ID of the item in the player’s offhand | |
heldBlockLightValue | int | [0,15] | Light value of the item held in the player’s hand | |
heldBlockLightValue2 | int | [0,15] | Light value of the item held in the player’s offhand | |
World/Weather
Uniform | Type | Value Range | Description | Tag |
---|
sunPosition | vec3 | [0,100] | Position of the sun in view space, length of 100 | |
moonPosition | vec3 | [0,100] | Position of the moon in view space, length of 100 | |
shadowLightPosition | vec3 | [0,100] | Position of shadow source in view space, length of 100 | |
sunAngle | float | [0,1] | Angle of the sun within the complete day-night cycle | |
shadowAngle | float | [0,0.5] | Angle of shadow source (whichever is higher in the sky) | |
moonPhase | int | [0,7] | Current moon phase | |
rainStrength | float | [0,1] | Current strength of rain | |
wetness | float | [0,1] | rainStrength but smoothed over time with wetnessHalfLife | |
thunderStrength | float | [0,1] | Current strength of thunderstorm | Iris Exclusive |
lightningBoltPosition | vec4 | | Position of a lightning bolt being rendered, or vec4(0.0) | Iris Exclusive |
worldTime | int | [0, 23999] | Current in-game time | |
worldDay | int | [0 - ) | Number of in-game days passed | |
Biome/Dimension
Uniform | Type | Value Range | Description | Tag |
---|
biome | int | | Biome currently occupied by the player | Optifine CU / Iris |
biome_category | int | | Category of the biome currently occupied by the player | Optifine CU / Iris |
biome_precipitation | int | 0, 1, 2 | Type of precipitation in the current biome | Optifine CU / Iris |
rainfall | float | [0,1] | Rainfall property of the current biome | Optifine CU / Iris |
temperature | float | | Temperature property of the current biome | Optifine CU / Iris |
ambientLight | float | [0,1] | Ambient light property of the current dimension | Iris Exclusive |
bedrockLevel | int | [-2032, 2016] | Y coordinate of the bedrock floor in the current dimension | Iris Exclusive |
cloudHeight | float | | Y coordinate of the vanilla cloud plane | Iris Exclusive |
hasCeiling | bool | true / false | Whether the current dimension has a ceiling | Iris Exclusive |
hasSkylight | bool | true / false | Whether the current dimension has sky lighting | Iris Exclusive |
heightLimit | int | [16, 4064] | Distance from maximum to minimum block heights in current dimension | Iris Exclusive |
logicalHeightLimit | int | | Logical height of the current dimension | Iris Exclusive |
Rendering
Uniform | Type | Value Range | Description | Tag |
---|
near | float | 0.05 | Near clipping plane distance | |
far | float | (0, - ) | Current render distance in blocks | |
alphaTestRef | float | [0,1] | Cutout alpha discard threshold | |
chunkOffset | vec3 | | Chunk offset for terrain model space position | |
entityColor | vec4 | [0,1] | Entity tint color | |
blendFunc | ivec4 | | Alpha blending function multipliers: (srcRGB, dstRGB, srcA, dstA) | |
atlasSize | ivec2 | [0, - ) | Size of the texture atlas, 0 if not bound | |
renderStage | int | | ”Render stage” of the current geometry | |
fogColor | vec3 | [0,1] | Horizon fog color | |
skyColor | vec3 | [0,1] | Upper sky color | |
fogDensity | float | [0,1] | Relative fog density | |
fogStart | float | (0, - ) | Starting fog distance in blocks | |
fogEnd | float | (0, - ) | Ending fog distance in blocks | |
fogMode | int | 2048, 2049, 2048 | Fog type used for vanilla fog | |
fogShape | int | 0,1 | Fog shape used for vanilla fog | |
Matrices