Ktx2 texture with mipmap has moire pattern in Cesium

The 3dtiles and gltf files are attached below. The gltf file is exported from 3dtiles file, and display correct in gltf viewer. The Cesium version I use is 1.83.
cesium
gltf_viewer
3dtiles_mipmap.zip
gltf_mipmap.zip

1 Like

@jz0224

Welcome to the community and thank you for the detailed post.! :fireworks: :rocket:

I took a look at the files that you shared. Both can be imported into Cesium ion deployed in CesiumJS. Is there a particular issue that you are trying to address with this post? Also, is there a reason why you are using Cesium 1.83 and not Cesium 1.84?

Let me know if you have any questions or concerns! I am looking forward to hearing from you.

-Sam

Thank you for your reply!
I imported the 3dtiles model with mipmaped ktx2 texture into cesium, and there was a lot of noise (moire pattern), which should be caused by texture without mipmap. The result I expect is like the gltf model showed in gltf-viewer. Can you figure out if it’s problem with 3dtiles model or the Cesium?
There’s no specific reason for me to use Cesium 1.83, I will try Cesium 1.84 to see if this problem is addressed.
Thanks a lot!

@jz0224

Thank you for sharing some more details. While using the most recent version of CesiumJS is always a good idea, it seems like the issue maybe elsewhere. Just so that we are on the same page, I have a few quick questions/requests.

  • Are you using Cesium Ion to stream your 3D data into CesiumJS?
  • If you are using Cesium ion, please take a minute to ensure that you are adhering to our 3D Tiling specifications. Tiler Data Types and Formats – Cesium
  • If you are not using Cesium ion, how are you importing data into CesiumJS? Sending over a sandcastle demo might help make your process more clear to me.

Thank you in advance for your patience and careful responses to my questions. I am looking forward to learning more about your project and getting to the bottom of this issue.

-Sam

I generate 3dtiles model by my own program, and import it into CesiumJS. Demo is attached below.
Looking for your reply. Thank you!
Test.zip (1.7 KB)

@jz0224

Thank you for the clarification. Is there any reason why you are not using Cesium ion to generate and stream your 3D Tiles?

I checked in with @Matt_Boyd-Surka and he had a few great suggestions. 3d-tiles-validator can be used to check your tileset.json file. When using it, I got the message:

Tileset must declare its geometricError as a top-level property.

I also checked your glTF file with gltf-validator and got the following report:

Warnings:
   /samplers/0/wrapR: Unexpected property.
   /images/0: Image format not recognized.

Infos:
   /extensionsUsed/0: Cannot validate an extension as it is not supported by 
the validator: 'KHR_draco_mesh_compression'.
   /extensionsUsed/1: Cannot validate an extension as it is not supported by 
the validator: 'KHR_texture_basisu'.
   /bufferViews/0: This object may be unused.
   /images/0: This object may be unused.

When I upload your glTF to Cesium ion and hosted it as a model (instead of tiling it as 3dtiles), the texture doesn’t come through. If I try to tile the glTF, I get an error: Cannot read property 'extras' of undefined

I was able to upload the tileset to Cesium ion and see the problem with the moiré pattern that you mentioned. In addition, I got erratic camera behavior. When I try to move or zoom the camera at all, I lose the model. Have you also experienced this?

I have a few primary questions: Why are you creating a glTF file from a 3dtiles file, and how was the original 3dtiles file generated? What software are you using for this process? In general, more information on how your data is being generated would also be extremely helpful.

I suspect that resolving the Tileset must declare its geometricError as a top-level property problem will fix a lot of the issues that you are seeing. If the tileset isn’t able to compute error properly, it could be using the highest-res texture all the time (rather than using a mipmap as the camera gets farther away), which would cause the moiré pattern that you are seeing.

-Sam

Thank you for your detailed explaination! Really appreciate it!
However, I add a geometryError to the top-level property, the problem is not solved.

Is there any reason why you are not using Cesium ion to generate and stream your 3D Tiles?

My source data is a customized format, so it’s not supported by Cesium ion. So I tried to organize the data follow the 3dtiles specification to generate the 3dtiles file.

When I try to move or zoom the camera at all, I lose the model. Have you also experienced this?

I didn’t experience this.

Why are you creating a glTF file from a 3dtiles file, and how was the original 3dtiles file generated? What software are you using for this process?

I created the gltf file from 3dtiles file to check if the problem is caused by wrong organization of gltf file(as I know, b3dm model is built on gltf). The result proved the gltf file with ktx2 texture doesn’t have moire pattern.

I suspect the problem is with the specification I didn’t follow when generating gltf and 3dtiles. Can you generate a gltf and 3dtiles model using my ktx2 texture, and check if the moire pattern will disappear? Maybe I can find out the problem by comparing the correct 3dtiles model with mine.
Hope my answers can help us figure out the problem. Thanks a lot!

@jz0224

Of course! I am happy to help out. I saw that you added an issue on GitHub.

Thank you for spearheading this effort. It looks like the rest of our development team will take a look at your issue and get back to you.

-Sam