Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

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

Kneelawk opened this issue ยท 3 comments

commented

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

  • Create a mod for NeoForge mod that implements IBakedModelExtension.getQuads() and returns a BakedQuad that has its light-map values set to full-brightness and its isShade() and hasAmbientOcclusion() values set to false.
  • Test the mod without Sodium and observe the brightness of the quad.
  • Test the mod with Sodium and observe that the quad now has diffuse lighting and ambient occlusion effects.

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

commented

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

commented

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?

commented

Thanks