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

Post process updates #6680

Merged
merged 9 commits into from
Jun 19, 2018
Merged

Post process updates #6680

merged 9 commits into from
Jun 19, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Jun 12, 2018

From comments in #6476.

@cesium-concierge
Copy link

Signed CLA is on file.

@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@lilleyse lilleyse mentioned this pull request Jun 14, 2018
4 tasks
Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the code updates look good! Just one comment about the new Sandcastle demo.

primitive = primitives.get(i);
if (primitive.id === entity) {
remove();
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't have a better way to get the primitive from an entity, but this function almost seems too complicated to be part of a Sandcastle demo. Maybe the demo should do picking like the other per-feature post processing demo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so too, but I couldn't find any examples where we get the model from an entity. I know this was asked for a few times on the forum so now we can point to this example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern is once it's in Sandcastle it's considered the right way to do something. Do we want to endorse this as the way to get the primitive from the entity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I think we on-purpose made it impossible for someone to get the primitive through the Entity API. We generally don't want end-users to interact with the primitive if they're using the Entity API because there can be unexpected side-effects. Maybe we should find a way to enable this via Entity API directly before adding this kind of workaround in a Sandcastle example. @mramato do you have any input here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked offline with @mramato when I opened the per-feature post process PR. He said we might be able to add a one-to-one mapping for entity to primitive in the future. In the meantime, this was the way to do it. Until we decide what to do I changed this to use picking like the other Sandcastle example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest having scene.pick return the entity and object describing the primitive (ie the Entity and PolygonGraphics) but we can figure that out later. This is fine for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there are a lot of dragons here because (by design) the entity data and entity visualization are decoupled and there isn't a one-to-one mapping anywhere in the system. A primitive knows what entity it is representing in a given frame, but an entity can be represented by any number of primitives and it has no idea what those primitives are. There's a lot of good reasons for doing it this way, but there are obvious use cases where we say "I want the Model for this Entity". We can certainly chose to more tightly couple entities and primitives, it would just most likely involve removing flexibility of the Entity API and also probably some breaking changes.

The possibly more correct (yet difficult) thing to do would be to better expose post processing features through the Entity API.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, what about being able to associate a post-process stage to a particular ModelGraphics and everything "just works" under the hood? I haven't dug into the post process architecture yet, so maybe that idea makes no sense.

* @see {Context#depthTexture}
* @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}
*/
PostProcessStageComposite.prototype.isSupported = function(scene) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should PostProcessStage.prototype.isSupported also be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, removed.

@bagnell
Copy link
Contributor Author

bagnell commented Jun 19, 2018

@lilleyse This is ready.

@lilleyse
Copy link
Contributor

makeZipFile seems to be failing here, but also in master.

Otherwise looks good.

@lilleyse lilleyse merged commit af3dc67 into master Jun 19, 2018
@lilleyse lilleyse deleted the post-process-updates branch June 19, 2018 20:06
@lilleyse lilleyse mentioned this pull request Jun 25, 2018
1 task
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.

5 participants