LGhassen / Scatterer

Atmospheric scattering mod for KSP
Other
190 stars 51 forks source link

Flags becoming translucent/disappearing when in front of ocean and surface features #135

Open Brushwing opened 3 years ago

Brushwing commented 3 years ago

KSP: 1.12.2 Problem: Flag parts becoming translucent/disappearing when in front of ocean and surface features

Mods installed: Stock + Making History + Breaking Ground DLC Scatterer 0.0772

Reproduction steps: 1. Attach any flag in such a way that there's no parts blocking the area behind it (e.g as structural parts with the panel variants)

  1. Select flag texture to a variant wherein the default white/black/orange background that fills transparency can be seen (e.g the Integral logo)
  2. View flag in flight when passing over ocean or faraway mountains, the white space in the flag will disappear completely over oceans or look translucent when in front of other terrain features.

screenshot2565

This is the default Aeris 3A with blank fully transparent flag files on it. The flag on the tail looks normal when viewed over land. Log: https://drive.google.com/file/d/15GWuMkFH8T_8X2IIth3y2rIkrb4Eedux/view?usp=sharing

This is how it looks when viewed while covering distant objects like mountains.

screenshot2566

Over the ocean, the flag completely disappears. Only the parts that overlap with other objects are visible. screenshot2569

I hope this shows how the flag disappears over certain bodies better. ezgif com-gif-maker (3)

This issue isn't a problem for flags that have no transparent parts in their PNGs, such as the Squad flag textures. screenshot2572

Player.log: https://drive.google.com/file/d/15GWuMkFH8T_8X2IIth3y2rIkrb4Eedux/view?usp=sharing

Sorry about the long post, I hope this shows the issue well. Thanks in advance!

LGhassen commented 2 years ago

For this issue it seems to be that the transparent flag shader doesn't write to the prepass depth buffer so scatterer cannot "see" it. It also means these flags don't cast or receive shadows.

I can't think of a simple way to fix it apart from re-writing a flag shader, or trying to add a second material to flags which only writes to depth buffer.

Both of these solutions don't inspire me and I consider this a low-severity issue, therefore I won't bother fixing it for now. We'll see later if I think of something.

alpgithubx commented 1 month ago

aw man