Terrain vertex attribute "a_LightAndData.xy" would be set to 8 instead of 0 when light level is 0.
Tahnass opened this issue ยท 3 comments
Bug Description
Terrain vertex attribute "a_LightAndData.xy" would be set to 8 instead of 0 when light level is 0.
This problem started to appear in version 0.6.0 beta.1 (not tested with alpha versions).
It has no effect on vanilla rendering, but may cause some shaders to calculate block lighting incorrectly.
Reproduction Steps
Launch Minecraft 1.21.1 with sodium-fabric-0.6.0-beta.2 only.
Capture a frame with RenderDoc. And randomly select a triangle with no lighting.
Log File
No useful infromation.
Crash Report
No useful infromation.
Sodium clamps the light map coordinates between (0.5, 0.5) and (15.5, 15.5) in the vertex data rather than in the shader code to avoid some additional instructions. So these values are to be expected for the minimum and maximum brightness levels.
If you are authoring a shader pack with Iris and this behavior causes compatibility issues, then you should open a bug report with them. They are copying the clamping behavior, but it probably doesn't make sense for OptiFine-style shaders that expect it to work identically to Minecraft.