Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural IBL Enhancement in CesiumJS #12129

Merged
merged 47 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1c587ce
Draft
ggetz Jul 17, 2024
c0f6f89
Merge branch 'main' into procedural-ibl
ggetz Jul 17, 2024
d835dd1
Merge remote-tracking branch 'origin/ibl-roughness' into procedural-ibl
ggetz Jul 17, 2024
af28f30
Draft
ggetz Jul 25, 2024
ba94101
Draft
ggetz Jul 30, 2024
c4c734c
Merge branch 'main' into procedural-ibl
ggetz Aug 2, 2024
e303b72
Merge remote-tracking branch 'origin/ibl-cubemaps' into procedural-ibl
ggetz Aug 2, 2024
a59ef54
Convolve specular maps
ggetz Aug 6, 2024
7532157
Merge remote-tracking branch 'origin/ibl-multiscatter' into procedura…
ggetz Aug 6, 2024
3e7e4ec
Draft
ggetz Aug 7, 2024
d0a72cd
cleanup
ggetz Aug 9, 2024
f0f1cd4
Merge branch 'main' into procedural-ibl
ggetz Aug 9, 2024
1e1ef3c
Cleanup, add color modifiers
ggetz Aug 13, 2024
e9ac951
Merge branch 'main' into procedural-ibl
ggetz Aug 13, 2024
9930587
Dynamic lighting
ggetz Aug 13, 2024
7458f0a
Hook up 3D Tiles
ggetz Aug 16, 2024
84bbd77
Cleanup
ggetz Aug 16, 2024
53d45a0
Cleanup, fix race condition
ggetz Aug 19, 2024
b85a22e
Fix sky orientation
ggetz Aug 20, 2024
5b4ee24
Cleanup inline doc
ggetz Aug 20, 2024
0a1a8c7
Shader cleanup
ggetz Aug 20, 2024
eb90daa
Update CHANGES.md
ggetz Aug 26, 2024
21045b7
Minor environment map updates
ggetz Aug 26, 2024
c870ca2
Minor updates, spec fixes
ggetz Aug 28, 2024
092f9b7
Spec cleanup
ggetz Aug 28, 2024
3f8c1b1
Spec updates for environment maps
ggetz Aug 29, 2024
298de97
Draft
ggetz Sep 3, 2024
cca3a73
Merge branch 'main' into procedural-ibl
ggetz Sep 11, 2024
feae2a9
Merge branch 'main' into procedural-ibl
ggetz Sep 25, 2024
6b2adb1
Performance pass, cleanup
ggetz Oct 2, 2024
3597350
Performance pass and cleanup
ggetz Oct 3, 2024
4a868aa
Merge branch 'main' into procedural-ibl
ggetz Oct 3, 2024
3bb4c37
Prettier
ggetz Oct 3, 2024
8a96cc2
Update SAndcastle examples
ggetz Oct 3, 2024
bca4341
Unit test fixes
ggetz Oct 3, 2024
8dcf25d
Fix model specs
ggetz Oct 3, 2024
bdc4d15
Fix specs, last SH coefficient
ggetz Oct 4, 2024
219ba6d
Fix import
ggetz Oct 4, 2024
17690a1
Specs fixes for --webgl-stub
ggetz Oct 4, 2024
2d6bc61
Fix docs, update IBL example
ggetz Oct 4, 2024
15ff41c
Merge branch 'main' into procedural-ibl
ggetz Oct 15, 2024
2b3907c
Account for ground albedo
ggetz Oct 15, 2024
abd0e39
Update lighting example
ggetz Oct 15, 2024
12588d2
Fix height
ggetz Oct 22, 2024
4d73f3d
Code cleanup from review
ggetz Oct 23, 2024
b9b2f0e
Update Sandcastle example
ggetz Oct 25, 2024
2cbd195
Spec updates
ggetz Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 3 additions & 39 deletions Apps/Sandcastle/gallery/Image-Based Lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,7 @@
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<table>
<tbody>
<tr>
<td>Luminance at Zenith</td>
<td>
<input
type="range"
min="0.0"
max="2.0"
step="0.01"
data-bind="value: luminanceAtZenith, valueUpdate: 'input'"
/>
<input type="text" size="4" data-bind="value: luminanceAtZenith" />
</td>
</tr>
</tbody>
</table>
</div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
window.startup = async function (Cesium) {
"use strict";
Expand Down Expand Up @@ -145,26 +127,8 @@
ibl.sphericalHarmonicCoefficients = coefficients;
ibl.specularEnvironmentMaps = environmentMapURL;

// The viewModel tracks the state of our mini application.
const viewModel = {
luminanceAtZenith: ibl.luminanceAtZenith,
};
// Convert the viewModel members into knockout observables.
Cesium.knockout.track(viewModel);

// Bind the viewModel to the DOM elements of the UI that call for it.
const toolbar = document.getElementById("toolbar");
Cesium.knockout.applyBindings(viewModel, toolbar);

function subscribeParameter(name) {
Cesium.knockout
.getObservable(viewModel, name)
.subscribe(function (newValue) {
ibl[name] = newValue;
});
}

subscribeParameter("luminanceAtZenith");
model.environmentMapManager.groundColor =
Cesium.Color.fromCssColorString("#292817");

Sandcastle.addToggleButton(
"Use procedural environment lighting",
Expand Down
1 change: 1 addition & 0 deletions Apps/Sandcastle/gallery/Japan Buildings.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
// Set up a light to come from the camera to always highlight the buildings
const cameraLight = new Cesium.DirectionalLight({
direction: scene.camera.directionWC, // Updated every frame
intensity: 2.0,
});
scene.globe.enableLighting = true;
scene.globe.dynamicAtmosphereLightingFromSun = false;
Expand Down
7 changes: 7 additions & 0 deletions Apps/Sandcastle/gallery/Lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@
0.8842635425193919,
0.39729481195458805,
),
intensity: 2.0,
});

const flashlight = new Cesium.DirectionalLight({
direction: scene.camera.directionWC, // Updated every frame
intensity: 3.0,
});

const moonLight = new Cesium.DirectionalLight({
Expand Down Expand Up @@ -159,6 +161,7 @@
scene.light = sunLight;
scene.globe.dynamicAtmosphereLighting = true;
scene.globe.dynamicAtmosphereLightingFromSun = false;
scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.NONE;
setTime("2020-01-09T23:00:39.018261982600961346Z");
}

Expand Down Expand Up @@ -198,13 +201,17 @@
reset();
scene.light = moonLight;
scene.globe.dynamicAtmosphereLightingFromSun = true;
scene.atmosphere.dynamicLighting =
Cesium.DynamicAtmosphereLightingType.SCENE_LIGHT;
setTime("2020-01-10T05:29:41.17946898164518643Z");
},
},
{
text: "Sunlight",
onselect: function () {
reset();
scene.atmosphere.dynamicLighting =
Cesium.DynamicAtmosphereLightingType.SUNLIGHT;
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions Apps/Sandcastle/gallery/Physically-Based Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

viewer.scene.globe.enableLighting = true;
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.scene.atmosphere.dynamicLighting =
Cesium.DynamicAtmosphereLightingType.SUNLIGHT;

const position = new Cesium.Cartesian3(
-1371108.6511167218,
Expand Down
Loading