Skip to content

Commit

Permalink
feat(shaders): gradient skycolor added
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0g committed Sep 30, 2024
1 parent cf2f8fb commit 56993e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Binary file modified assets/terrain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/shaders/terrain.frag
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ vec3 rayMarch(vec3 cameraOrigin, vec3 cameraDir) {
Material mat = rayCast(cameraOrigin, cameraDir, NUM_STEPS, 1.0, MAX_DIST);

float skyFactor = exp(saturate(cameraDir.y) * -40.0);
vec3 skyColor = mix(vec3(0.025, 0.065, 0.5), vec3(0.7, 0.2, 0.0), skyFactor);
vec3 skyColor = exp(-cameraDir.y/vec3(0.025, 0.065, 0.5));
skyColor = mix(skyColor, vec3(0.7, 0.2, 0.0), skyFactor);

if (mat.dist < 0.0) {
return skyColor;
Expand Down

0 comments on commit 56993e2

Please sign in to comment.