Closed dbuck closed 4 months ago
I think being able to register an extension that uses certain predefined hooks to preprocess tiles like seems like a good design in the long run. It looks like GLTFLoader lets you register a full class that defines the hooks you'd need, but I'm not super familiar with the details of that code. For some of the more basic extensions I think it makes sense to just support them by default, though, which is probably the easier place to start. Were there any other extensions you were looking at using? What kinds of hooks would they wind up needing?
For GLTF and GLB support I'd be okay with just adding those in the TilesRenderer.parseTile
function. Looking at the Cesium implementation it seems they already load GLB and GLTF files for the 3d tiles as well as others.
It probably also makes sense to start logging unsupported extensions so it's more clear what functionality is being skipped or might be broken when loading a tileset with an extension -- though I'm not sure how many of those are out in the wild yet.
Hey @gkjohnson had you given this much more thought? We're looking at using the upcoming gltf extension EXT_mesh_features
. Possibly something we could help with next year.
Hi @rennzie! #230 by @dbuck adds support for the 3DTILES_content_gltf
extension which will enable use of GLTF and GLB files in the tileset json files. That PR is nearly done and should be ready to merge after a couple more changes.
It doesn't add support for the GLTF extension EXT_mesh_features
, though, and typically GLTFLoader extensions live in the three.js repo. However given that the extension seems designed with 3d tiles use cases in mind and I expect it to use Batch and Feature Table implementations I'm happy to house it in this repo. If you'd like to provide a GLTFLoader extension implementation in a PR along with some tests and sample data we could get it merged. I think step one is just getting the extension going and once #230 is merged we can get it integrated in TilesRenderer.
I went a little deeper on extensions today. In addition to the basic GLTF support in #230, I've got a first pass ExtensionSystem modeled very loosely after the GLTFParser plugin system.
Test here: https://github.com/matterport/3DTilesRendererJS/pull/4 if you have some early thoughts @gkjohnson? - It's sitting on top of #230 + some other utilitarian changes so it's too messy for a direct PR as yet.
@rennzie #230 has been merged now and I've created #236 to track the implementation of EXT_mesh_features
if you'd like to contribute.
Hey @gkjohnson, sorry for the delay (holidays and all).
Our priorities have changed at the start of this year so I'm not going to be able to make an immediate start. Hopefully that changes but please don't wait.
I added some basic plugin architecture in #603 that is heavily inspired by three.js' GLTFLoader plugin system. Basically you register a plugin and the TilesRenderer class can call a specific function on one or all registered plugins at different points during the tiles renderer update / load loop. We can continue to add new "hooks" as needed to support new plugins we want to provide in the future.
I was checking out some of the recent changes in the
3d-tiles-next
branch here, and it brought up some thoughts about future extensibility.First item I was interested in the ability to just use GLTF as the content within tiles via 3DTILES_content_gltf -> Replace the B3dm wrapper with gltf.