Merged
Conversation
…lors This commit addresses a bug in the sky rendering implementation that significantly affected the appearance of sunset colors. Key changes: 1. Fixed how optical depth was accumulated and used in the tau calculation, ensuring the atmospheric extinction properly accounts for the full path light travels through the atmosphere 2. Removed the redundant `calculate_sample_scattering()` function and integrated its functionality directly into the main scatter loop for better clarity 3. Added detailed documentation explaining the two approaches to optical depth calculation (accumulated vs per-sample) and their physical implications 4. Ensured the implementation uses the physically accurate accumulated optical depth approach which produces the characteristic red hues at sunset Technical details: - The bug occurred because we were using per-sample optical depth in the tau calculation rather than the cumulative value - Optical depth needs to accumulate along the entire light path to correctly model wavelength-dependent atmospheric scattering (Rayleigh scattering) - The tau calculation now properly uses optical_depth_r + optical_depth_light_r for Rayleigh and optical_depth_m + optical_depth_light_m for Mie - This ensures light traveling through more atmosphere (as at sunrise/sunset) correctly exhibits more pronounced reddening 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit updates the documentation to clarify that accumulated optical depth is the only physically correct approach based on the Beer-Lambert law. Removes misleading references to an alternative approach which would be physically incorrect. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimenting with Claude Code to refactor the sky-sphere implementation.
Details: https://peterbraden.co.uk/article/vibe-coding/