glTF modifier: fixed case of raster overlays#1307
glTF modifier: fixed case of raster overlays#1307Julot94 wants to merge 3 commits intoCesiumGS:mainfrom
Conversation
…ives are rejected the boolean was set too soon (in the bad loop...), so as soon as you had more than one primitive in input, we would consider we had kept primitives
- raster overlays (computed as post-process) needs to be recomputed *after* the modification step. - in the case of the re-apply path (see reapplyGltfModifier), we need to restore the initial tile bounding volume, because the post-process can lead to set an empty bounding volume, which would trigger plenty of false positive errors when re-running the post-process on the tile. - for up-sampled tiles, the re-apply path consists in up-sampling the modified parent (and not run the modifier on the current up-sampled tile...) - added a shared-mutex in TileRenderContent to fix a potential crash when the game thread is replacing the parent tile's content (replaceWithModifiedModel) while a worker thread is currently up-sapling it for one of its children
…fier-raster_overlays
|
Thanks for the PR @Julot94! This is trickier than I originally anticipated. My initial thought is that we'd really like to treat upsampling as just another way of loading a tile. So, just like with normal loading, we would always upsample first, and then apply the GltfModifer to the upsampled tile. As you know, one problem with that is we have to be careful to sequence the upsample and the GltfModifier run. Both need the model as input, and the latter destroys and replaces the model, so doing both at the same time will result in undefined behavior. I think this problem is relatively easy to solve, though, and in fact you've done so in this branch. My main suggestion there is that you avoid the use of a mutex. A simple boolean should suffice, because both operations are initiated and complete in the main thread. Another problem is that we usually don't upsample a tile until later, after the GltfModifier has already run on it. So we'll end up upsampling from a tile that has already been GltfModified, and then GltfModifying the result of that upsample, too. But I think this is only a little worse than the usual GltfModifier situation where each new version starts with the results of the previous one. A GltfModifier implementation just needs to be non-lossy and produce deterministic results on re-application. So that seems preferable to me over the alternative, which I believe you've implemented here, where GltfModifier only runs on the real tiles, and then the modified tiles are upsampled. But maybe there's some reason the alternative is required or preferred? What do you think? |
GltfModifier: made it compatible with raster overlays (the initial revision of Gltf modifier was just ignoring them - so as soon as a modification was re-triggered, any cut-out polygon applied to the model would just be lost)