-
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
Misc changes and helpers from 3d-tiles #5249
Conversation
Could we please keep the git history? |
This looks good to me. Is the plan to move all WebGL resource creation to use the |
Won't the history still be preserved when |
I was thinking the same thing, but I am not 100% sure, could you test in a small example? |
There's no need to test, yes history will be preserved. There will be a merge commit into 3d-tiles that resolves the dupes, but if you were to ever go back and chronologically determine where code came from, the original 3d-tiles commits will be the first. |
Even if everyone approves this PR (I haven't looked at it yet), I'd prefer we hold off on merging this until after the release on Monday. Thanks. |
Is |
That seems to be the ultimate goal. More discussion here (plus a similar comment from you) #2655 |
Good to hear, since it's marked |
I haven't reviewed this in its entirety yet, but just a couple of thoughts I have to spur conversation:
|
Source/Core/joinUrls.js
Outdated
@@ -55,6 +57,9 @@ define([ | |||
var baseUri = first; | |||
if (second.isAbsolute()) { | |||
baseUri = second; | |||
if (second.scheme === 'data') { |
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 is this for? It's probably worth it to have a comment here, since the purpose of this isn't immediately obvious.
Source/Scene/JobType.js
Outdated
PROGRAM : 1, | ||
BUFFER : 2, | ||
NUMBER_OF_JOB_TYPES : 3 | ||
// Potential additional types: |
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 smells like a TODO, even if the word isn't there. Should we write an issue for this and remove the comment?
Source/Scene/TileBoundingSphere.js
Outdated
Primitive) { | ||
'use strict'; | ||
|
||
function TileBoundingSphere(center, radius) { |
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.
Missing documentation (even if it's private, we should still document it).
Primitive) { | ||
'use strict'; | ||
|
||
function TileOrientedBoundingBox(center, halfAxes) { |
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.
More missing doc.
I know a lot of the updates here are private, but is there anything that warrants an update to |
Sorry to be "that guy", but this should have really been multiple PRs, it jams way to many changes together. That being said, other than my concerns over the JobScheduler the rest of this PR looks okay to me (at least the parts I'm qualified to review). Not sure if anyone else wants to take a look at this. I'd prefer we not merge this until the impact of JobScheduler is discussed further and better understood. |
@@ -131,7 +131,7 @@ define([ | |||
|
|||
// Fade fog in as the camera tilts toward the horizon. | |||
var positionNormal = Cartesian3.normalize(camera.positionWC, scratchPositionNormal); | |||
var dot = CesiumMath.clamp(Cartesian3.dot(camera.directionWC, positionNormal), 0.0, 1.0); | |||
var dot = Math.abs(Cartesian3.dot(camera.directionWC, positionNormal)); |
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 change was from this comment: #4307 (comment). The previous math resulted in fog being fully applied unless looking straight at the horizon or at the sky.
Yeah this is a problem. The request scheduler is a singleton but has a similar problem. They both operate on budgets that need to be reset at every frame. Where would be the best place to reset them in app that contains multiple scenes? |
It definitely has a rendering bias.. I'll add some of these thoughts to the issue. |
Addressed most of the other comments. |
When investigating the design for multiple viewports, there was a bunch of stuff in scene that should operate on all scenes. I think pulling this out of Scene would be part of that work. It would be different for multiple canvases which has its own problems. We still need WebGL support for a shared context there though. |
@lasalvavida heads up that the changing to Model.js here will conflict with your work in #4808. The merge shouldn't be too bad. Can you please proactively merge this branch into your branch even before this PR is merged? |
For the Job Scheduler, let's continue the conversation in #2655. We can incorporate changes as we adapt it for more parts of Cesium. Since it is private and is working sufficiently for 3D Tiles, I'm not sure that we should hold up this PR for more architecture work. Multiple scenes may be first on the list if it becomes a problem in practice. Is there anything else this PR is waiting on? |
That's a good question. Right now we don't really have that concept. (Which is why one of the options @bagnell was exploring about for multiple viewports was the idea of a I need to investigate more into it, but another possibility is that it will turn out that |
Have we tested this with multiple Viewer instances to makes sure it doesn't break anything ? That is my only showstopper concern. From a development standpoint, I would have liked to have seen |
Ignoring #5226, I tested that multiple viewer instances works with the job scheduler. |
Thanks. |
Some of the bigger things here:
JobScheduler
that is used to load WebGL resources for models (just models for now)TileBoundingBox
is nowTileBoundingRegion
to fit the 3d-tiles convention. The other bounding volume typesTileBoundingSphere
andTileOrientedBoundingBox
are brought over but not currently used.Texture
statsModel
memory statsTransforms
, but no difference in behavior.What it doesn't have
RequestScheduler
changes