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

Shadows Roadmap #2594

Open
16 of 44 tasks
pjcozzi opened this issue Mar 21, 2015 · 8 comments
Open
16 of 44 tasks

Shadows Roadmap #2594

pjcozzi opened this issue Mar 21, 2015 · 8 comments

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 21, 2015

  • Update the CZML reference doc and czml-writer project for model shadows Shadows #3856 (comment)
  • Globe depth debug view
  • Experimental shadow pass for one light like Scene.pick with a debug view
  • Production shadow pass
    • One updatePrimitives call
    • If the light and its area of influence are outside of the view frustum, skip its shadow pass
    • Expose czm_sunShadowMap like czm_globeDepthTexture
  • Experimental shadows on terrain
  • Architecture for adding shadow-casting lights, and flagging shadow-casting and shadow-receiving objects, e.g., polylines and billboards do not always need to cast shadows.
  • Figure out multifrustum / Cascaded Shadow Maps
  • Point light sources need a cubemap shadow map
  • Update CHANGES.md
  • Possibly support GroundPrimitive at least for receiving shadows
  • Don't use shadow shaders if the primtive/model/tile is outside the shadow region. Mainly applicable to non-cascaded shadow maps, but also when the camera is far enough away from the Earth.
  • Shadows on terrain are jittery, introduced in Shadows - reorganize shaders #3749 when I started to transform v_positionEC to shadow space (instead of gl_Position). This is likely caused by precision issues with v_positionEC in Globe.VS since it does not affect models or primitives.
  • Draw perspective frustum debug outlines to visualize the scene's camera in freeze-frame mode and spot lights.
  • Remove Camera inverse fix before merging with master. Instead resolve Camera clipping terrain fix #3750.
  • Improve shadows when the view distance is vary large and a model is very close. May require a tweaked cascade splitting algorithm. (Perfect log split is pretty good)
  • Cast shadows for terrain tiles that are out of view: on the shadows-globe branch.
  • Use a good LOD when selecting tiles only in the shadow map frustum, e.g., not SSE from the light's perspective
  • Do not request imagery for tiles only in the shadow map frustum
  • Disable globe cast shadows if the globe does not have terrain
  • Ability to toggle shadows on and off for models, like for primitives and globe.
  • Test shadows with cities.
  • Improve architecture and integration with Cesium.
  • Support multiple shadow maps at once.
  • For derived shadow commands we should have a cleaner way of finding if the terrain uses normals.
  • Initially extend the shadow volume backwards to "infinity", find all casters, then clamp the shadow volume to the furthest caster.
  • Improve the calculated near/far plane when the camera is inside a tileset, as shown here.
  • polygonOffset no longer works for rendering into the shadow map as of Chrome 50 (and Firefox equivalent), investigate if the problem is on our end or theirs. More info here.
  • More accurate object vs. light frustum intersection test. Combine the scene camera planes with the light box to form a perfectly fitting light region, at the expense of slightly more plane tests.
    kdop2

Later

  • Color pass and shadow passes should not trash the terrain/imagery cache
  • Shadow pass does not need to load imagery
  • Generate custom shaders for shadow pass that only set depth/discard, not shade
  • Shadows on models and other primitives
  • PCF soft shadows. Experiment with different kernels and filtering types.
  • Improve shadow map culling by using a more precise intersection test : Cull shadow commands #3819 (comment)
  • Use a pass-through fragment shader whenever possible for translucent commands. How can we tell if a translucent material has areas with alpha of 0.0?
  • Explore combining shadow volume and view frustum culling in the same place.
  • When cast-shadow commands come from a spatial data structure - like terrain and 3D Tiles - could culling checks be any more efficient?
  • If needed, look into terrain skirts again : Render terrain skirts when casting shadows #3871
    • Disable for point lights to avoid cracks?
    • Fix issues where the skirt index exceeds the tile indices count. Is this related to upsampling terrain?
  • Shadow support for non-model entities Shadows for Primitive entities #3928
  • 2D and Columbus view support.
  • Support for farther distances like viewing large primitives from space.

Reading

It will only be a small jump from here to add

  • Off-center frustums for multiple monitors and VR.
  • Two passes for VR.
  • cube map pass for reflection/refraction, AO, and IBL.

CC @fstoner

@simonthum
Copy link

We are interested in shadows in cesium and the approach outlined looks like it fits the bill. If I may ask, is there any current development, and is the state of affairs presented here up to date?

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Jun 18, 2015

This is current. See https://github.com/fstoner/cesium/tree/depth-map

@simonthum
Copy link

Thanks a lot!

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Jun 21, 2015

Looks like a nice resource: http://learnopengl.com/#!Advanced-Lighting/Shadows/Shadow-Mapping

@lilleyse lilleyse mentioned this issue Sep 8, 2015
24 tasks
@pjcozzi
Copy link
Contributor Author

pjcozzi commented Sep 26, 2015

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Apr 18, 2016

Support multiple shadow maps at once.

Is this done, excluding multiple lights, of course?

@kjartab
Copy link

kjartab commented Oct 16, 2020

@pjcozzi - the item called "Cast shadows for terrain tiles that are out of view: on the shadows-globe branch." - has any work been done towards it? We using shadows in cesium for buildings and terrain - which works great as long as you point the camera in the sun's direction - but when facing away the shadows dissapear of course. Do you have any idea about how much work this would require to implement? And possibly which part of the source code one would start looking at? Edit: didn't know I was referring to the CEO - maybe someone else can answer?

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Oct 18, 2020

@pjcozzi - the item called "Cast shadows for terrain tiles that are out of view: on the shadows-globe branch."

Hi @kjartab - I don't believe anyone has made progress towards this. It may require a fair amount of work deep in the rendering engine and 3D Tiles LOD selection as the tiles in the shadow frustum need to be requested and this should not interfere with the tile caching for the main rendering pass. If you are familiar with the rendering engine and shadow algorithms, we could probably find someone to point you in the right direction but just a heads up that it might be a large effort. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants