Skip to content

WIP: Cloud scattering prototype#14

Open
mate-h wants to merge 28 commits into
mainfrom
m/clouds
Open

WIP: Cloud scattering prototype#14
mate-h wants to merge 28 commits into
mainfrom
m/clouds

Conversation

@mate-h
Copy link
Copy Markdown
Owner

@mate-h mate-h commented Oct 23, 2025

Objective

  • Add clouds to the atmosphere

Solution

  • Add cloud layer bindings, fbm noise
  • Alternative solution 1 (preferred): use the FogVolume component to create the cloud layer and improve the rendering logic there.
  • Alternative solution 2: use a new ScatteringTerm and the generalized atmosphere parameters with a custom texture somehow.
  • Make sure this also works with the FogVolume rendering which is localized volumes for the scene itself.
  • Limitations: only renders in ray-marched mode, and does not render in the sky-view lut accelerated mode. Not performance optimized, noisy / no TAA

Testing

  • Run atmosphere example

Showcase

Current state:

  • lighting works well with cloud shadow map and filtering pass
  • reflection probe integration works (via generated envmap path)
  • cloud shaping is still a bit WIP, needs proper 3d noise for detail erosion / breakup, and density profiles needs fine-tuning
  • still some visible noise at lower sample counts. time to introduce STBN so noise can be removed with TAA
  • needs PBR pipeline integration (cloud shadow affects ground)
commands.spawn((
        Camera3d::default(),
        Transform::from_xyz(-2.4, 0.04, 0.0).looking_at(Vec3::Y * 0.1, Vec3::Y),
        // get the default `Atmosphere` component
        earth_atmosphere.get(),
        // Can be adjusted to change the scene scale and rendering quality
        AtmosphereSettings::default(),
        AtmosphereSettings {
            rendering_method: AtmosphereMode::Raymarched,
            ..default()
        },
        CloudLayer {
            cloud_layer_start: 6_362_000.0,
            cloud_layer_end: 6_363_000.0,
            cloud_density: 1.0,
            cloud_absorption: 0.00005, // m^-1
            cloud_scattering: 0.0008, // m^-1
            noise_scale: 64_000.0,
            noise_offset: Vec3::ZERO,
            detail_noise_scale: 16_000.0,
            detail_strength: 1.0,
        },
        //...
))
Screenshot 2026-01-06 at 6 38 09 PM

@mate-h mate-h force-pushed the m/clouds branch 3 times, most recently from cf2192f to 3fdd05f Compare October 31, 2025 02:23
@mate-h mate-h changed the base branch from m/atmosphere-occlusion to main December 20, 2025 01:43
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.

1 participant