-
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
Added compute pass #2993
Added compute pass #2993
Conversation
this.outputTexture = options.outputTexture; | ||
|
||
/** | ||
* Whether this command will persist beyond this call. |
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.
It's not the command that would persist; it is the renderer resources, i.e., framebuffer, etc.
@lilleyse good start!
OK, I don't see any other uses cases as of now so it could be dangerous to attempt to reasonably abstract this.
Agreed.
Yes, we can cache it as we previously discussed. We can brainstorm tomorrow if you want.
It will; see my comments. We will need special case handling for the sun.
Agreed. |
I found the cause of the ImageryLayer problem. All the reproject commands share the same VAO, but stream new data into it's second vertex buffer. This is fine when the compute commands are executed synchronously, but when the commands are issued and processed later, all of them use the vertex data from the last reproject call. The fix would be to generate a new vao and buffer for every reproject call. There could be a pooling system to reuse buffers, but overall it seems like a bad idea. The good thing is the reprojection code always happens during the render loop, and not as a reaction to the image load. So with all that in mind, I think the reproject code should stay as it is, and not use the command list. What do you think? |
Ah, I should have thought of this.
You mean the imagery reprojection shouldn't use the new
I think it is fine for |
I'm worried that creating a buffer for every compute command would slow everything down. Though maybe it's not much worse than streaming. The resource callback works, but seems hacky... |
The callback to provide renderer resources should be pretty clean and just as efficient as what we are doing today. Creating and destroying buffers could be worse, but we don't know what the driver is doing...it is probably pooling them...this is WebGL, not Vulkan...we don't have explicit memory management, just educated guesses. The benefit is we would be using |
Updated with the suggested changes. |
@@ -6,8 +6,8 @@ Change Log | |||
* Breaking changes | |||
* Remove deprecated `AxisAlignedBoundingBox.intersect` and `BoundingSphere.intersect`. Use `BoundingSphere.intersectPlane` instead. | |||
* Remove deprecated `getFeatureInfoAsGeoJson` and `getFeatureInfoAsXml` constructor parameters from `WebMapServiceImageryProvider`. | |||
* Added support for `GroundPrimitive` which works much like `Primitive` but it drapes the geometry over terrain. Valid geometries that can be draped on terrain are `CircleGeometry`, `CorridorGeometry`, `EllipseGeometry`, `PolygonGeometry`, and `RectangleGeometry`. Because of the cutting edge nature of this feature in WebGL, it requires the [EXT_frag_depth](https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/) extension, which is currently only supported in Chrome, Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support it. You can use [webglreport.com](http://webglreport.com) to verify support for your hardware Finally, this feature is currently only supported in Primitives and can not be used via the Entity API yet. | |||
* Added `Scene.groundPrimitives`, which is a primitive collection like `Scene.primitives`, but for `GroundPrimitive`s. Use for correct z-ordering. For example: | |||
* Added support for `GroundPrimitive` which works much like `Primitive` but drapes geometry over terrain. Valid geometries that can be draped on terrain are `CircleGeometry`, `CorridorGeometry`, `EllipseGeometry`, `PolygonGeometry`, and `RectangleGeometry`. Because of the cutting edge nature of this feature in WebGL, it requires the [EXT_frag_depth](https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/) extension, which is currently only supported in Chrome, Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support it. You can use [webglreport.com](http://webglreport.com) to verify support for your hardware. Finally, this feature is currently only supported in Primitives and not yet available via the Entity API. [#2865](https://github.com/AnalyticalGraphicsInc/cesium/pull/2865) |
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.
Is there a branch issue? These updates to CHANGES.md should not be here.
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.
My branch was out of date with master and I pulled. Usually the rebase works fine. I'm not sure what went wrong this time, maybe I pulled master before I pulled the compute-pass branch which had your commit. Unless it's easy to fix this, I should open a new pull request.
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.
Could be easy, I'm the wrong person to ask. @mramato might know.
@@ -465,7 +465,11 @@ define([ | |||
var camera = scene.camera; | |||
var mode = scene.mode; | |||
|
|||
var pickedPosition = mode !== SceneMode.SCENE2D ? pickGlobe(object, startPosition, scratchPickCartesian) : camera.getPickRay(startPosition, scratchZoomPickRay).origin; | |||
var pickedPosition; |
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.
Is this change from a merge issue?
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.
Same comment for build.xml and package.json below. Perhaps your branch is just out of date?
Looks good. What all is missing? Just unit tests for |
I added some specs and updates. There are still a few things to resolve. |
Let me know when you want me to look at this again. |
984861b
to
fd12159
Compare
32edae0
to
9484bc0
Compare
It's ready for another check. I'm not sure if you looked over the ComputeCommand specs yet. I used a mock command primitive like I saw in another file. Let me know if I should do it differently. I was able to clean up the commits using |
var vertexArray = computeEngine._viewportQuadVertexArray; | ||
|
||
if (!defined(vertexArray)) { | ||
var geometry = new Geometry({ |
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.
We have similar code here. Perhaps we should make a @private
ViewportQuadGeometry
in Core
and use it in both places? For a simple-ish example geometry, see BoxGeometry.
Just looked at them. They look great. |
Just those minor comments then this is ready to merge. In separate PRs, I would like us to look at:
|
Updated. ViewportQuadGeometry could be simplified, but I kept it with the style of the other Geometry files. |
480294a
to
ddd259f
Compare
I replaced the previous commit with this. Keeping viewport quad creation in |
Looks good! |
For #751
Still a work in progress.
Some thoughts:
ComputeCommand
to accept a custom vao instead of supporting subdivisions. Having a custom vao, especially the one in ImageryLayer, seems like a special case, and it might be annoying to generalize that.Texture
object instead of creating it fresh insideComputeEngine
. The object that called the compute command will need that texture back anyway.ComputeCommand
inScene
isn't doing anything right now.ComputeEngine
is insideContext
but maybe should go inScene
instead. I did this for now because ImageryLayer only has a reference to the context.