Error during tiling

Hi,

when i upload a model (optmized/compressed with gltf.report) using 3D Model(convert to gltf). In this case, the model appears very small and I can hardly move around it.

I have uploaded models at Cesiumjs - Google Drive

25Aug25Eastfield_v2-v1_gr_compress.glb - This is optimized and compressed(draco) using gltf.report. I can upload it as 3D Model(convert to gltf). The issue is that it appears very small and you can hardly navigate around it

25Aug25Eastfield_v2-v1_gr_nocompress.glb - This is optimized and compressed(draco) using gltf.report. I can upload it as 3D Model(convert to gltf). The issue is that it appears very small and you can hardly navigate around it

25Aug25Eastfield_v2.glb - This is uploaded as it is. Uploaded as 3dTiles but i lost some textures. This model was used as a base to optimized/compressed models i mentioned above using gltf.report.

all of these models appear fine in gltf.report

thanks

Harsh

Hi,

Can you please share the asset ids of the assets you have uploaded. We can take a look to see what the visualization looks like.

Thanks,

Ankit

The issue is that it appears very small and you can hardly navigate around it

That’s a bit surprising, because the model is, in fact not too small. It is huge. But this, in turn, can have undesirable effects on the navigation and placement of the model.

The following shows two models, rendered in gltf.report, with the “Metadata” tab open:

  • The foreground/top shows the original model. It is 89 meters high

  • The background/bottom shows one of the compressed models. It is more than 1770 meters high!

Apparently, something went wrong with the optimization in gltf.report. The optimization itself should usually not change the size of the model. But I just tried it out: The instance step of the default optimization in gltf-report seems to change the size of the model for some reason.

So when running the default optimization, but omitting the instance call, then the result should stil have the proper size

import { dedup, flatten, instance, join, palette, prune, resample, simplify, sparse, textureCompress, weld } from '@gltf-transform/functions';
import { MeshoptSimplifier } from 'meshoptimizer';

/**
 * Example optimization pipeline implemented with the glTF Transform API.
 * Some optimizations, including KTX2 compression, require Node.js or CLI
 * environments. See https://gltf-transform.dev/ for full functionality.
 */

await document.transform(
	// Remove duplicate meshes, materials, textures, etc.
	dedup(),

	// Create GPU instancing batches for meshes used 5+ times.
	//instance({ min: 5 }),

	// Create palette textures for compatible groups of 5+ materials.
	palette({ min: 5 }),

	// Reduce nesting of the scene graph; required for join().
	flatten(),

	// Join compatible meshes.
	join(),

	// Weld (index) all mesh geometry, removing duplicate vertices.
	weld(),

	// Simplify mesh geometry with meshoptimizer.
	simplify({
		simplifier: MeshoptSimplifier,
		error: 0.0001,
		ratio: 0.0,
		lockBorder: true,
	}),

	// Losslessly resample animation frames.
	resample(),

	// Remove unused nodes, textures, materials, etc.
	prune(),

	// Create sparse accessors where >80% of values are zero.
	sparse({ ratio: 0.2 }),

	// Resize all textures to ≤1K and convert to WebP.
	textureCompress({ targetFormat: 'webp', resize: [1024, 1024] }),
);

I have not yet tried uploading this to Cesium ion, but it might work better now.

Unfortunately, the model is very repetitive and did benefit greatly from instancing. (With instancing, the resulting model had ~15 MB. Without instancing, it has ~36MB). Maybe there is a way to make the instancing work, but one might need more time for investigating this.

BTW: The fact that instance seems to change the size of the model looks like a bug for me. I’ll consider bringing this up in gltf-report (or glTF-Transform, which is used for that optimization).

An aside: It should also be relatively easy to apply the instance optimization, and afterwards resize the model to its original size. If the new model (without instance) works as expected, then this could be one next optimization step.

Hi Marco,

thank you for looking into this. The call to instance does change the size of model (I was wrong in saying that it became too small). I have started a discussion on gltf transform forum regarding this. will keep you posted

yes, that could be one way… will try this depending upon Don reply..

Hi Ankit,

i have one asset(id 3631181). which is a model uploaded after gltf.report optimization.

thanks

Harsh

There already is a response. I can understand that the bounding volume computation does not take into account the instancing. And that can certainly explain the effect: There is a mesh with a certain bounding box. And the instancing information in the resulting glTF all seem to contain SCALE attributes with values of 0.0254. Yes, that’s exactly 1 inch, expressed in meters (unlikely to be a coincidence).


However, what’s more problematic (right now): I tried uploading some of the models that you provided, with default settings. And the resulting model in Cesium ion is invalid: The glTF validator reports an

UNRESOLVED_REFERENCE Unresolved reference: 13. /materials/7/extensions/KHR_materials_specular/specularColorTexture/index

on the model that is generated with ion. Trying to render that in CesiumJS causes a (somewhat expected)

Cannot read properties of undefined (reading 'extensions')
TypeError: Cannot read properties of undefined (reading 'extensions')
    at GltfLoaderUtil.getImageIdFromTexture (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:80748:32)

So whatever ion is doing as an additional optimization on this (already optimized) model, it is making the model invalid.

@Ankit_Trehan This should not happen, and should probably be tracked as an issue.

The same happens for the model without instancing. In fact, the only version of the model that I could upload to ion and that actually worked was the original one. Unfortunately, this results in a GLB with with 68MB (!), which is certainly not ideal, given that this could easily be shrunk down to ~13MB…

Hi Ankit,

Is this issue being looked into or being planned to looked into?

thanks

Harsh

Hey Harsh,

I have created an issue in an internal repository for our tilers team to take a look at. I will reach out to you on this thread as soon as I have an update.

Thanks,
Ankit

Thanks Ankit.

Best Regards

Harsh Sharma