-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skybox rendering #188
Merged
Merged
Skybox rendering #188
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…gration could be attempted instead of throwing an error)
…nfig (to give them a chance to close the client and recover their config)
… stabilise a bit) I've made the config version a Float so that we can increment it without ripping through versions too quickly.
…anslucent objects)
…le (now bundled up in a Fog struct)
The light map was calculating brightness incorrectly by accidentally offsetting the sun angle by half a day.
…rwater (replicating GL_FOG_EXP) Took me ages to realise that OpenGL actually just has a built-in fog feature. I spent quite a while searching around the decompiled vanilla sources and shaders to find the exponential fog equation to no avail (before realising that it's actually just a documented built-in GL feature). The sky plane is rendered exactly how it is in Vanilla (or so I hope).
…our) It looks so nice :o
…r returns negative time when that's the case)
…s towards the sunrise/sunset
…d to read as unsigned) This means that fixed time dimensions now have their sky/fog rendered correctly. The nether fog is now correctly the same color no matter the time in the overworld
…om behind instead of being overlayed on top)
…orrect when in 3rd person Before this change, directional sunrise fog was incorrect when in camera 3, and you'd get water fog when the camera was above water but the player was below
…ect to chunk fragment shader
Still has a few issues, the main one being a weird color banding effect as the translucent geometry passes through the fog, but at a distance it's not quite as noticeable. Will need to revisit OIT at some point to make it a bit more accurate. Or alternatively I could just optimize regular translucency rendering with smarter sorting.
Turns out it's just a 200x200x200 textured cube, the more you know. All the cool shimmery effects are just a result of Moire patterns.
Gonna leave the other two remaining tasks for now as they're more minor things and not really part of the main skybox implementation. They can be implemented later as QoL improvements. |
🎉 Maybe add some screenshots showing this off to the README? |
Oh yeah good idea 👍 a sunrise would look nice in the readme. Will do when I’m back at my laptop. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I've finally implemented a proper skybox renderer with distance fog, correct sky color (based on time-of-day and biome), the sun, the moon, the stars, the sunrise/sunset 'fog', underwater fog and lava fog. This drastically improves how complete the client feels, and makes a massive improvement in the nether where the fog is a staple of the visual aesthetic.
Remaining tasks