Skip to content

Commit

Permalink
OpenGL: Fix shift signedness in fog calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat authored Aug 20, 2024
1 parent 4b11eb0 commit 937348a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/host_shaders/opengl_fragment_shader.frag
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ void main() {

// Annoyingly color is not encoded in the same way as light color
float r = float(GPUREG_FOG_COLOR & 0xFFu);
float g = float((GPUREG_FOG_COLOR >> 8) & 0xFFu);
float b = float((GPUREG_FOG_COLOR >> 16) & 0xFFu);
float g = float((GPUREG_FOG_COLOR >> 8u) & 0xFFu);
float b = float((GPUREG_FOG_COLOR >> 16u) & 0xFFu);
vec3 fog_color = (1.0 / 255.0) * vec3(r, g, b);

fragColour.rgb = mix(fog_color, fragColour.rgb, fog_factor);
Expand Down Expand Up @@ -561,4 +561,4 @@ void main() {
break;
}
}
}
}

0 comments on commit 937348a

Please sign in to comment.