-
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
Fix GroundPrimitive clipping issue #3709
Conversation
pulling the far plane closer to the camera and causing the shadow volume to be clipped.
I can confirm the issue is fixed. I also wrote up #3710, which is most likely unrelated. |
@bagnell if I'm following you correctly, the bounding volume was smaller than the shadow volume so the shadow volume was getting clipped, right? I'm fine with this change for now since we have bigger fillrate improvements to make here, but two questions:
|
I forgot about the near/far plane clipping. The volume doesn't need to be clipped to the near plane. It should be getting clipped to the far plane though so I'll look into it.
Yes, I wish we could. Most likely, we would need support from the terrain server to get the max/min height of the terrain over an area. |
In the general case, I agree. In this case, don't we know the max height of the smaller OBB? Couldn't we use that? |
Which OBB? We compute the one for the primitive based on the volume. For the terrain tile, we would have to go through the quadtree. The volume might overlap more than one tile. We can't use the parent tiles either. The min and max height of the tiles are for the quantized mesh so the min/ max heights of the parent aren't guaranteed to bound those of the children. |
In the quantized mesh format, at least the one produced by STK Terrain Server and at least when I wrote it, the min/max heights of a tile very intentionally represent the the min/max height of that tile and all its descendants. |
That would be great. We might be able to do something client side in the short term to shrink the volumes. I had an offline discussion with Alex where he said that was not the case. Maybe something changed? CC @abwood |
Actually, I think Kevin is correct here. While minheight and max height is updated during refinement (which could simplify out the minheight and maxheight of the children) we do set update the parent tiles min and max before aggregating the children. |
@bagnell is there anything you want to do in the short-term or should we merge this? |
@pjcozzi I think we should merge this. |
…clipping Fix GroundPrimitive clipping issue
Fixes #3706.
Removes the OBB optimization for better culling. The bounding volume was
pulling the far plane closer to the camera and causing the shadow volume
to be clipped.