Skip to content

Commit c72e214

Browse files
committed
fix sunglares when lightshafts are disabled
This is another case of a bug introduced by a bugfix, in this case #3885. The original bug inadvertently made sun glare work in most cases where it was supposed to. This commit removes the check for lightshafts when drawing the sun glare. Since sun glare can be drawn regardless of whether lightshafts are enabled, the only thing that matters is to check that the view is not shadowed.
1 parent 7177361 commit c72e214

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

freespace2/freespace.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ void game_sunspot_process(float frametime)
710710
for(idx=0; idx<n_lights; idx++) {
711711
bool in_shadow = shipfx_eye_in_shadow(&Eye_position, Viewer_obj, idx);
712712

713-
if (gr_lightshafts_enabled() && !in_shadow) {
713+
if (!in_shadow) {
714714
vec3d light_dir;
715715
light_get_global_dir(&light_dir, idx);
716716

@@ -719,8 +719,7 @@ void game_sunspot_process(float frametime)
719719
float dot = vm_vec_dot( &light_dir, &Eye_matrix.vec.fvec )*0.5f+0.5f;
720720
Sun_spot_goal += (float)pow(dot,85.0f);
721721
}
722-
}
723-
if ( !in_shadow ) {
722+
724723
// draw the glow for this sun
725724
stars_draw_sun_glow(idx);
726725
}

0 commit comments

Comments
 (0)