Skip to content

Quads without baked normals render dark with smooth lighting on NeoForge #3932

Open

Description

@Leclowndu93150

Bug Description

On NeoForge, quads baked without normals (BakedNormals.UNSPECIFIED, which is what the plain 10-arg BakedQuad constructor gives you) render really dark with smooth lighting on if they aren't axis-aligned. Flat lighting looks fine.

I think it's because BakedQuadMixin.getVertexNormal returns -1 for unspecified normals:

https://github.com/CaffeineMC/sodium/blob/mc26.1.2-0.9.2/neoforge/src/mod/java/net/caffeinemc/mods/sodium/mixin/core/model/quad/BakedQuadMixin.java#L95

but MutableQuadViewImpl.fromVanillaInternal only treats 0 as "no normal":

https://github.com/CaffeineMC/sodium/blob/mc26.1.2-0.9.2/common/src/main/java/net/caffeinemc/mods/sodium/client/render/model/MutableQuadViewImpl.java#L278

So every vertex gets a normal of about (-0.008, -0.008, -0.008) and getAccurateNormal never falls back to the face normal. applyIrregularFace then weights each axis by the normal squared, which adds up to almost nothing, so the * 0.5f at the end ends up cutting both the brightness and the light level in half:

https://github.com/CaffeineMC/sodium/blob/mc26.1.2-0.9.2/common/src/main/java/net/caffeinemc/mods/sodium/client/model/light/smooth/SmoothLightPipeline.java#L314-L315

Returning 0 there (same as BakedNormals.UNSPECIFIED.normal(i)) should fix it. It's still the same on dev.

Vanilla blocks don't run into this since regular cube faces never take the irregular path. We hit it with the infusion pillars in Thaumaturge, which have slanted faces. We've worked around it on our end by baking normals, but any mod using the short constructor will see it.

Sodium 0.9.2 for 26.1.2, NeoForge 26.1.2.76.

Reproduction Steps

  1. On NeoForge 26.1.2, make a block model with a slanted quad built with new BakedQuad(p0, p1, p2, p3, uv0, uv1, uv2, uv3, direction, materialInfo) (no normals).
  2. Place the block with smooth lighting on.
  3. The slanted faces come out way darker than they should. Turn smooth lighting off or remove Sodium and they look normal.

Log File

Not attaching one since nothing shows up in the log for this, but I can grab one if you need it.

Crash Report

Same as above, happy to add one if needed.

Activity

  1. douira commented on Oct 4, 2026

    @douira
    Contributor

    Does this also happen on current Minecraft versions?

  2. Leclowndu93150 commented on Oct 4, 2026

    @Leclowndu93150
    Author

    what do you mean by current ?

  3. Redls07 commented on Oct 7, 2026

    @Redls07

    what do you mean by current ?

    Try to reproduce this on 26.3

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

    A-modsArea: Mod compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions