Hello everyone,
I am trying to render a volumetric (volume dimensions: [5861, 3429, 27]) image into desktop Google Chrome using the volume rendering method (vtkVolumeMapper), but I am encountering the following webGL error:
I looked into the problem to understand more, and I found that the texture I’m trying to render is larger than the GPU can handle, which is why I’m getting this error.
Therefore, I checked the webGL properties of the desktop chrome and found the below info:
Textures:
Max Texture Size: 16384
Max Cube Map Texture Size: 16384
Max Combined Texture Image Units: 64
Max Anisotropy: 16
Max 3D Texture Size: 2048
Max Array Texture Layers: 2048
Max Texture LOD Bias: 15
When I try to render same image in my laptop with exactly same code on chrome which has below max texture support it render without a problem:
Textures:
Max Texture Size: 32768
Max Cube Map Texture Size: 32768
Max Combined Texture Image Units: 64
Max Anisotropy: 16
Max 3D Texture Size: 16384
Max Array Texture Layers: 2048
Max Texture LOD Bias: 15
I noticed that the texture size restriction was the cause of the error I was experiencing in desktop Chrome. I now want to take some action to optimize the volume rendering code and render it on both devices without running into texture limitation issues. How can I achieve it?
Any suggestion would be appreciated.
I am getting this error when I run volume rendering code, but I don´t get these errors for isosurface plot.
Thank you!
You can consider downsampling your volume. You would get a more manageable data size at the cost of dataset resolution. I’m not sure what you can do to try to optimize the volume rendering code, so downsampling would be my first approach.
I am getting error in imageResampled as: Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘0’)
Can you provide me an example of performing down-sample? And also can you explain why I am getting GPU max_3D_texture_size error in volume rendering but not in surface rendering?
Thank you.
Error:
It gives me below error on imageResampled = down_sample.getOutputData() :
Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘0’)
I also would like to ask you one more question regarding a addRGBPoint transfer function. Currently, I am passing the color points from the matplotlib library to addRGBPoint and it works but it does have all color which i want and the color are also not so dynamic. So do you know any other library which i can use to pass color points into it as i know volume render plot depends on the pixel intensity not a solid like in isosurface. Before I tried to pass VTK color but i didn’t get succeed and I also didn’t find any example.