-
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
Conversation
Use cube map for point light shadows
Shadows point light
@@ -505,7 +505,8 @@ define([ | |||
} | |||
|
|||
function screenSpaceError(primitive, frameState, tile) { | |||
if (frameState.mode === SceneMode.SCENE2D) { | |||
// TODO: check for sseDenominator so shadow cameras with orthographic frustum works. check correctness. |
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.
What's the plan with this TODO? Roadmap?
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.
Definitely relevant for the shadows-globe branch, but I can remove it from this.
* @default false | ||
* @private | ||
*/ | ||
dirty : { |
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.
This could just be a regular property without get/set functions.
I submitted a few trivial style tweaks. This is so close! |
Do you also see this error when running the tests? |
Unfortunately this is a side effect of that technique. In the demo you can switch between bias modes, so if you turned it off/on for primitives you would notice the same thing. At some point these values worked well, but I think I can safely reduce them a bit now. |
Yes, when running http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/shadows/Specs/SpecRunner.html?spec=Scene%2FShadowMap I get 27 of
|
Sounds good. Also, if the shadow shift is still noticeable, please document it so users that need ultra precision shadows can tune it. |
Updated. I don't have my laptop with me so it's hard to investigate the OSX/Chrome error... |
var polygonOffsetSupported = true; | ||
if (FeatureDetection.isInternetExplorer) { | ||
polygonOffsetSupported = false; | ||
} | ||
this._polygonOffsetSupported = polygonOffsetSupported; | ||
|
||
// The normalOffset bias pushes the shadows forward slightly, and may be disabled |
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.
Put this in the reference doc so users will see it.
@lilleyse what do you suggest? Wait to merge until we figure out the Mac issue? Or merge now to increase the chances of more people trying it out in master? |
Updated. I was able to test it out and fix the problem. |
The WebGL error is gone, but I have one new shadow map test failure:
The blinking also appears to be fixed, but I thought I saw it one time, but I can't reproduce it. |
Is #2594 completely up-to-date? There are still items above (#3856 (comment)) that are not included. Is this because you plan to do them before we merge this? |
The problem there is most likely a z-fighting issue. I made a small change but I can't verify if it fixes the test. A lot of new aliasing problems like this are caused by changes in the browsers lately. In Chrome 49 polygonOffset seemed to work fine, but now there is no effect when toggling it in the demo. |
All looks good now. I saw the blink again, this time from a stationary view, perhaps due to new terrain tiles loading. If this is a common issue, we'll track it down. |
Also update CHANGES.md in master to include a link to the Sandcastle demo (using the future cesiumjs.org base path). |
Done. |
For #2594
This PR adds support for different types of shadows including cascaded directional shadows, spot light shadows, and point light shadows. It also adds the concept of derived commands which are used for OIT, shadows, and later 3D Tiles.
By default the scene contains a shadow map whose light source is the sun. It is disabled by default, but can be enabled with
scene.shadowMap.enabled = true
.Shadow default settings:
Any of these can change by setting
castShadows
orreceiveShadows
.TODO
GroundPrimitive
if needed.Viewer
.Testing TODO
TODO now or later