rafalh / dashfaction

A community patch for the Red Faction (2001) FPS game
https://www.factionfiles.com/ff.php?action=file&id=6252
Mozilla Public License 2.0
60 stars 11 forks source link

Alpha blending/layering issues with detail brushes with alpha being rendered in front of liquid surfaces when passing through portals #85

Open GooberRF opened 3 years ago

GooberRF commented 3 years ago

image In this screenshot, the grating on the bridge is a single solid detail brush (which has an alpha texture applied). There is a large face portal dividing the map in the water at the visible point. When walking back and forth through the portal and looking at the bridge, the above behaviour is observed.

Issue appears to only occur if the detail brush in question is intersecting the height of the liquid surface.

This map isn't released yet, but I can send it to you for testing if you like - or I can make a small test map that shows the behaviour.

rafalh commented 3 years ago

Portal is parallel to the river? It would be include rfl and/or some screenshot from the level editor. If this is a case where portal is intersecting the detail brush it may change the order, because game draws room where the player character is first and then the other rooms. Detail brush is being drawn with the first room it belongs too (e.g. if parts of detail brush are in two rooms they are drawn together with one of the rooms but not both)

rafalh commented 2 months ago

Is it still a problem? I think having a detail with alpha blended texture cross the water is generally bad idea. To properly display two objects with alpha textures engines have to sort those objects and draw from the farthest to the closest. If those objects intersect e.g. water surface and the detail, it gets very complicated. The only way to display such intersecting objects correctly would be to split them into smaller parts, but engines usually don't do it (at least RF does not). So it's best to keep alpha objects small and not intersecting.