Some users have to deal with models that contain baked-in shadow planes. These models tend to look unsightly compared to the shadows we could offer at runtime. Baked-in shadows also tend to look incorrect in AR.
It might be useful to add the ability to remove a detected floor plane at runtime. This feature would be optional, requiring the user to opt-in via configuration.
Please keep this optional and opt-in. Baked shadows look great if done right. Much better then hard realtime shadows.
@soraryu I tend to agree, and I actually like the effect we have now where if you turn our shadows on, they blend naturally with the baked-in shadow. However, I think it would be nice to detect these shadow planes simply to remove them from the framing calculation, as they often extend significantly beyond the real object's bounding box. I would propose as a heuristic simply ignoring any meshes that only contain two triangles. Thoughts?
@elalish
What if the model is artwork and it's just a flat plane that has a texture on it? I wouldn't want that to be ignored.
@pushmatrix Valid question. I think it would be helpful to have an example model to look at. To be clear, I'm proposing not removing the geometry from the scene, but ignoring its dimensions for automatic framing.
Please keep this optional and opt-in.
@soraryu Definitely, that was the intention. I'll make sure that the issue text reflects that.
I'm proposing ... ignoring its dimensions for automatic framing.
@elalish That sounds good to me, but also it sounds like an adjacent feature that deserves its own issue where we can discuss it in detail.
Here's a real basic rug model:
I think the safest way with the least surprises would be to have some specific naming scheme clearly documented, or a way to specify the "ignore these for bounds" node names. It's a pretty advanced usecase.
I totally agree that "two tris" is a really bad heuristic. Here's an example for what would probably fail with any heuristics: this is basically just a bunch of quads. None of them are ground planes, even if some of them might be coplanar and/or close to floor level (not in this example but very well possible to construct): https://cobalt-gondola.glitch.me/
Note that there are also cases where a shadow plane should actually be part of the bounds (imagine a floating ghost - without the ground shadows the bounds/floor level would be too high).
Thanks, good points all! I agree that it would be much better to have this made clear in the glTF nodes. Does anyone know if there is a common practice for this? I was hoping to automatically catch the models that had already been authored with shadow planes, but I'm not sure if there's a good way to do that.
Another category of models where some of the geometry should be ignored for automatic bounds generation are ones with custom skybox geometries or where some environment has been added but not for viewing from the outside (e.g. https://www.artstation.com/artwork/4Bza1 - a lot of VR painting 3d models do this - there's basically "content" and "stage" and the "stage" doesn't look right/make sense from the outside. It's actually on sketchfab and you can see there how it's supposed to be viewed - https://sketchfab.com/3d-models/quill-the-red-planet-dc31bf0eaaba43db988f7c2befc07bf2).
So I think maybe this should be reworded into "ability to specify which nodes affect the bounding box" if it's not about removing actual geometry?
Good discussion all around, but I think the consensus is we should not try to heuristically detect geometry attributes. When automatic scene framing is not good, we give access to all the camera parameters to customize it, which I think is a reasonable fallback.
Most helpful comment
Please keep this optional and opt-in. Baked shadows look great if done right. Much better then hard realtime shadows.