#3d image incorrectly converts to a 2d gpuimage during extraction

11 messages · Page 1 of 1 (latest)

daring star
#

hi, i recently updated dependencies and have traced an issue down to the texture extraction process.

here, i print my image before extraction
[image 1]

then, i print my GpuImage after extraction
[image 2]

as you can see, the size changed from (8,8,8) to (8,8). it is still registered as a 3d texture in my bind groups and shader code. when sampling any z value greater than 0 in my shader, it returns 0.

the extraction is ExtractResourcePlugin::<A struct with a Handle<Image> property>

the Image -> GpuImage conversion seemingly incorrectly converts the 3d image to a 2d image.

any help is appreciated. this issue blindsided me and i am very confused.

daring star
daring star
#

3d image incorrectly converts to a 2d gpuimage during extraction

coarse stream
#

i this 0.14? i’ll take a look when i get home

daring star
coarse stream
#

so looking briefly, the size property of GpuImage is probably misleading here, it isn't actually used to create the image. we pass the image descriptor straight to wgpu to create the texture. if you want to confirm, you should be able to print gpu_image.texture.depth_or_array_layers() and gpu_image.texture.dimension() to confirm the descriptor used to create it

daring star
#

oh okay it appears to be working then. which confuses me even more as to why any z value > 0 is 0 when i sample it from the gpu. but thank you i can confirm the gpuimage does have a D3 dimension and 8 depth layers following what you mentioned. reguardless, ensuring the extraction is not the issue is very helpful, thanks.

coarse stream
#

yeah, i'd double check your shader logic (:

modest comet
#

Run it through RenderDoc to check that the texture is correct

#

If it is, your shader logic is probably wrong