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 for Primitive entities #3928

Closed
wants to merge 4 commits into from
Closed

Shadows for Primitive entities #3928

wants to merge 4 commits into from

Conversation

lilleyse
Copy link
Contributor

For #2594

I added castShadows and receiveShadows properties to all the applicable entity types. It supports changing these properties at runtime. Batching based on shadows is handled in GeometryVisualizer. Each batch, besides the dynamic batch, is now an array of 4 batches (cast+receive, cast, receive, none). This was the cleanest solution for now, but could get unwieldy if we continue to add more bucket types. I tried and gave up on a unified solution for batching so that we wouldn't need StaticOutlineGeometryBatch, StaticGeometryColorBatch, and in StaticGeometryPerMaterialBatch. Maybe this is worth revisiting in a future rewrite.

I also added the property Viewer.terrainShadows which controls whether the terrain casts shadows. I considered having two properties for cast and receive, but in most cases the user won't be playing around with receive. It seems clearer this way.

@pjcozzi
Copy link
Contributor

pjcozzi commented May 18, 2016

Given the size of this, are we sure it is worth it since it is likely to not be a widely used feature?

Would it be better, to instead, expose very coarse-grained on/off, and keep this parked on this branch until/if it is needed?

Can we push CZML updates to a roadmap?

@mramato
Copy link
Contributor

mramato commented May 18, 2016

We could just have hard-coded behavior that models have shadows but nothing else does. I expect that to be the case for 99% of users.

We could then have ModelVisualizer just key off of the scene-level shadows property and not even bother with per-model control.

If we go that route, I would still leave this branch around until we get feedback

@pjcozzi
Copy link
Contributor

pjcozzi commented May 18, 2016

That would be fine with me. That is the default, I believe.

If we go that route, I would still leave this branch around until we get feedback

Agreed.

@lilleyse
Copy link
Contributor Author

Per-model shadows are already in the shadows branch actually, not part of this PR. While building the arcade game I found it useful to turn shadows off for certain models, granted I was using the scene API and not the entity API but I think people will like that. I agree that primitive support isn't as important, so the changes here could park for a while.

I'll make a separate PR for the Viewer.terrainShadows change and add this to the CZML roadmap.

@lilleyse
Copy link
Contributor Author

Here is a link to the model commit: 5739855

@pjcozzi
Copy link
Contributor

pjcozzi commented May 18, 2016

All sounds good.

@mramato mramato mentioned this pull request May 18, 2016
70 tasks
@pjcozzi
Copy link
Contributor

pjcozzi commented May 28, 2016

What is the plan with this pull request? Close it, and link to the branch in the roadmap?

@lilleyse
Copy link
Contributor Author

The Entity and Shadows roadmaps link to this PR now.

@lilleyse lilleyse closed this May 28, 2016
@pjcozzi pjcozzi mentioned this pull request May 28, 2016
44 tasks
@lilleyse
Copy link
Contributor Author

lilleyse commented Jun 2, 2016

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 6, 2016

@lilleyse given the forum feedback, do you think we should ship this in 1.23? Or is there a simpler approach with less fine-grained control that we can consider?

@lilleyse
Copy link
Contributor Author

lilleyse commented Jun 6, 2016

I think the approach here is ok, is there an alternative that still lets you change the shadows per-entity?

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 6, 2016

Probably not anything reasonable. Does this PR need additional review?

@lilleyse
Copy link
Contributor Author

lilleyse commented Jun 6, 2016

I need to make a few changes to support the new types in #3989, I'll update when ready.

@lilleyse
Copy link
Contributor Author

lilleyse commented Jun 6, 2016

This could also be simplified so that instead of castShadows and receiveShadows it is just shadows.

@mramato
Copy link
Contributor

mramato commented Jun 6, 2016

I think that's a reasonable compromise. I personally can't think of a real-world use case where you would want one without the other.

@lilleyse lilleyse mentioned this pull request Jun 6, 2016
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants