Skip to content

Commit

Permalink
Fog calculation simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Nov 13, 2023
1 parent c2f130c commit 744e473
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion res/main.glslv
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ void main(){
a_color = vec4(pow(light, vec3(u_gamma)),1.0f);
a_texCoord = v_texCoord;
a_color.rgb += u_skyLightColor * v_light.a;
a_distance = pow(length(viewmodelpos), 1.5);
a_distance = length(viewmodelpos);
gl_Position = u_proj * viewmodelpos;
}
2 changes: 1 addition & 1 deletion src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void Engine::mainloop() {
level->update();
level->chunksController->update(settings.chunks.loadSpeed);

float fovFactor = 1.6f / (float)settings.chunks.loadDistance;
float fovFactor = 16.0f / (float)settings.chunks.loadDistance;
worldRenderer.draw(camera, occlusion, fovFactor, settings.fogCurve);
hud.draw();
if (level->player->debug) {
Expand Down

0 comments on commit 744e473

Please sign in to comment.