Skip to content

Enhancement: smoother block light for rotated model elements, like NeoForge's new lighting pipeline #3900

Open

Description

@votetheremess

This is an enhancement request rather than a bug report. As far as I can tell, Sodium currently matches vanilla behavior in this area. The request is to go beyond vanilla here, the way NeoForge recently did.

What happens

Blocks whose models are built from rotated elements get one flat block light value per block. A light gradient across several of these blocks turns into a patchwork of visibly stepped tiles instead of a smooth blend. Sky light looks fine, so everything looks normal in daylight. The problem shows up under torches and lanterns at night.

The easiest way to see it is Macaw's Roofs, which is one of the most downloaded decoration mods. Place a patch of any roof blocks near a lantern at night with smooth lighting on. Each roof block renders as its own flat shade. Screenshots are in the first comment below.

What I ruled out

These are ordinary JSON block models with no custom rendering code involved. In the roofs mod, 53 of 54 block models use rotated elements, which is why the whole roof surface is affected.

The model ambientocclusion flag makes no difference for these faces. I tested that directly with a resource pack that re-enabled ambient occlusion on 225 Macaw's models. The rotated faces did not change at all.

It is not shader related and not a light engine problem. It reproduces with shaders off, and it reproduces identically with Sodium removed, so this is faithful vanilla behavior. The underlying light values are correct: a shader that computes block light per pixel from its own voxel model (Rethinking Voxels) renders the exact same scene perfectly smooth.

The request

Vanilla treats a quad that is not axis aligned as an inset partial face on its closest axis and hands it a single light value, which is where the flat per-block shading comes from. NeoForge shipped an enhanced lighting pipeline this year that handles these irregular faces properly: it projects the face onto the three axes, computes light for each axis, and blends the results using the components of the face normal. Their write-up explains the whole design and the edge cases they hit: https://neoforged.net/news/enhanced-ao/

Something equivalent in Sodium would fix this for every mod that uses rotated elements, with Macaw's mods alone covering a very large install base. Issue #3227 seems to track a related problem where partial quads get incorrect block light, so there may be shared ground between the two.

Versions

Minecraft 26.1.2, Fabric Loader 0.19.3, Sodium 0.9.1, Macaw's Roofs 2.3.2. Also reproduced on the Sodium 0.8.12 line.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions