-
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 for Primitives #3584
Shadows for Primitives #3584
Conversation
@@ -1077,31 +1103,32 @@ define([ | |||
function createShaderProgram(primitive, frameState, appearance) { | |||
var context = frameState.context; |
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.
I should note that primitives that supply their own _createShaderProgramFunction
do not support shadows right now. I believe this is just GroundPrimitive
.
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.
Yes, it's only GroundPrimitive
. Since the polygons are draped on terrain, they don't need to cast shadows. If they are translucent, they probably don't need to receive shadows, but I would wait and test to see how it looks when you have terrain receive shadows.
this.receiveShadows = defaultValue(options.receiveShadows, true); | ||
this._receiveShadows = this.receiveShadows; | ||
|
||
this._shadowsEnabled = true; |
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.
Minor, and up to you, but I didn't know what this was when I first saw it. Maybe _frameStateShadowsEnable
or _sceneShadowsEnabled
is a better name in this context of this file.
Good momentum! @bagnell can merge when ready. |
I would consider this part of the terrain work we discussed offline this morning. |
Yeah, it will be a separate PR. |
Updated. |
For #2594
Primitives now work with shadows. I had to do some tweaking to make shadow casting work for primitives that use relative-to-center, since they hard-coded the camera's view matrix.