CaffeineMC / sodium

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.77k stars 810 forks source link

[NeoForge] Sodium Ignores `BakedQuad`'s `isShade()` and `hasAmbientOcclusion()` #2816

Closed Kneelawk closed 1 week ago

Kneelawk commented 1 week ago

Bug Description

This issue is occurring with Sodium mc1.21-0.6.0-beta.2-neoforge which is the latest version of Sodium as of this writing.

I have a mod where my model implements IBakedModelExtension.getQuads(...) and returns baked quads, some of which have set their vertex light-map values to full-bright and set their isShade() and hasAmbientOcclusion() values to false.

On NeoForge, without Sodium, these quads are clearly visible as emissive. However, when Sodium is installed, these quads suddenly appear much darker, due to the effects of diffuse lighting and ambient occlusion.

Without Sodium installed: 2024-10-16_05 57 34

With Sodium Installed: 2024-10-16_05 56 53

Note: I also tried emitting the same quads using the Fabric Render API instead of NeoForge's BakedQuad-based API and the FRAPI quads were lit properly. Only the NeoForge BakedQuad quads were improperly lit.

Reproduction Steps

I have a repository that can be used to demonstrate the issue: Kneelawk/KRender@e7c001b. The issue is demonstrated using the example mod ct_complicated under the examples directory. Note that compiled libs will appear under build/libs under the root directory of the repository, not under the example's own build directory.

Log File

Gist: https://gist.github.com/Kneelawk/337c5cc530f68a5405b2f55cb453786a File: latest.log

Crash Report

Gist: https://gist.github.com/Kneelawk/16dd2738f44efc1705f9db2f8b976757 File: crash-2024-10-16_05.41.44-client.txt

douira commented 1 week ago

Can you check if it still happens on this build, which follows this commit that potentially fixes the problem.

Kneelawk commented 1 week ago

That seems to have fixed the issue. Thank you!

2024-10-16_08 21 29

Should I close the issue now or wait for the fix to be part of an actual release first?

douira commented 1 week ago

Thanks