Skip to content

Lightmap fix for 1.21.100+#48

Closed
xLynxiummcx wants to merge 2 commits intomainfrom
lynx2
Closed

Lightmap fix for 1.21.100+#48
xLynxiummcx wants to merge 2 commits intomainfrom
lynx2

Conversation

@xLynxiummcx
Copy link
Copy Markdown
Collaborator

Before and After
Screenshot_20251002_195108_io_bambosan_mbloader_Launcher
Screenshot_20251002_195256_io_bambosan_mbloader_Launcher

@Arctrometa
Copy link
Copy Markdown

W

@faizul726
Copy link
Copy Markdown
Contributor

lynx speed run
1742905756887

@faizul726
Copy link
Copy Markdown
Contributor

my question is that, is this actual fix or workaround.

autofixers are already having hard time finding the "workaround"

@Mrwang2408
Copy link
Copy Markdown

my question is that, is this actual fix or workaround.

autofixers are already having hard time finding the "workaround"

This is already a stable implementation as long as lazurite is 0.5.0. consider as a new version of materialbin, autofixers won't update it again.

@devendrn
Copy link
Copy Markdown
Owner

devendrn commented Oct 3, 2025

@Mrwang2408 What was the Minecraft last version without this change in lighting logic?

@Mrwang2408
Copy link
Copy Markdown

@Mrwang2408 What was the Minecraft last version without this change in lighting logic?

Minecraft Preview:
1.21.100.23 is the last version without any change (==1.21.30).
1.21.100.24 added dithering on reeds which caused some changes on a_texcoord1 input.
1.21.110.20 used new materialbin format, terrain invisible again. update lazurite 0.5.0 to fix.

Minecraft Release:
1.21.30, 1.21.94 is same as 1.21.100.23
1.21.100, 1.21.101 is same as 1.21.100.24
1.21.111 is same as 1.21.110.20

This is how the vanilla shaders be like in 1.21.100.24 essl :

v_lightmapUV = vec2(
    clamp(float(uint(floor(a_texcoord1.x * 255.0)) & 15u) * 0.0625, 0.0, 1.0),
    clamp(float((uint(floor(a_texcoord1.x * 255.0)) & 240u) >> 4u) * 0.0625, 0.0, 1.0)
);
v_dithering = float(uint(floor(a_texcoord1.y * 255.0)) & 1u);

says that multiple values were packed together in a_texcoord1.xy, we have to unpack the correct value of v_lightmapUV from a_texcoord1.x.

for a_texcoord1.y I didn't use it, because it seems just a detection of reeds. we need to do more things in fragment shaders if we really want to add the dithering effect.

commits in this pull request was optimized by me, it basically have the same function.

Snipaste_2025-07-17_14-07-12

@devendrn
Copy link
Copy Markdown
Owner

devendrn commented Oct 4, 2025

Can someone test if this material works with Minecraft 1.21.111?
RenderChunk.zip

@faizul726
Copy link
Copy Markdown
Contributor

i will test later and let you know

@faizul726
Copy link
Copy Markdown
Contributor

image

can confirm it works

@devendrn

devendrn added a commit that referenced this pull request Oct 4, 2025
@devendrn devendrn closed this Oct 4, 2025
@devendrn
Copy link
Copy Markdown
Owner

devendrn commented Oct 5, 2025

Just a FYI for those of you who are trying to update to the above commit. You will have to delete old materials source files and run ./build.sh setup again to get new 1.21.111 lazurite material.json files.

rm ./tool/data/materials/*
./build.sh setup

Lazurite version must be 0.6.0 also.

pip install lazurite==0.6.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants