-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Log depth buffer #5851
Merged
Merged
Log depth buffer #5851
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
80f5976
added optional logarithmic depth buffer
geoscan-builder 36264f7
fixed pickinig issue with log depth buffer
geoscan-builder e15adbf
removed trailing decimal point to avoid eslint warn
geoscan-builder bd5428f
added to CONTRIBUTORS
geoscan-builder ceedc32
fallback to multifrustum if no fragDepth extension
geoscan-builder d70db84
Update CHANGES.md
Vineg 87f8415
Merge branch 'master' into log-depth-buffer
Vineg a79138d
added log depth to objects, removed option to turn it off
geoscan-builder 7ee510c
Merge branch 'log-depth-buffer' of https://github.com/geoscan/cesium …
geoscan-builder 7133aa5
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder 4a79331
removed unused variable
geoscan-builder 50c019c
fix wrong require
geoscan-builder 043ebcc
moved extension to logDepth function
geoscan-builder a65596f
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder 3d5cd2b
fixed polyline v_position
geoscan-builder 451761c
Modified 3d tiles vertex shader.
geoscan-builder db0630f
fixed 3d tiles picking
geoscan-builder 8191c36
fixed polyline depth
geoscan-builder 2fb7ed2
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder 665909c
fixed interpolation issue
geoscan-builder bcf1504
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder 22bfd34
removed unnecessary variable
geoscan-builder 9f7c4d8
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder 417c3f9
fixed some artifacts
geoscan-builder f5ad7c6
Use uniform semantic for model-view-projection matrix.
bagnell 23f99c2
Use decoded position attribute for log z.
bagnell 33cfca7
Fix classification model log depth.
bagnell caf032a
Write globe log depth on pick.
bagnell 8d49519
Fix issue with the BIM tileset.
bagnell b6db381
Fix depth for polylines in a polyline collection.
bagnell c94e5ad
Update moon.
bagnell 7d716e9
Add missing log depth to appearances, point primitives and vector til…
bagnell 567a110
Fix disable depth test distance.
bagnell 7c46e11
Minor clean up.
bagnell e331d4c
Use derived commands to enable log depth and disable when using an or…
bagnell 75bd3ba
Fix picking.
bagnell e62f28b
Merge remote-tracking branch 'origin/master' into log-depth-buffer
bagnell d681755
Fix shadow mapping and use log depth with OIT.
bagnell 6e07e89
Fix depth plane.
bagnell 90a089b
Re-add multi-frustum for log depth.
bagnell 462d229
Clamp shadow volume depth to far plane only when not using log depth.
bagnell 27447fc
Generate log depth shaders with derived commands when possible.
bagnell 0a628db
Make log z functions for vertex and fragment shader. Change log z fun…
bagnell afcc7ed
Fix depth picking. Simplify frag depth write. Update gl_Position.z.
bagnell 9cea995
Fix log depth issue with the skip LOD optimization.
bagnell 122ca66
Fix shadows.
bagnell 2f710de
Merge branch 'master' into log-depth-buffer
lilleyse bcc2dc4
Updated CHANGES.md
lilleyse 4ee738d
Fix 2D. Update some tests.
bagnell 0d90d98
Fix a few tests and updates from review.
bagnell 22ecbe6
Add option to disable log depth. Fix frustum equality and frustum cha…
bagnell e72c849
Fix billboards not being occluded by the near plane. Fix more tests.
bagnell 3c9c92b
Fix shadow maps without varying eye coordinate. Fix tests.
bagnell 1440a9a
Ignore nodes when searching for model semantics. Fix tests.
bagnell 27118ee
Fix depth picking point clouds with EDL.
bagnell 7fdf9c9
Fix depth picking tests.
bagnell d94aa07
Updates from review. Fix more tests.
bagnell 1d5adab
Fix tests broken by last commit.
bagnell e029f10
Fix batched classification test.
bagnell f14a2cf
Fix inverted classification test.
bagnell 7c06ec8
Fix tests when log depth isn't supported.
bagnell 1635c92
Merge branch 'master' into log-depth-buffer
bagnell 5913ffe
Fixes after merge.
bagnell a648dea
Updates from review.
bagnell b6de470
Fix translucent overlap. Fix geometry showing through depth plane. Up…
bagnell 1525950
Fix picking depth which had a hardcoded value for the near plane.
bagnell 6a5a6b0
Fix issue setting enabling/disabling log depth.
bagnell 2f53039
Merge branch 'master' into log-depth-buffer
bagnell fb3a2b2
Fix eslint errors.
bagnell 530f41d
Fix polyline geometry.
bagnell 78dcea9
Merge branch 'master' into log-depth-buffer
bagnell 979b541
Update CHANGES.md.
bagnell 4dd219f
Fix Draco compressed models.
bagnell b5f83d9
Update CHANGES.md
bagnell 9bc6e32
Merge branch 'master' into log-depth-buffer
bagnell d546e45
Move derived commands to own class.
bagnell e17dbcc
Update multi-frustum tests.
bagnell 6e9fc3e
Use eye coordinates instead of window coordinates in the billboard ve…
bagnell 4cf9479
Merge branch 'master' into log-depth-buffer
bagnell bed9f0e
Fix NaNs returned by barycentricCoordinates.
bagnell 3419ad5
Fix debug show globe and pick depth.
bagnell d7d14a5
Rename from review.
bagnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,23 +71,23 @@ vec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float sca | |
positionEC.xy += halfSize; | ||
} | ||
|
||
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); | ||
float mpp = czm_metersPerPixel(positionEC); | ||
|
||
if (sizeInMeters) | ||
if (!sizeInMeters) | ||
{ | ||
originTranslate /= czm_metersPerPixel(positionEC); | ||
originTranslate *= mpp; | ||
} | ||
|
||
positionWC.xy += originTranslate; | ||
positionEC.xy += originTranslate; | ||
if (!sizeInMeters) | ||
{ | ||
positionWC.xy += halfSize; | ||
positionEC.xy += halfSize * mpp; | ||
} | ||
|
||
positionWC.xy += translate; | ||
positionWC.xy += (pixelOffset * czm_resolutionScale); | ||
positionEC.xy += translate * mpp; | ||
positionEC.xy += (pixelOffset * czm_resolutionScale) * mpp; | ||
|
||
return positionWC; | ||
return positionEC; | ||
} | ||
|
||
void main() | ||
|
@@ -255,14 +255,14 @@ void main() | |
} | ||
#endif | ||
|
||
#ifdef LOG_DEPTH | ||
czm_vertexLogDepth(czm_projection * positionEC); | ||
#endif | ||
|
||
vec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should |
||
gl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); | ||
gl_Position = czm_projection * positionWC; | ||
v_textureCoordinates = textureCoordinates; | ||
|
||
#ifdef LOG_DEPTH | ||
czm_vertexLogDepth(); | ||
#endif | ||
|
||
#ifdef DISABLE_DEPTH_DISTANCE | ||
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; | ||
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to only compute this if
sizeInMeters
is true and still function properly with the new changes? If not, not a big deal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, since it's needed regardless of whether
sizeInMeters
is true or false;