-
Notifications
You must be signed in to change notification settings - Fork 323
Fix volume rendering texture 3d sample #506
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
Conversation
Just for background, when initially contributing the sample, I went with gz to also demonstrate how compression formats interact with archival compression such as gzip or brotli, and also out of concern for git repo size (hence use of bin-gz as extension to explicitly control when things decompress). However either way should be fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The public/assets/img/volume/t1_icbm_normal_1mm_pn0_rf0.py
file would also be need to be updated right as it generates a gzip file. See gzip_filename
in af6432c
a20b507
to
a7fbc25
Compare
updated |
The files were changed from `.bin-gz` to `.gz` and then left to the browser to decompress. But that only happened to work because the local dev server served `.gz` files with `content-encoding: gzip` headers. Github didn't do this. Revert to using `.bin-gz` and manually decompressing with `DecompressionStream`
a7fbc25
to
99fdbe4
Compare
@@ -158,11 +158,20 @@ async function createVolumeTexture(format: GPUTextureFormat) { | |||
}); | |||
|
|||
const response = await fetch(dataPath); | |||
const buffer = await response.arrayBuffer(); | |||
|
|||
const compressedBlob = await response.blob(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why blob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because theoretically it uses less memory? The browser can stream the blob through the decompressor. It can't stream the arrayBuffer as it's required to have loaded the entire thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Thanks!
The files were changed from
.bin-gz
to.bin.gz
and then leftto the browser to decompress. But, that only happened to work
because the local dev server served
.gz
files withcontent-encoding: gzip
headers. Github doesn't do this.Revert to using
.bin-gz
and manually decompressing withDecompressionStream
..bin-gz
seems better then.gz
becausemany servers are configured to treat files that end in
.gz
specially.