Skip to content

Conversation

@ThePuzzlemaker
Copy link
Contributor

This fixes some issues with sun glare noticed by NASSP users, where the sun glare was hidden by the COAS (a translucent mesh). This also fixes the sun glare being hidden by the DG hud, for example.

I implemented a simple heuristic for simple translucent objects (diffuse color alpha != 1.0), but others must be manually marked with the mesh group flag 0x401. Otherwise, checking translucency incurs checking every pixel of an image after considering textures, which is expensive and error-prone.

These excluded objects do not write to the depth-buffer or the SSAO/glare calculation g-buffers, which I believe is probably an invalid behaviour with respect to the intended functionality.

Please let me know if you find anything this breaks! I don't believe this should break anything, and it may actually fix other issues within Orbiter related to transparency.

Footnotes

  1. I couldn't find a centralized place for mesh group flags, so please let me know if there is one or if this flag conflicts with anything. My cursory checking shows it does not, but I may have missed something.

This fixes some issues with sun glare noticed by NASSP users, where the sun glare was hidden by the COAS (a translucent mesh). This also fixes the sun glare being hidden by the DG hud, for example.

I implemented a simple heuristic for simple translucent objects (diffuse color alpha != 1.0), but others must be manually marked with the mesh group flag 0x40. Otherwise, checking translucency incurs checking every pixel of an image after considering textures, which is expensive and error-prone.

These excluded objects do not write to the depth-buffer or the SSAO/glare calculation g-buffers, which I believe is probably an invalid behaviour with respect to the intended functionality.

Please let me know if you find anything this breaks! I don't believe this should break anything, and it may actually fix other issues within Orbiter related to transparency.
@jarmonik
Copy link
Contributor

jarmonik commented Jul 9, 2025

Transparent objects are also used to clip/cut holes into a meshes (Z-clip technique). Therefore, "alpha != 1.0" would cause some problems. Also should be noted that Main scene rendering Z-buffer and Sun light blocking mask are two separate things in D3D9 but would be combined in Vulkan.

It would be logical to have separate rendering passes for solid and translucent mesh groups. It's not been implemented due to tricky use of transparencies in Orbiter. Would make sense to mark those z-clipper groups with a special flag to cause them to render among the solids.

All mesh group flags should be listed in a mesh file documentation. All of my orbiter installations are missing documentation, so, can't check it right now.

@jarmonik
Copy link
Contributor

jarmonik commented Jul 9, 2025

Flag 0x40 seems to be first unused flag

0x00000001 & Do not use this group to render ground shadows
0x00000002 & Do not render this group
0x00000004 & Do not apply lighting when rendering this group
0x00000008 & Texture blending directive: additive with background
0x00000010 & Texture blending directive: Texture alpha, material color
0x00000020 & Order independent transparency for trees and fences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants