Skip to content

Conversation

@mate-h
Copy link

@mate-h mate-h commented Sep 4, 2025

Objective

  • Fix NaNs in scattering integral
  • Fix when the sky turns dark in case of 1 mie scatterer or no scatterers

Solution

  • Add max(extinction, MIN_EXTINCTION) to the scattering integrand denominator to avoid division by zero.
  • The value vec3(1e-12) chosen is arbitrary and I found it has no visual impact on existing coefficients. Can be lowered by a few orders of magnitude safely though.

Testing

  • Current atmosphere example and my own branch with alterations to the atmosphere example

@ecoskey ecoskey merged commit b51148a into ecoskey:feat/general_scattering Sep 5, 2025
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