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

Entity Shadows #4005

Merged
merged 18 commits into from
Aug 3, 2016
Merged

Entity Shadows #4005

merged 18 commits into from
Aug 3, 2016

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Jun 6, 2016

For #2594
Continuation of #3928 now that the shadows branch is gone.

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.

We talked about potentially using just shadows instead of castShadows and receiveShadows.

  • Deprecate castShadows and receiveShadows
  • Performance testing

@lilleyse lilleyse force-pushed the shadows-entity branch 2 times, most recently from 4942533 to 4ad90cc Compare June 8, 2016 17:27
@lilleyse
Copy link
Contributor Author

lilleyse commented Jun 8, 2016

Entities now have a single shadows property. I am seeing some problems with the checkered entity in the Sandcastle demo, but otherwise this is ready for review.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 10, 2016

We talked about potentially using just shadows instead of castShadows and receiveShadows.

I am all for less code in the higher-level layers, but are we sure about this? If so, why didn't we just do this in the Primitive API?

Separate cast/receive are standard and support all use cases.

The other option is to make this an enum.

@mramato
Copy link
Contributor

mramato commented Jun 10, 2016

Yeah, we talked offline and Dan mentioned some use cases where you would want both. An enum definitely sounds like the right call (perhaps that should have been done at the Primitive layer as well?)

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 10, 2016

perhaps that should have been done at the Primitive layer as well?

It will be easy to deprecate if we go this route.

@shunter
Copy link
Contributor

shunter commented Jun 15, 2016

Given the uncertainty about the properties in this PR I am going to omit the CZML model shadow property merged with #3856 until we have an API that won't change.

@lilleyse
Copy link
Contributor Author

An enum doesn't really seem intuitive from the user's perspective.

I'm ok with reverting back to castShadows and receiveShadows.

@mramato
Copy link
Contributor

mramato commented Jun 21, 2016

An enum doesn't really seem intuitive from the user's perspective.

Why not, it makes the most sense to me and is what we do elsewhere in Cesium. How is this different?

@lilleyse
Copy link
Contributor Author

It just seems overly complicated for the entity api, remembering the enum names is harder than just setting some booleans.

@mramato
Copy link
Contributor

mramato commented Jun 21, 2016

They would not be names, we would have a new enum type. We already do this everywhere else in the Entity API (HorizontalOrigin, VerticalOrigin, etc..) no one has ever complained.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 23, 2016

I am fine with the enum or without it I suppose; it just seems like a lot more plumbing without it.

I agree the enum names are a bit awkward, but could be simple enough:

ENABLED
DISABLED // same as being undefined
CAST_ONLY
RECEIVE_ONLY

@lilleyse perhaps see what is most common in game engines.

@lilleyse
Copy link
Contributor Author

Ok, I'll go with the enum approach. Hopefully today or tomorrow I'll have time to get this ready before the release.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 28, 2016

@lilleyse I see you pushed three new commits. Is this ready or should it wait until 1.24?

@lilleyse
Copy link
Contributor Author

This is ready for review at least. I'm still seeing issues with the checkered box though which I hope to fix soon.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 29, 2016

Let's finish this for 1.24 since 1.23 is on Friday.

@lilleyse
Copy link
Contributor Author

lilleyse commented Jul 8, 2016

This is ready for review, though the Sandcastle demo may crash in certain cases until #4099 is merged.

Given the uncertainty about the properties in this PR I am going to omit the CZML model shadow property merged with #3856 until we have an API that won't change.

@shunter Are there any additional czml changes that I need to make besides what's already here?

@mramato
Copy link
Contributor

mramato commented Jul 14, 2016

Can we generate some performance numbers that compares both load time of vienna.geojson and memory usage after load with master"? It doesn't have to be super rigorous, but the Entity visualization architecture is already long overdue for an overhaul and I just want to make sure we didn't make things substantially worse here.

@lilleyse
Copy link
Contributor Author

Sure I can do that.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 30, 2016

What is the plan here? Will this make 1.24 on Monday?

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 1, 2016

Would it be possible to squeeze this into the release, or should we just wait for the next? The last major change is to add back the castShadows and releaseShadows for certain types just for deprecation purposes.

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 1, 2016

You would have to code this now, right? If so, let's not hold up the release (but go ahead and still make the change now so we can get it into master early for the 1.25 release).

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 1, 2016

Ok

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 1, 2016

@mramato where can I find vienna.geojson?

@mramato
Copy link
Contributor

mramato commented Aug 1, 2016

vienna.geojson.txt

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 1, 2016

In terms of performance:

  • The load time is roughly the same, about 7 seconds each (I didn't get super accurate, just used a stopwatch).
  • The memory difference is around 12MB (the Chrome process used 742MB then 754MB). This is hard to get an accurate reading for by the time you change branches, rebuild, etc, but 12MB was the biggest difference I saw.

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 2, 2016

I added back the deprecated properties and updated CHANGES.md. This is ready for a look now.

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 2, 2016

@mramato please merge when ready.

@mramato
Copy link
Contributor

mramato commented Aug 2, 2016

Merge in master and this is ready. Thanks @lilleyse!

@mramato
Copy link
Contributor

mramato commented Aug 2, 2016

In terms of performance:

Thanks, I think if there were any major issues, they would have been obvious.

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 2, 2016

Did anything change lately with trackedEntity? After merging the view starts out pretty far away in the Shadows demo:
capture

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 3, 2016

This is also noticeable in the 3D Models demo. @tfili the commit is 934828e when something changed.

The correct start view changed to the one below:
capture
capture2

@mramato
Copy link
Contributor

mramato commented Aug 3, 2016

No that I know of, but I can take a quick look. Does this happen in master?

@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 3, 2016

Yeah it's also in master.

@mramato
Copy link
Contributor

mramato commented Aug 3, 2016

Yeah it's also in master.

OK, then I'll merge this and we can look at this later. Can you write up a separate issue so that we don't forget? Thanks!

@mramato mramato merged commit 5328b69 into master Aug 3, 2016
@mramato mramato deleted the shadows-entity branch August 3, 2016 19:04
@lilleyse
Copy link
Contributor Author

lilleyse commented Aug 3, 2016

OK, then I'll merge this and we can look at this later. Can you write up a separate issue so that we don't forget? Thanks!

Sure

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

Successfully merging this pull request may close these issues.

None yet

4 participants