Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #862511

Gtk3/3.22 fog-of-war is too dark with fog_style "Auto"

Added by Jacob Nevins 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
gui-gtk-3
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Part of #697998.

The basic problem in this case is that the fog algorithm in pixmap_put_overlay_tile_draw() (which dates to gna bug #21601 in 2014) darkens colours by 65% of their value, whereas the equivalent Gtk2 code in fog_sprite() darkens colours to 65%.

(Having fixed that, there are some remaining differences between Gtk2 and Gtk3 rendering. I suspect this is some subtlety with premultiplied alpha. But this is a good enough improvement to have for now.)

m-gtk3x-dark-fog.patch (7.78 KB) m-gtk3x-dark-fog.patch master (Gtk4 not tested) Jacob Nevins, 2020-03-01 04:45 PM
30-gtk3x-dark-fog.patch (5.28 KB) 30-gtk3x-dark-fog.patch S3_0 Jacob Nevins, 2020-03-01 04:45 PM
26-gtk3x-dark-fog.patch (5.43 KB) 26-gtk3x-dark-fog.patch S2_6 Jacob Nevins, 2020-03-01 04:45 PM
gtk2_gtk3.apng (1.86 MB) gtk2_gtk3.apng illustration of remaining fog differences Jacob Nevins, 2020-03-01 04:50 PM

Related issues

Blocks Freeciv - Bug #697998: fog_style "Auto" (used for hex tilesets) differs widely between clients, has many artifactsNew

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Jacob Nevins 11 months ago

  • Blocks Bug #697998: fog_style "Auto" (used for hex tilesets) differs widely between clients, has many artifacts added

#3 Updated by Jacob Nevins 11 months ago

I tried to work out which client's behaviour is more correct. By working through alpha compositing maths, I couldn't convince myself that the Gtk3 behaviour was theoretically sound.

Having fixed that, there are some remaining differences between Gtk2 and Gtk3 rendering

Attached animation illustrates this. Things like shadows at bright spots in fog remain more intense than in Gtk2. I suspect that it will show seams in hills and other multi-layered terrain if the fog darkness is artificially cranked up.

Any further work to go in a new bug.

#4 Updated by Jacob Nevins 11 months ago

  • Status changed from Resolved to Closed

#5 Updated by Jacob Nevins 11 months ago

  • File gtk3fog.apng added

#6 Updated by Jacob Nevins 11 months ago

  • File deleted (gtk3fog.apng)

Also available in: Atom PDF