glTF modifier: fixed case of raster overlays#1307
glTF modifier: fixed case of raster overlays#1307Julot94 wants to merge 2 commits intoCesiumGS:mainfrom
Conversation
|
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? |
|
Thank you @kring for reviewing this one.
|
…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. - added a counter in TileRenderContent to fix a potential crash which did happen when the game thread was replacing the parent tile's content (replaceWithModifiedModel) while a worker thread was currently up-sapling it for one of its children
0ec4bac to
dae73ea
Compare
|
Hello @kring , |
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)