Skip to content

Fix Volumetric Nebula Bugs and Add Smoothing#6854

Merged
BMagnu merged 5 commits into
scp-fs2open:masterfrom
BMagnu:voluemtric_fixes
Jul 24, 2025
Merged

Fix Volumetric Nebula Bugs and Add Smoothing#6854
BMagnu merged 5 commits into
scp-fs2open:masterfrom
BMagnu:voluemtric_fixes

Conversation

@BMagnu

@BMagnu BMagnu commented Jul 22, 2025

Copy link
Copy Markdown
Member

This fixes three bugs in volumetrics:

  1. Sometimes, volumetric nebulae would suddenly darken a lot when viewed against the sun. This was due to numerical imprecision in emissive handling. Clamping the emissive inputs from 0 to 1 fixes this
  2. Oversampling was calculating its indices and divisors incorrectly, causing two resulting symptoms. For one, the nebula's edge was less properly smoothed and more artificially noisy, causing a slightly blocky appearance. Additionally, it would cause the volumetrics UDF to be incorrect within the nebula. This isn't a huge issue in and of itself, but would cause problems if anyone tries to rely on it in the future.
  3. It now properly alpha-blends nebula and background, instead of doing so purely additively.

Furthermore, if I'm already touching the oversampling logic, I can also add index-shift logic that allows for smoothing the volume texture rendered from the POF, which allows to have volumetric nebula with less hard edges.

To illustrate this, three screenshots.

  1. Old / Broken Behaviour:
Screenshot_20250722_151958 2. New Behaviour: Screenshot_20250722_151554 4. Smoothing set to 1/16th: image

While I have added missionsave code for the smoothing property, I currently do not have a machine with VS installed or a compiler setup that would be able to build or test FRED, as such, the new property cannot yet be set through the GUI, but it should persist if added in a text editor.

@BMagnu BMagnu added this to the Release 25.0 milestone Jul 22, 2025
@BMagnu BMagnu added fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d) labels Jul 22, 2025

@wookieejedi wookieejedi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice update and looks straight forward!

@BMagnu BMagnu merged commit 755c4c4 into scp-fs2open:master Jul 24, 2025
20 checks passed
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this pull request Jul 25, 2025
FRED support for the smoothing field added in scp-fs2open#6854.
Goober5000 added a commit to Goober5000/fs2open.github.com that referenced this pull request Jul 26, 2025
FRED support for the smoothing field added in scp-fs2open#6854.
BMagnu pushed a commit that referenced this pull request Jul 26, 2025
FRED support for the smoothing field added in #6854.
Kestrellius pushed a commit to Kestrellius/fs2open.github.com that referenced this pull request Jul 26, 2025
* Fix 3d tex generation

* Fix blending and emissive

* Add Smoothing

* Add smoothing parameter

* Correctly calculate fractional smoothing
Kestrellius pushed a commit to Kestrellius/fs2open.github.com that referenced this pull request Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants