-
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
Shadows #3856
Merged
Shadows #3856
Changes from 1 commit
Commits
Show all changes
310 commits
Select commit
Hold shift + click to select a range
1a6a07b
Merge branch 'master' into shadows
lilleyse 5190927
Fit to scene near and far
lilleyse 7c0cb2c
Rename farPlane to distance
lilleyse 5759fa3
Change lamda to 1.0
lilleyse 9b25230
Rename fitToScene to cascadesEnabled
lilleyse 11bdd01
Reorganize for point lights
lilleyse 3da9583
Support point lights
lilleyse 4876a80
Fallback if depth FBO fails
lilleyse e2f05f6
Use cube map for point light shadows
lilleyse 692750b
Combine uniforms
lilleyse 9310f79
Merge pull request #3718 from AnalyticalGraphicsInc/shadows-point-light2
pjcozzi 0fe2fd5
Handle shadow near/far better
lilleyse b4c2a3b
Add TODO
lilleyse 9726ff4
Use separate fbo for each cubemap face
lilleyse 7a5ec46
Rename sunShadowMap to shadowMap
lilleyse a98cbe8
Only update point light cameras when point light moves
lilleyse 15c0362
Remove extra line
lilleyse 162e5d0
Destroy fbo resources correctly for cube maps
lilleyse 3ebb190
Make render states immutable
lilleyse 1acd59f
Small tweak
lilleyse a471f00
Merge pull request #3711 from AnalyticalGraphicsInc/shadows-point-light
bagnell c34739f
Simplify non-cube-map point shadows by always using a color texture
lilleyse 1c18a56
Added pcf shadows
lilleyse 01d86c1
Make softShadows public
lilleyse 87b5c3f
Rename stepSize to texelStepSize
lilleyse 294e874
Merge pull request #3731 from AnalyticalGraphicsInc/shadows-soft
bagnell 9ea57e4
Cleanup shader code
lilleyse 6269e1a
Separate shaders for easier readability
lilleyse da584b1
Reset globe shaders when shadow map demo changes
lilleyse b74db10
Tweak
lilleyse e5ae12e
Merge pull request #3749 from AnalyticalGraphicsInc/shadows-cleanup
pjcozzi ba5042d
Merge pull request #3753 from AnalyticalGraphicsInc/shadows-globe-sha…
pjcozzi a35a7c5
Added graying out for UI options as in #3755
lasalvavida 6d1836a
Changed the UI enable/disable to use knockout
lasalvavida 74c9423
Merge branch 'shadows' of github.com:AnalyticalGraphicsInc/cesium int…
lasalvavida 0fa4ab7
Fixed the error in the dropdowns and checkboxes and a few style changes
399f786
Missing semicolon
lilleyse ce1260f
Merge pull request #3761 from lasalvavida/shadows-sandcastle-ui
lilleyse c5a8266
Add normal biasing to improve terrain shadows and add biasing options…
lilleyse a3c6424
Fade out shadow map
lilleyse 4e06072
Added UI options for switching models and locations
lasalvavida 1941cea
Removed empty table row
lasalvavida 58f16c9
Merge pull request #3773 from lasalvavida/shadows-sandcastle-ui
lilleyse a0255d2
Fix point shadow shader
lilleyse 93961fb
Merge branch 'shadows' into shadows-terrain-aliasing
lilleyse b3c0b8f
Merge branch 'master' into shadows
lilleyse 22e3d84
No longer need to pass shadow map into UniformState.update
lilleyse 2b28265
Use different bias parameters for terrain and primitives
lilleyse fddd9d1
Added more sample models and locations, and added point light biasing…
lilleyse db6026e
Merge branch 'shadows' into shadows-terrain-aliasing
lilleyse 3e5a10e
Added support for spot lights
lilleyse 6baeee8
Remove visibility check for now
lilleyse 42867f2
Random point light fixes
lilleyse ededdf0
Support exponential shadow maps, without perfiltering
lilleyse d5a6a24
Remove procedural shadow receiver code to GLSL files that are
bagnell 0558e39
Merge branch 'shadows-terrain-aliasing' into shadows-shaders
bagnell 4c50abb
Update after merge.
bagnell 4804dbe
Remove unused file.
bagnell 5772061
Fix terrain casting for point shadows
lilleyse 0d4d6bc
Merge branch 'shadows-terrain-aliasing' into shadows-shaders
bagnell 335c3d8
Merge branch 'master' into shadows-terrain-aliasing
lilleyse dcabbf7
Make cube map texture coordinates to 2D texture coordinates a built-i…
bagnell 60a2099
Factor out some code common to all light types.
bagnell 048c264
Move shadow bias options to uniforms.
bagnell 74bfe19
Don't cast shadows when picking
lilleyse 907d46a
Small fixes
lilleyse be7bade
Added city-like model
lilleyse 0b7138e
Fix globe shadow flickering by using more precise v_positionEC
lilleyse 995063e
Use maximum depth instead of the last cascade depth to prevent early …
lilleyse 1c94955
Merge branch 'master' into shadows
lilleyse ed8bd4b
Merge branch 'shadows' into shadows-terrain-aliasing
lilleyse e172d18
Remove shadow map automatic uniforms in favor of per-shadow map unifo…
bagnell e93fecf
Merge branch 'shadows-terrain-aliasing' into shadows-shaders
bagnell f81b190
Add some unit tests for new built-in GLSL functions.
bagnell 7ee7c8e
Merge branch 'shadows-shaders' into shadows-uniforms
bagnell d17b1c5
Fix uniform declaration in shadow receive shader and update debug shadow
bagnell 79cee33
Remove shadowMap property from UniformState.
bagnell 086b6f1
Fix defines
lilleyse 715b615
Fix cascade colors
lilleyse b8b81e8
Formatting
lilleyse a66edd0
Remove line
lilleyse 7ee8b1e
Merge pull request #3794 from AnalyticalGraphicsInc/shadows-shaders
lilleyse 872887d
Add UI options for globe visible and terrain enabled
lilleyse 40355e5
Draw debug outlines for cameras and spot lights
lilleyse 7921031
Merge pull request #3765 from AnalyticalGraphicsInc/shadows-terrain-a…
bagnell e8a6506
Merge branch 'shadows' into shadows-uniforms
bagnell f67bedc
Updates after merge.
bagnell 0182314
Fix viewport quad for point lights.
bagnell 91e5fb6
Remove unused automatic glsl function.
bagnell 17703b6
Pack some of the shadow uniforms.
bagnell ed73322
Remove uniforms from built-in functions.
bagnell ec31d22
Move shadowMapMaximumDistance
lilleyse 3430d8a
Fix resetting globe
lilleyse be8903a
Remove unneeded getters
lilleyse f58ded2
Cull shadow commands
lilleyse cd5d935
Use scratch variables when setting shadow uniforms.
bagnell 9186a74
Merge pull request #3809 from AnalyticalGraphicsInc/shadows-uniforms
lilleyse d02af2b
Merge branch 'master' into shadows-derived
bagnell 7b943e8
Merge branch 'shadows' into shadows-commands
lilleyse 06ef64e
Shadows derived commands WIP.
bagnell 9dbb5c3
Use numberOfPasses
lilleyse c5056eb
Derived shadows commands WIP.
bagnell ae48196
Fix precision issues with spot lights
lilleyse cc09976
getTerrainShadowCommands temp
lilleyse b6782a1
Fix derived commands for casting shadows.
bagnell 7496e43
Add temporary fix for receiving shadows on terrain.
bagnell 1f35060
Improve performance/clean up shadow derived command creation.
bagnell 420f7c6
Clean up additional primitive shadow management code. All that is needed
bagnell f2c57dd
Fix translucent shadow receivers... sort of.
bagnell 4dd182b
Check terrain shader defines for position and normal varyings.
bagnell b5c45ea
Added a test version of getTerrainShadowCommands
lilleyse def5187
Added radiusSquared
lilleyse 40a68bc
Added grid button
lilleyse 0582b1f
Check when shadow map is out of view and needs update
lilleyse 89e3520
Merge branch 'master' into shadows
lilleyse 86dbe8a
Merge branch 'master' into shadows-derived
lilleyse 7663acb
Merge branch 'shadows' into shadows-derived
lilleyse 6babfbd
Merge branch 'shadows-commands' into shadows-multiple
bagnell f886f4d
Cleanup
lilleyse a462328
Make combineUniforms a local function
lilleyse bdab5c7
Organize createShadowCastFragmentShader
lilleyse c30e606
Add TODO for 3d-tiles
lilleyse 3b9bffa
Add back terrain normals when receiving shadows.
bagnell 72468ab
Changes based on review.
bagnell 916050d
Merge branch 'shadows-derived' into shadows-merged
bagnell 249322a
Merge branch 'shadows-commands' into shadows-merged
bagnell 21f79df
Temporarily disable globe update when getting terrain commands.
bagnell 8648679
Move around shadow map and globe updates. Make an array of shadow maps.
bagnell aba1981
Add ability to render to multiple shadow maps.
bagnell cd647c2
Merge pull request #3828 from AnalyticalGraphicsInc/shadows-derived
lilleyse 465d88a
Rename pass to shadowPass
lilleyse 32afa8e
Change angle check from 0.1 to 0.05
lilleyse 481b239
Merge branch 'shadows' into shadows-commands
lilleyse bd98b6b
Add Sandcastle example to for multiple shadow maps and demonstrates t…
bagnell b3c5fcf
Merge branch 'shadows' into shadows-multiple
bagnell 16da6a8
Add temporary fix for shadow casters
lilleyse 6471382
Prevent crash when shadow map is not enabled
lilleyse 8409ee6
Fix positionCartographic
lilleyse de6192e
Reduce terrain aliasing
lilleyse 7436308
Improve shadow quality for the closest cascade
lilleyse 0d1b1f1
Model can toggle casting or receiving shadows at runtime
lilleyse fee0316
Remove renderState getters
lilleyse 282e963
Don't render terrain skirts for shadow casters
lilleyse b756123
Change Camera back to inverseTransformation
lilleyse 833f158
Remove unneeded normalize in GlobeFS
lilleyse 9cb906f
Turn off normal shading if cast shadows is false
lilleyse 4f1b65e
Added button for terrain receive shadows
lilleyse 6407d78
Fix visibility check after 0582b1f
lilleyse 49cb616
Fix broken 2d view
lilleyse 2cffb31
Add more model position options, including space
lilleyse 1bd1c37
Slight bias tweaks
lilleyse f1ede3c
Merge branch 'shadows-commands' into shadows-multiple
bagnell 5677298
Revert changes to shadows Sandcastle example.
bagnell e59ef50
Updates after merge.
bagnell 9ef9d74
Merge pull request #3848 from AnalyticalGraphicsInc/shadows-misc
bagnell ad94eb8
Merge branch 'shadows-commands' into shadows-multiple
bagnell 1b89577
Update after merge.
bagnell 524e431
Formatting
lilleyse 6198cfb
Remove FrameState.shadowMap
lilleyse 9c6f37f
Remove TODO
lilleyse 5538b42
Fix camera clone bug
lilleyse ba3a661
Tweak point light bias
lilleyse df04f64
Added shadow darkness uniform
lilleyse 5626da7
Increase default maximum shadow distance
lilleyse 21faca4
Added model with transparent texture
lilleyse a28d349
Only set maximum cascade sizes when the scene camera is close
lilleyse 1abfe29
Merge pull request #3852 from AnalyticalGraphicsInc/shadows-multiple
lilleyse cf89f82
Merge pull request #3855 from AnalyticalGraphicsInc/shadows-misc
bagnell ebc10e8
Merge pull request #3819 from AnalyticalGraphicsInc/shadows-commands
bagnell 410a67f
Merge branch 'master' into shadows
lilleyse 2bc9ef6
Whitespace
pjcozzi ff496a3
Style tweak
pjcozzi 0bec97d
Address shadow PR comments
lilleyse b4329bf
Add _maximumCascadeDistances
lilleyse d562705
Remove exponential shadow maps
lilleyse 425eaf8
Change uniform prefix
lilleyse a07275c
Move comment out of shader source
lilleyse 6f581c3
Modify depth bias to prevent z-fighting
lilleyse 6ac19e1
Remove shadowDistance from shaders
lilleyse 2688045
Combine shadows with vertex lighting for better night shading
lilleyse 195e600
Merge branch 'master' into shadows
bagnell 434dbed
Simplify Sandcastle
lilleyse 0c8fe3d
Tweak cascade maxes for more detail near smaller objects
lilleyse 32956e5
Add back rendering skirts when casting shadows.
bagnell c5f0f98
Merge pull request #3871 from AnalyticalGraphicsInc/shadows-skirts
lilleyse 28394ff
Make default shadow map size 2048 and fall back to 1024.
bagnell 34f7872
Move default size check to setSize.
bagnell 7b23493
Create culling volume from bounding sphere for point lights.
bagnell 975e9fa
Compute culling planes manually.
bagnell 3a62fae
Organization and removed _shadowMapSize
lilleyse ecec509
Merge pull request #3872 from AnalyticalGraphicsInc/shadows-default-size
lilleyse 3957a62
Add maxmimumDistance to ShadowMap options
lilleyse 5739855
Add shadow properties to Viewer and Entity
lilleyse 68b878e
Merge pull request #3875 from AnalyticalGraphicsInc/shadows-entity
pjcozzi 4a2c81e
Remove czm_cubeMapToUV spec check
lilleyse fc3fd7b
Merge branch 'master' into shadows
bagnell bb56929
Fix failing spec
lilleyse 47e917a
Merge branch 'shadows' into point-culling-volume
bagnell a3b1e4c
Add tests for culling volume constructed from bounding sphere.
bagnell 75b6b61
Add doc and test developer errors for required parameters.
bagnell fecb4d5
Don't be so strict with updating cascaded shadows since in most cases…
lilleyse 36c5071
Merge branch 'bounding-sphere-culling-volume' into point-culling-volume
bagnell 5310657
Merge branch 'shadows' into point-culling-volume
bagnell d621ee0
Merge branch 'master' into shadows
bagnell 9027b9c
Merge branch 'shadows' into point-culling-volume
bagnell 5240533
Fix jsHint errors.
mramato 0f71243
Use culling volume from point light bounding sphere to cull primitives.
bagnell ccda0e0
Merge branch 'master' into shadows
bagnell 4e6522e
Merge branch 'shadows' into point-culling-volume
bagnell 9b0135c
Update the globe for each face of the shadow cube map.
bagnell 2225059
Update derived commands when shadow maps are dirty
lilleyse 62e281f
Tweaked some descriptions
lilleyse dd1f7ac
Added terrainEnabled property to viewer
lilleyse 6759ba3
Disable shadow updates during pick pass
lilleyse 7e1e66e
Merge pull request #3929 from AnalyticalGraphicsInc/shadows-picking-fix2
pjcozzi 118f9ac
Merge pull request #3931 from AnalyticalGraphicsInc/shadows-viewer
pjcozzi 32f25f3
Added simple shadows sandcastle
lilleyse 37d92e0
Added Sandcastle image
lilleyse a93f019
Update Sandcastle
lilleyse ba4b10d
Updated CHANGES.md
lilleyse 2e92beb
Vertically align buttons
lilleyse 0d39ddc
Merge pull request #3876 from AnalyticalGraphicsInc/shadows-simple-sa…
pjcozzi fa0bb0d
Merge branch 'shadows' into point-culling-volume
bagnell 4e571c8
Merge pull request #3918 from AnalyticalGraphicsInc/point-culling-volume
lilleyse 9baca72
Fixed up private variables in doc
lilleyse b995e91
Most of the shadows tests
lilleyse 320d3a8
Add globe tests
lilleyse dc643c0
Avoid using the same globe
lilleyse 366558a
Remove unused ShadowMap getters
lilleyse 0e859eb
Merge pull request #3958 from AnalyticalGraphicsInc/shadows-tests
pjcozzi a713da7
Update derived commands even if shadow is not visible. The shadowsDir…
bagnell 49f44e7
Don't use outOfView anymore
lilleyse 2ddf6d9
Merge pull request #3969 from AnalyticalGraphicsInc/shadows-derived
lilleyse cdf0a72
Fix IE tests
lilleyse fe0b5d1
Set polygonOffset to false for point lights
lilleyse 3e8b839
Handle incomplete FBO
lilleyse 65219f8
Cleanup globe shadows and shadowsEnabled
lilleyse 6d4a410
Fix depth aliasing
lilleyse 13cbcd7
Merge branch 'master' into shadows
lilleyse 756ed36
Remove TODO
lilleyse 511f5d1
Merge pull request #3973 from AnalyticalGraphicsInc/shadows-ie-tests
pjcozzi 3214936
Fix whitespace
pjcozzi b38d1a1
Whitespace
pjcozzi 0963097
Style tweak
pjcozzi c21ae31
Style tweaks
pjcozzi 42dad26
Many small updates
lilleyse c688b0a
Fix FBO incomplete error
lilleyse 73c6631
Tweaks
lilleyse c8288b4
Depth fix
lilleyse 4713e12
Merge branch 'master' into shadows
lilleyse 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
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
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 |
---|---|---|
|
@@ -554,7 +554,8 @@ define([ | |
this._sunCamera = new Camera(this); | ||
|
||
/** | ||
* Render shadows in the scene. | ||
* The shadow map in the scene. When enabled, models, primitives, and the globe may cast and receive shadows. | ||
* By default the light source of the shadow map is the sun. | ||
* @type {ShadowMap} | ||
*/ | ||
this.shadowMap = new ShadowMap({ | ||
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. This property is not in CHANGES.md and the reference doc is a bit lacking. |
||
|
@@ -1094,15 +1095,15 @@ define([ | |
if (shadowsEnabled && (command.receiveShadows || command.castShadows)) { | ||
// Update derived commands when any shadow maps become dirty | ||
var lastDirtyTime = frameState.shadowHints.lastDirtyTime; | ||
if (command._lastDirtyTime !== lastDirtyTime) { | ||
command._lastDirtyTime = lastDirtyTime; | ||
command._dirty = true; | ||
if (command.lastDirtyTime !== lastDirtyTime) { | ||
command.lastDirtyTime = lastDirtyTime; | ||
command.dirty = true; | ||
shadowsDirty = true; | ||
} | ||
} | ||
|
||
if (command._dirty) { | ||
command._dirty = false; | ||
if (command.dirty) { | ||
command.dirty = false; | ||
|
||
var derivedCommands = command.derivedCommands; | ||
|
||
|
Oops, something went wrong.
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 this member really needed? It is only used in one place after the constructor.
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.
It is needed for now, but only because someone could change
Scene.shadowMap
to something else, like in the Sandcastle.