Skip to content

Conversation

@devendrn
Copy link
Owner

@devendrn devendrn commented Oct 22, 2025

All changes made to this branch will be for testing, and will include redundant code and comments.

Changes in mind for this PR:

  • New sky model
  • Update lighting
  • Improve clouds
  • Improve fog
sunrise rain during sunrise noon sun reflection on water

Please report any issue with these changes. Feedback will really help.

New Sky

Features

  • Custom sun/moon rotation (yaw, tilt) . Also removes in-game sun/moon scaling effect when looking at it.
  • 2d sky based on sun/moon direction (old one was 1d, with extra overlay effects)
  • New cube sun texture (based on current moon texture)
  • Rainbow positioning based on sun direction (also rainbow is now enabled by default during rain). Reduced rainbow width also.
  • Sun/moon light present in sky reflections and fog now (TODO: Make this a brighter for reflection and dimmer for fog?)

Known issues:

  • Moon abtruptly changing position right after midnight (FIXED)
  • Disabled underwater streak. need to update it (TOFIX)
  • Sun/Moon flickering near sunrise/sunset (FIXED)
  • Dark blob artifact at sun/moon center in some devices (FIXED)

Updated Lighting

Features

  • New lighting logic (also moved all lighting logic to vertex shader itself). No more hacky torchlight dimming in sunlight region. Now it blends properly with sun light.
  • Improved day/night transition using sun direction
  • Improved dawn lighting. Slight sunlight gradient fade during sunrise.
  • Correct cloud shadow projection (also enabled cloud shadow on terrain by default)

Known issuer:

  • Need to update actor,items shading to match terrain (TODO)
  • Need to update underwater lighting (TODO)

Update clouds

Features

  • Move clouds with minecraft world position (for rounded, realistic)
  • Cloud reflection now matches correctly with actual cloud plane and is now present for terrain reflection aswell.
  • Improve clouds lighting (TODO)

Other changes

Features

  • Improve water and lava noise (TODO)

- New sky model
- Custom sun/moon rotation
- Rewrite parts of code
@xLynxiummcx
Copy link
Collaborator

🔥🔥🔥

@devendrn
Copy link
Owner Author

Can someone test sun moon rotation for windows?

@BatmanBinSuparman49
Copy link

ok

@BatmanBinSuparman49
Copy link

Sun/moon rotation in Windows | Minecraft - 1.21.114
@devendrn
https://streamable.com/th7wqb

@faizul726
Copy link
Contributor

Batman saves the day 🗣️🔥🔥

- Add sun/moon glow to sky reflection
- Refactor some code
- Follow sun direction now
- Enable by default now
@devendrn
Copy link
Owner Author

Can someone test simple, rounded, and realistic clouds movement on windows? It should change with camera position.

@faizul726
Copy link
Contributor

Can someone test simple, rounded, and realistic clouds movement on windows? It should change with camera position.

doing a little bit later @devendrn

@BatmanBinSuparman49
Copy link

Clouds 3:
https://streamable.com/kn6fle

Clouds 2:
https://streamable.com/w121kn

Clouds 1:
https://streamable.com/wtn1bx

@devendrn

@faizul726
Copy link
Contributor

doing a little bit later @devendrn

Batman saves the day again

@BatmanBinSuparman49
Copy link

doing a little bit later @devendrn

Batman saves the day again

Windows User

@faizul726
Copy link
Contributor

@devendrn build pack -p windows fails

image

default Clouds was successful

@devendrn
Copy link
Owner Author

@faizul726 try again. I made a typo previously.

@faizul726
Copy link
Contributor

@devendrn there's an animated artifact on the sun

see

bandicam.2025-10-28.00-36-38-556.mp4
bandicam.2025-10-28.00-38-16-128.mp4

also, the sun side during rain is a little too bright

@devendrn
Copy link
Owner Author

@faizul726 when you are free later, check if that sun artifact happens with fully transparent sun texture.

@faizul726
Copy link
Contributor

happens with fully transparent image also

image image

and moon is also affected by this issue

@devendrn

@BatmanBinSuparman49
Copy link

image

It's doesn't happen to me
@faizul726
It could be a GPU issue
@devendrn

Also Fazul, send that transparent sun.png and let me try

@BatmanBinSuparman49
Copy link

image

Sky is too bright when looking at the side of the sun during rain

@devendrn
Copy link
Owner Author

@faizul726 does this artifact happen when you set mg8 to 0.0?

# src/newb/functions/sky.h
-  float mg8 = (g8.x+g8.y)*mask*(1.0-0.9*env.rainFactor);
+  float mg8 = 0.0;

@faizul726
Copy link
Contributor

@devendrn it's 12 am here right now. i will try to test in morning.

also i am updating minecraft to v1.21.120 (which broke materials again)

so you may want to update the material source once again.

@faizul726
Copy link
Contributor

image still happens @devendrn

@devendrn
Copy link
Owner Author

@faizul726 are you sure you applied the change properly?

Try again. If it still shows up, try with this change instead:

# src/newb/functions/sky.h
-  vec2 g = 0.5 - 0.5*vec2(dot(env.sunDir, viewDir), dot(env.moonDir, viewDir));
+  vec2 g = vec2_splat(0.0);

@devendrn
Copy link
Owner Author

Just a reminder that there are several visual changes. Feedback is needed for me to know whether these changes are moving in the right direction or wrong direction and no new issues are introduced. If lighting could use further improvement, this is the place to comment.

I update the PR heading message every commit to include current changes and to-do changes. Please refer that before testing or giving feedback. #52 (comment)

@faizul726
Copy link
Contributor

@devendrn sky being bright in rain issue is fixed.
and the blob thing is still there, as well as the dot on sun/moon. build from latest commit. I have attached a video for you to see.

Screenshot_20251101-102826 Screenshot_20251101-102902 Screenshot_20251101-102928 Screenshot_20251101-103011 Screenshot_20251101-103023 Screenshot_20251101-103102 Screenshot_20251101-103114 Screenshot_20251101-103128 Screenshot_20251101-103142 Screenshot_20251101-103221
Video_2025-11-01_10-33-20.mp4

@devendrn
Copy link
Owner Author

devendrn commented Nov 1, 2025

@faizul726 try testing with this change:

# src/newb/functions/sky.h
-  vec2 g = 0.5 - 0.5*vec2(dot(env.sunDir, viewDir), dot(env.moonDir, viewDir));
+  vec2 g = vec2_splat(1.0);

@faizul726
Copy link
Contributor

@devendrn no longer happens. but the glow is gone now.

image

@devendrn
Copy link
Owner Author

devendrn commented Nov 1, 2025

Maybe clamping this value could fix this issue. @faizul726 Try this:

# src/newb/functions/sky.h
-  vec2 g = 0.5 - 0.5*vec2(dot(env.sunDir, viewDir), dot(env.moonDir, viewDir));
+  vec2 g = clamp(0.5 - 0.5*vec2(dot(env.sunDir, viewDir), dot(env.moonDir, viewDir)), 0.0, 1.0);

@faizul726
Copy link
Contributor

@devendrn it seemingly fixed the black blob issue.

also the animated dot issue is no longer present (at least i can't see anymore)

do you want me to test on windows as well?

image

@faizul726
Copy link
Contributor

@devendrn build fails on windows
note: i have added Metal in the merged profile

image

@faizul726
Copy link
Contributor

By the way, can I post merged builds in the Newb server for people to try?

@devendrn
Copy link
Owner Author

devendrn commented Nov 2, 2025

@devendrn build fails on windows

Does the same error come when building Sky material? Also check if this change fixes the error:

# src/newb/functions/sky.h
nl_skycolor nlSkyColors(nl_environment env) {
-  if (env.end) {
-    return nlEndSkyColors(env);
-  }
-  return nlOverworldSkyColors(env);
+  nl_skycolor s;
+  if (env.end) {
+    s = nlEndSkyColors(env);
+  } else {
+    s = nlOverworldSkyColors(env);
+  }
+  return s;
}

By the way, can I post merged builds in the Newb server for people to try?

Sure @faizul726

@faizul726
Copy link
Contributor

@devendrn

Does the same error come when building Sky material?

From the image, I can see that it fails when building RenderChunk. Not sure if Sky supposed to have problem here.

I have already updated to latest commit d88dfdf, so I can't confirm whether Sky build or not.

But even with that commit, I get build failure on RenderChunk

image

Sky builds fine from that commit.

With mentioned fix, #52 (comment)
I get this error. Sky still builds fine after the fix.

image

@faizul726
Copy link
Contributor

To be more specific,

RenderChunk (without Sky.h fix) builds fine for ESSL_300 and Metal. The error only appears when I use SM50. Haven't tried other D3D types...

@devendrn
Copy link
Owner Author

devendrn commented Nov 2, 2025

@faizul726 Try making this change :

# src/newb/functions/lighting.h
- float gameBrightness = texture2D(tex, vec2_splat(0.0)).g;
+ float gameBrightness = 1.0;

@faizul726
Copy link
Contributor

@devendrn
now it builds successfully without the sky.h fix

@faizul726
Copy link
Contributor

@devendrn

new issues:

  • night terrain looks brighter than it should (perhaps i didn't notice it before)
  • stars render in front of moon
  • sun/moon flickers on Android (might be gpu specific?) (doesn't happen to me on Windows)
image
screen-20251103-110700.mp4

@faizul726
Copy link
Contributor

can confirm happening with mcpelauncher as well.
i will need to confirm again on windows

@devendrn
Copy link
Owner Author

devendrn commented Nov 3, 2025

night terrain looks brighter than it should (perhaps i didn't notice it before)

@faizul726 Because it was made like that for testing purpose. Try to check if this compiles on windows:

# src/newb/functions/lighting.h
- float gameBrightness = 1.0;
+ float gameBrightness = texture2DLod(tex, vec2_splat(0.0), 0.0).g;

@faizul726
Copy link
Contributor

@devendrn now it builds RenderChunk successfully with both windows and merged (3-in-1) profile

@faizul726
Copy link
Contributor

@devendrn
Sun/Moon glow seems to render on fog layer now (?)

Screenshot_20251104-132300 Screenshot_20251104-132325 Screenshot_20251104-132443 Screenshot_20251104-132506 Screenshot_20251104-132531 Screenshot_20251104-132557

@devendrn
Copy link
Owner Author

devendrn commented Nov 4, 2025

@faizul726 Can you also check if this compiles in windows:

  float gameBrightness = texelFetch(tex, ivec2(0,0), 0).g;

Sun/Moon glow seems to render on fog layer now (?)

Intentionally added. Will remove it from fog next commit.

@Jesusmendozaxxx
Copy link

You're the best, though* even though the newbie version is discontinued, we'll continue it by creating variants. There's a problem, though: the endgame doesn't show its fog in version 1.21.120, and even though I have the fog settings, biome settings, and the biome client, it doesn't seem to work properly.

@faizul726
Copy link
Contributor

@devendrn RenderChunk builds with merged profile (android, ios, win)

@devendrn
Copy link
Owner Author

devendrn commented Nov 5, 2025

There's a problem, though: the endgame doesn't show its fog in version 1.21.120, and even though I have the fog settings, biome settings, and the biome client, it doesn't seem to work properly.

@Jesusmendozaxxx I have not tested this shader on 1.21.120. If this is an issue with newb-x-mcbe (built using lastest commit), create a github issue with proper screenshots of the problem. Do not post issues of variants here. This repo is only for newb-x-mcbe only.

@faizul726
Copy link
Contributor

faizul726 commented Nov 6, 2025 via email

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.

6 participants