-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing log depth to appearances, point primitives and vector til…
…e polylines.
- Loading branch information
Showing
9 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
17 changes: 10 additions & 7 deletions
17
Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
varying vec3 v_positionMC; | ||
varying vec3 v_positionEC; | ||
varying vec2 v_st; | ||
varying float v_inverse_depth; | ||
|
||
void main() | ||
{ | ||
czm_materialInput materialInput; | ||
|
||
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); | ||
#ifdef FACE_FORWARD | ||
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); | ||
#endif | ||
|
||
materialInput.s = v_st.s; | ||
materialInput.st = v_st; | ||
materialInput.str = vec3(v_st, 0.0); | ||
|
||
// Convert tangent space material normal to eye space | ||
materialInput.normalEC = normalEC; | ||
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); | ||
|
||
// Convert view vector to world space | ||
vec3 positionToEyeEC = -v_positionEC; | ||
vec3 positionToEyeEC = -v_positionEC; | ||
materialInput.positionToEyeEC = positionToEyeEC; | ||
|
||
czm_material material = czm_getMaterial(materialInput); | ||
#ifdef FLAT | ||
|
||
#ifdef FLAT | ||
gl_FragColor = vec4(material.diffuse + material.emission, material.alpha); | ||
#else | ||
gl_FragColor = czm_phong(normalize(positionToEyeEC), material); | ||
#endif | ||
|
||
czm_logDepth(v_inverse_depth); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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