scp-fs2open / scp-fs2open/fs2open.github.com
FR: Improved visual occlusion system for optical effects (engine glows, particles, etc.)
- Dominant language
- C++
- Stars
- 487
- Forks
- 184
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 44
Description
Sprites in FSO are currently rendered as geometry in 3D space. It's possible, for example, for a large engine glow bitmap to clip through the ship it's attached to. This usually looks very bad. Certain types of effects -- especially things like engine glows and beam muzzle glows -- often represent optical effects, and as such they shouldn't be treated like objects in space. However, improving this situation would require a system for determining when and how a glow effect should be visible.
I suggest a "light source radius" parameter. Suppose that we have an engine glow effect with a radius of 10 meters. (Here I refer to "Thruster Bitmap 1", the glow effect that in the current system is only visible from a certain angle determined by the thruster normal.) The "source radius" would be a separate parameter. Suppose we set it to 1 meter. Now, we have an invisible disk with a radius of 1 meter, at the center of the 10 meter engine glow.
When this 1-meter disk is fully visible to the player -- entirely onscreen, and not occluded by any geometry -- then the engine glow is at full opacity. Furthermore, it is rendered on top of all geometry. It can't be occluded by objects, and it can't clip through things.
However, suppose that a fighter flies in front of the glowing engine, occluding the source disk so that only 80 percent of its area is visible to the player. Now, the engine glow's opacity is reduced proportionally, to 80 percent. Similarly, if the player's ship moves such that half of the source disk is offscreen, then the glow opacity is reduced to 50 percent. Naturally, if the disk is fully occluded -- if the player is on the other side of the ship from the engine, for example -- then the glow is completely invisible.
This would only require a single parameter (source radius), and opt-in would be straightforward: if source radius is defined, then the object uses this system; if not, then it behaves as currently.
I think this would dramatically improve the visual behavior of glow-type effects. This system would be useful for engine glows, beam muzzle glows, suns, particles, muzzle flashes, and glowpoints, but beam and engine glows are the most important.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.