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

Fix lighting issue for translucent geometry in 2D. #2847

Merged
merged 2 commits into from
Jun 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Change Log
* Add `QuantizedMeshTerrainData` constructor argument `orientedBoundingBox`.
* Add `TerrainMesh.orientedBoundingBox` which holds the `OrientedBoundingBox` for the mesh for a single terrain tile.
* Use `OrientedBoundingBox` when rendering terrain and imagery to improve performance of rendering and loading (by up to 50% of terrain/imagery tiles, depending on camera view).
* Fixed 2D and Columbus view lighting issue [#2635](https://github.com/AnalyticalGraphicsInc/cesium/issues/2635).

### 1.10 - 2015-06-01

Expand Down
7 changes: 6 additions & 1 deletion Source/Shaders/Builtin/Functions/translucentPhong.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ vec4 czm_translucentPhong(vec3 toEye, czm_material material)
{
// Diffuse from directional light sources at eye (for top-down and horizon views)
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);

if (czm_sceneMode == czm_sceneMode3D) {
// (and horizon views in 3D)
diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
}

diffuse = clamp(diffuse, 0.0, 1.0);

// Specular from sun and pseudo-moon
Expand Down