Skip to content

Commit

Permalink
Add a cursor to make placing/breaking blocks easier
Browse files Browse the repository at this point in the history
  • Loading branch information
patowen authored and Ralith committed Jan 27, 2024
1 parent 088de1f commit 31c0e2a
Showing 1 changed file with 8 additions and 2 deletions.
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)));
}
}

0 comments on commit 31c0e2a

Please sign in to comment.