-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group of objects in PRWM #3
Comments
Loading several files separately, this will take advantage of the parallel download in the browser (assuming you are using this in a browser). It should be faster to download X models separately than a bundle containing X models and with HTTP2 slowly becoming the norm, it should get even better. I initially planned to design a bundle format further down the line, but given the above it probably wouldn't make sense. |
It might be slower for downloading also in HTTP/2 for example 1000 geometries each for 2-5 kBytes. Have you ever seen benchmarks for such the case? |
I've found this one: https://medium.com/@asyncmax/the-right-way-to-bundle-your-assets-for-faster-sites-over-http-2-437c37efe3ff Therefore I suggest to make bundle syntax. What do you think about v2 syntax with concatenated v1 files inside? For example, header might be the following: |
Yes, it makes sense... I can't give you any ETA on this though. My idea would be to consider the bundle format as different format (PRWB), not a version of PRWM. This would allow the format to be a generic container for any types of files, which could for example be useful in the future to include shaders / material descriptions. Its format would be something like : HeaderVersion : 1 byte (0 to 255) // should probably add endianness in there File blockIdentifier : An ASCII encoded C-string (one byte per character, terminated with a NUL character). Typically the name of the source file, eventually sanitized for ASCII. 4 bytes may seem like a lot since it allows up to 4GB files, but 3 bytes would only allow up to 16MB. Rest of the fileThe files' data. One of the design challenge will be to figure out how to differentiate the PRWB files from the PRWM files, since there's no magic string in the header of the file to identify them as such (I dropped it in the spec phase when I decided not to make a bundle format). Maybe make a V2 of the PRWM spec just to include said magic string, so PRWM files would always start with "PRWM" and PRWB with "PRWB" ? This would be a breaking change, so I'm not sure that's the best solution. |
One alternative to the PRWM / PRWB differentiation issue would be to start the file with 0x00 (which by the current spec of PRWM should be considered as an error because there is no version 0) or 0xFF (because there will never be 255 versions of the PRWM specs). |
Additionally, there should be some padding before each file data to align its start to a multiple of 4. |
Agree with padding without a doubt. I don't recommend to use "specific" versions like 0x00 or 0xFF. Do you know how IP packets is being made? Same header with type and payload where payload might contain another type of payload. This provide infinite combinations of versions. Thus using next version 0x02 is preferrable over special 0x00 or 0xFF. Above, I recommended to use 3 bytes for number of files inside. And I agree with offset + size. It might be usefull when we need concrete part. The only question is do we need separated formats? I think there is no difference on data but on usage. What is better to use different loaders/exporters with different names or one single, separated into several concrete? What is more readable and understandable by community? Think we should first understand interface of Loaders/Exporters than make decision on PRWM v2 or another PRWB v1. |
It's been a long time coming but here is some update on this. I went on with a separate file format, totally independent for PRWM. The big advantage of making it its own format is that it is not limited to the use case of loading PWRM files (allowing other model file format but also other type of file altogether) and can be made flexible enough to allow anyone to implement their own take on the bundling issue :
It's roughly based on the tentative spec I posted above on the 22th Oct. with the following changes :
Specifications and implementation not pushed on NPM yet. |
The few issues of the implementations have been fixed and the reference encoder/decoder (along with the CLI tool and an example web loader) is now on NPM. |
@ashl1 I forgot. I named you in the main readme of the repository in the paragraph explaining how this format came to be. Let me know if this is an issue for you. |
Hello again.
What do you suggest to bundled load several geometries (group of geometries)?
The text was updated successfully, but these errors were encountered: