Skip to content

at_midBlock

in vec4 at_midBlock;

Valid Programs: terrain (gbuffers_terrain, gbuffers_water, shadow)


The first three components store the world/player space offset from the vertex’s position to the center of the block in 1/64th block units. For example, the center position would be calculated like this:

vec3 centerPosition = position + at_midBlock.xyz/64.0;

In Iris 1.7 and newer, the last component stores the light level of the current block (without the influence of nearby light sources). This can be used to tell if a block is emissive. It’s recommended to use this together with BLOCK_EMISSION_ATTRIBUTE.

This attribute is only available for terrain.