Repository navigation
Light the valley fog by the sky and the sun - #324
Merged
Merged
Conversation
…adow uniforms Precipitation drew the clear sky its haze scatters into a small table at each frame, and wired the clouds' shadow map into its shafts; sky-table.js and cloud-cover.js's cloudShadowUniforms now do, for ValleyFog to light its fog by the same sky and through the same clouds.
ValleyFog mixed the scene toward one flat color whatever the sun's direction, where fog looked at toward a low sun is much brighter than away from it. Its light is now the light it scatters: its color tinted by Cesium's clear sky toward the view, from the sky table the rain's haze reads, and the sun's light, in its hue through the air as it lights the clouds, scattered forward in a Henyey-Greenstein lobe of asymmetry 0.8, through the clouds' shadow map a mean free path into the fog when Clouds is active. The `lighting` option, 1 by default, sets how much; 0 keeps the flat color and draws no sky table. Pixels without fog skip it. The haze and the fog share scatteredLight; the sky table takes its height once. The density keeps its ramp under the top: a valley fog fills the valley to its floor. closes TASK-7
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.
ValleyFog mixed the scene toward one flat color whatever the sun's direction; fog looked at toward a low sun is much brighter than away from it. It is now lit by the light it scatters.
ValleyFog: the fog's color tinted by Cesium's clear sky toward the view, plus the sun's light (in its hue through the air) scattered forward in a Henyey-Greenstein lobe (g 0.8), cut by the clouds' shadow map a mean free path into the fog whenCloudsis active. New optionlighting, 0 to 1, 1 by default: this changes the look of existing fog; 0 keeps the flat color and draws no sky table. Pixels without fog skip the work.sky-table.js, the clouds' shadow uniforms tocloud-cover.js'scloudShadowUniforms; the haze and the fog sharescatteredLightin RainHaze.glsl.Tested:
npm test(new valley-fog and cloud-cover tests), typecheck, build, build-demos. Post-process demo, sun 7 degrees high, mean of the lower half of the frame: toward the sun 144/151/165 flat, 161/167/177 lit; away 129/136/147 flat, 123/137/154 lit (bluer). Frame time unchanged, 15.2 to 15.4 ms at 1201 x 647.Not checked in a browser: the fog under
Clouds(no demo has both). Known limits left: the fog's entry point treats the top as flat, so on grazing rays from high above the shadow may be read just above the fog; the sky table is drawn inpreRender, a frame behind after a jump (as Precipitation's was); the table uses Cesium'sTexture/Framebuffer, as Precipitation and Clouds already do.