Skip to content
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

Add a cursor to make placing/breaking blocks easier #349

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions client/shaders/fog.frag
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ void main() {
float view_length = length(view_pos);
// Convert to true hyperbolic distance, taking care to respect atanh's domain
float dist = view_length >= 1.0 ? INFINITY : atanh(view_length);
// Exponential^k fog
fog = vec4(0.5, 0.65, 0.9, exp(-pow(dist * fog_density, 5)));
if (dot(scaled_view_pos.xy, scaled_view_pos.xy) < 0.0001) {
// Temporary code to add a cursor in the center of the window for placing/breaking blocks
// TODO: Replace with a UI element when UI exists
fog = vec4(0.0, 0.0, 0.0, 0.0);
} else {
// Exponential^k fog
fog = vec4(0.5, 0.65, 0.9, exp(-pow(dist * fog_density, 5)));
}
}
Loading