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

Log depth buffer #5851

Merged
merged 82 commits into from
Apr 12, 2018
Merged
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 Sep 26, 2017
36264f7
fixed pickinig issue with log depth buffer
geoscan-builder Sep 27, 2017
e15adbf
removed trailing decimal point to avoid eslint warn
geoscan-builder Sep 27, 2017
bd5428f
added to CONTRIBUTORS
geoscan-builder Sep 27, 2017
ceedc32
fallback to multifrustum if no fragDepth extension
geoscan-builder Sep 27, 2017
d70db84
Update CHANGES.md
Vineg Sep 28, 2017
87f8415
Merge branch 'master' into log-depth-buffer
Vineg Sep 28, 2017
a79138d
added log depth to objects, removed option to turn it off
geoscan-builder Oct 13, 2017
7ee510c
Merge branch 'log-depth-buffer' of https://github.com/geoscan/cesium …
geoscan-builder Oct 13, 2017
7133aa5
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder Oct 13, 2017
4a79331
removed unused variable
geoscan-builder Oct 13, 2017
50c019c
fix wrong require
geoscan-builder Oct 13, 2017
043ebcc
moved extension to logDepth function
geoscan-builder Oct 13, 2017
a65596f
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder Nov 7, 2017
3d5cd2b
fixed polyline v_position
geoscan-builder Nov 10, 2017
451761c
Modified 3d tiles vertex shader.
geoscan-builder Nov 20, 2017
db0630f
fixed 3d tiles picking
geoscan-builder Dec 5, 2017
8191c36
fixed polyline depth
geoscan-builder Dec 29, 2017
2fb7ed2
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder Jan 9, 2018
665909c
fixed interpolation issue
geoscan-builder Jan 9, 2018
bcf1504
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder Jan 9, 2018
22bfd34
removed unnecessary variable
geoscan-builder Jan 9, 2018
9f7c4d8
Merge branch 'cesium-master' into log-depth-buffer
geoscan-builder Feb 9, 2018
417c3f9
fixed some artifacts
geoscan-builder Feb 9, 2018
f5ad7c6
Use uniform semantic for model-view-projection matrix.
bagnell Feb 9, 2018
23f99c2
Use decoded position attribute for log z.
bagnell Feb 9, 2018
33cfca7
Fix classification model log depth.
bagnell Feb 12, 2018
caf032a
Write globe log depth on pick.
bagnell Feb 12, 2018
8d49519
Fix issue with the BIM tileset.
bagnell Feb 13, 2018
b6db381
Fix depth for polylines in a polyline collection.
bagnell Feb 13, 2018
c94e5ad
Update moon.
bagnell Feb 13, 2018
7d716e9
Add missing log depth to appearances, point primitives and vector til…
bagnell Feb 15, 2018
567a110
Fix disable depth test distance.
bagnell Feb 15, 2018
7c46e11
Minor clean up.
bagnell Feb 16, 2018
e331d4c
Use derived commands to enable log depth and disable when using an or…
bagnell Feb 16, 2018
75bd3ba
Fix picking.
bagnell Feb 19, 2018
e62f28b
Merge remote-tracking branch 'origin/master' into log-depth-buffer
bagnell Feb 19, 2018
d681755
Fix shadow mapping and use log depth with OIT.
bagnell Feb 20, 2018
6e07e89
Fix depth plane.
bagnell Feb 20, 2018
90a089b
Re-add multi-frustum for log depth.
bagnell Feb 22, 2018
462d229
Clamp shadow volume depth to far plane only when not using log depth.
bagnell Feb 22, 2018
27447fc
Generate log depth shaders with derived commands when possible.
bagnell Feb 23, 2018
0a628db
Make log z functions for vertex and fragment shader. Change log z fun…
bagnell Feb 24, 2018
afcc7ed
Fix depth picking. Simplify frag depth write. Update gl_Position.z.
bagnell Feb 26, 2018
9cea995
Fix log depth issue with the skip LOD optimization.
bagnell Mar 2, 2018
122ca66
Fix shadows.
bagnell Mar 2, 2018
2f710de
Merge branch 'master' into log-depth-buffer
lilleyse Mar 5, 2018
bcc2dc4
Updated CHANGES.md
lilleyse Mar 5, 2018
4ee738d
Fix 2D. Update some tests.
bagnell Mar 5, 2018
0d90d98
Fix a few tests and updates from review.
bagnell Mar 6, 2018
22ecbe6
Add option to disable log depth. Fix frustum equality and frustum cha…
bagnell Mar 7, 2018
e72c849
Fix billboards not being occluded by the near plane. Fix more tests.
bagnell Mar 8, 2018
3c9c92b
Fix shadow maps without varying eye coordinate. Fix tests.
bagnell Mar 9, 2018
1440a9a
Ignore nodes when searching for model semantics. Fix tests.
bagnell Mar 9, 2018
27118ee
Fix depth picking point clouds with EDL.
bagnell Mar 9, 2018
7fdf9c9
Fix depth picking tests.
bagnell Mar 10, 2018
d94aa07
Updates from review. Fix more tests.
bagnell Mar 12, 2018
1d5adab
Fix tests broken by last commit.
bagnell Mar 12, 2018
e029f10
Fix batched classification test.
bagnell Mar 12, 2018
f14a2cf
Fix inverted classification test.
bagnell Mar 12, 2018
7c06ec8
Fix tests when log depth isn't supported.
bagnell Mar 12, 2018
1635c92
Merge branch 'master' into log-depth-buffer
bagnell Mar 12, 2018
5913ffe
Fixes after merge.
bagnell Mar 12, 2018
a648dea
Updates from review.
bagnell Mar 14, 2018
b6de470
Fix translucent overlap. Fix geometry showing through depth plane. Up…
bagnell Mar 19, 2018
1525950
Fix picking depth which had a hardcoded value for the near plane.
bagnell Mar 20, 2018
6a5a6b0
Fix issue setting enabling/disabling log depth.
bagnell Mar 20, 2018
2f53039
Merge branch 'master' into log-depth-buffer
bagnell Mar 20, 2018
fb3a2b2
Fix eslint errors.
bagnell Mar 20, 2018
530f41d
Fix polyline geometry.
bagnell Mar 26, 2018
78dcea9
Merge branch 'master' into log-depth-buffer
bagnell Apr 2, 2018
979b541
Update CHANGES.md.
bagnell Apr 2, 2018
4dd219f
Fix Draco compressed models.
bagnell Apr 5, 2018
b5f83d9
Update CHANGES.md
bagnell Apr 5, 2018
9bc6e32
Merge branch 'master' into log-depth-buffer
bagnell Apr 5, 2018
d546e45
Move derived commands to own class.
bagnell Apr 5, 2018
e17dbcc
Update multi-frustum tests.
bagnell Apr 5, 2018
6e9fc3e
Use eye coordinates instead of window coordinates in the billboard ve…
bagnell Apr 9, 2018
4cf9479
Merge branch 'master' into log-depth-buffer
bagnell Apr 9, 2018
bed9f0e
Fix NaNs returned by barycentricCoordinates.
bagnell Apr 10, 2018
3419ad5
Fix debug show globe and pick depth.
bagnell Apr 10, 2018
d7d14a5
Rename from review.
bagnell Apr 10, 2018
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
26 changes: 13 additions & 13 deletions Source/Shaders/BillboardCollectionVS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

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.

Copy link
Contributor

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;


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()
Expand Down Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should positionWC and computePositionWindowCoordinates be renamed?

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)
Expand Down