Esri / i3s-spec

This repository hosts the specification for Scene Layers which are containers for arbitrarily large amounts of geographic data. The delivery and persistence model for Scene Layers, referred to as Indexed 3d Scene Layer (I3S) and Scene Layer Package (SLPK) respectively, are specified.
Other
321 stars 86 forks source link

Question about class Image #11

Closed pengfei666 closed 6 years ago

pengfei666 commented 6 years ago

Hi Folks, I have a question about this Part https://github.com/Esri/i3s-spec/blob/a22e94d8bcf484f106f0231baa01793a58959741/format/Indexed%203d%20Scene%20Layer%20Format%20Specification.md#class-image.

As we know, the texture images often are compressed. So here we give a byteOffset and Length fields, the numbers should before compressed or after?

pengfei666 commented 6 years ago

Assume we have several images, we put them into one binary file. How we put them? Compress images separately then combine them into a single binary file, or combine them into a single binary file first, then compress the whole binary file?

How we put the binary file decide us how to decode the texture file.

Thank you!

thorsten-reitz commented 6 years ago

The original intent was to compress images individually. I don't think there is much to be gained to compress them again. Maybe one of the current maintainers can comment?

sreinhard commented 6 years ago

Hey Pengfei, Combining multiple images into a single binary file is not supported by all clients, so we recommend against using this feature of the i3s spec. Also textures are usually large resources so there is not much to gain from combining them. If you have many small textures, you should consider combining them into a texture atlas.

To answer your question, the offset and length fields are before gzip compression. So for uncompressed image data (eg. S3TC textures), you would combine them in a binary file and then compress them. For compressed formats, like JPEG or PNG, as @thorsten-reitz said you would not use gzip compression at all , so you would just combine the images.

pengfei666 commented 6 years ago

@sreinhard Thank you very much. As you say

the offset and length fields are before gzip compression.

I think the length should be uncompressed size even if we only have one dds image. Isn't it?

pengfei666 commented 6 years ago

For showing the question clearly, I paste a screenshot of one data. l r1j6 ffgmt3rtfxanc3

Strangely, the length is same as the binary file length. When I uncompressed the binary file, the uncompressed data length doesn't equal file length.

The data can be consumed by ArcGIS PRO. So I want to know how to deal with it?

pengfei666 commented 6 years ago

If the length is compressed length, I am afraid that if we combine S3TC textures into one compressed binary file, then we can't split them correctly.

pengfei666 commented 6 years ago

Oh. Should thank @thorsten-reitz too.