-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Clamp Billboards and Labels to terrain #2653
Conversation
…moving a billboard.
…billboard and compare against an offset position in eye coordinates.
…d with an undefined position.
…ad of generating a random number.
…sitions from not rendered to rendered. Update time slices.
I know we talked about this a little offline, but I propose we replace Will Models be handled in similar fashion? |
OK with me.
Yes. |
Cartesian3.clone(Cartesian3.UNIT_X, scratchRay.direction); | ||
} | ||
|
||
var position = object._newTile.data.pick(scratchRay, mode, projection, false, scratchPosition); |
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.
I imagine this is already part of the performance plans, but we must be able to optimize the general-purpose ray intersection given we have the specific case of a ray normal to the ellipsoid surface. I'm talking about the actual number crunching...this is in addition to the spatial data structure / adjacency info / temporal coherence / etc.
|
#ifdef TEST_GLOBE_DEPTH | ||
vec4 offsetPosition = positionEC + vec4(0.0, 0.0, -positionEC.z * 0.05, 0.0); | ||
vec4 wc = computePositionWindowCoordinates(offsetPosition, vec2(0.0, 0.0), scale, direction, origin, vec2(0.0), pixelOffset, alignedAxis, rotation); | ||
float d = texture2D(czm_globeDepthTexture, wc.xy / czm_viewport.zw).r; |
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 if number of vertex shader texture units is zero or depth textures are not supported? We don't need to throw an exception, but there should be a trivial way for the user to see if clamp-to-ground is supported and perhaps we should warn in the console if they ask if it and the system doesn't support it.
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.
OK, thanks for reminding me. I wasn't sure whether to throw or not. I also need to check if we can create a fbo with a floating-point color attachment. I've had issues before where floating-point textures were supported but the fbos were incomplete.
That's all for this round. |
…e when we walk the tree. Add an event to the quadtree that fires when a tile is queued for rendering.
… none, clamp to ground or relative to ground. Clean up modifications to quadtree when destroying a billboard or label.
Perhaps Chrome only. FF is OK. |
I've seen that for top-down views where a billboard or label is in a valley, but not for a horizon view like you posted. I'll try to reproduce it. |
I haven't seen that. Perhaps Mac Chrome only? |
I've seen that at frustum boundaries. Is that the case for you? |
Yes. |
Appears to be Mac and Chrome only. No concern. |
I submitted a few ideas to #2685. Update it as you see fit. The terrain heights are fast enough to merge this, but we should optimize them when we get some time. |
@bagnell did you check the bounding sphere? |
Yes. There were no code changes needed. |
@pjcozzi This is ready for another look. I'm looking at the frustum issue. It's really noticeable if you switch to labels. |
I'm still getting issues. Here we are looking east: Zoom in a bit and billboards disappear in the top left (north east corner): Also, this can be too aggressive with the offset for the case where the billboard is on the face of Seneca Rocks and the viewer is on the other side and zooming out. If we have to err one way or the other, I would rather be too aggressive about making labels visible, but I also think a smarter offset could get us a 90% win. |
You'll have to show me that tomorrow. I can't tell what is going on from the screen shot. I've tried a bunch of different views and have been able to rationalize that its correct. I have seen billboards disappear as you zoom in because they are behind the terrain. As the billboards remain a constant size, parts pop out from behind the terrain. But, instead of only seeing that part, we determine that the whole thing should be visible so it pops into view. |
Fixed in the latest Chrome. |
…adtree primitive update height callbacks.
Do we want to keep the development example I added? Should I still add an example to the terrain Sandcastle example or wait for entity support? |
@pjcozzi This is ready. |
I think so.
Wait. |
This is OK to go into the |
…o-ground Clamp Billboards and Labels to terrain
NOTE: This is into the globe-depth branch because the globe depth texture is required.
Opening for early review. Still needs to be done: