Skip to content

Commit

Permalink
Merge pull request #12484 from andrewda/orthographic-groundatmosphere
Browse files Browse the repository at this point in the history
Fix ground atmosphere shaders in 3D orthographic mode
  • Loading branch information
ggetz authored Feb 20, 2025
2 parents 42ae05c + 24a3f33 commit 8ca3597
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Exposed `CustomShader.prototype.destroy` as a public method. [#12444](https://github.com/CesiumGS/cesium/issues/12444)
- Fixed error when there are duplicated points in polygon/polyline geometries with `ArcType.RHUMB` [#12460](https://github.com/CesiumGS/cesium/pull/12460)
- Fixed ground atmosphere shaders in 3D orthographic mode [#12484](https://github.com/CesiumGS/cesium/pull/12484)
- Fixed zoom in 3D orthographic mode [#12483](https://github.com/CesiumGS/cesium/pull/12483)

## 1.126 - 2025-02-03
Expand Down
11 changes: 10 additions & 1 deletion packages/engine/Source/Shaders/GlobeFS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,16 @@ vec3 computeEllipsoidPosition()
vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
xy *= czm_viewport.zw * mpp * 0.5;

vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));
vec3 direction;
if (czm_orthographicIn3D == 1.0)
{
direction = vec3(0.0, 0.0, -1.0);
}
else
{
direction = normalize(vec3(xy, -czm_currentFrustum.x));
}

czm_ray ray = czm_ray(vec3(0.0), direction);

vec3 ellipsoid_center = czm_view[3].xyz;
Expand Down

0 comments on commit 8ca3597

Please sign in to comment.