# Issue of volume render with large 3D data

**URL:** <https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395>\
**Category:** Visualization\
**Tags:** makie, 3d, glmakie\
**Created:** [August 31, 2023, 7:55am UTC](https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395 "2023-08-31T07:55:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dora\_ho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dora_ho/32/42582_2.png) [@dora\_ho](https://discourse.julialang.org/u/dora_ho)\
**Post date:** [August 31, 2023, 7:55am UTC](https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395/1 "2023-08-31T07:55:56Z")

</div>

Hi,

I was trying to volume render a very large 3D data with`GLMakie`.  
However, I found this exists a limit for the volume render.  
This is my plotting scripts

`GLMakie.volume!(x, y, z, 3DArray, algorithm=:mip , absorption=0.1, colormap=:ice, transparency=true, shininess=0.2)`

Any 3DArray with a size exceeding 768^3 will have an error

`glTexImage 3D: width too large. Width: 1024`

I see there was a discussion ongoing related to this issue

> <https://github.com/MakieOrg/Makie.jl/issues/335>
>
> While trying to reproduce \[this issue\](https://github.com/JuliaAstro/AstroImages….jl/issues/10), I gave Makie.jl a try, however it fails to plot, with \`heatmap\`, a matrix with size 24900 x 26620 (but also 170000 x 17000):
> 
> \`\`\`julia
> julia\> using AbstractPlotting, GLMakie, Makie
> 
> julia\> heatmap(rand(Float32, 24900, 26620))
> Error showing value of type Scene:
> ERROR: glTexImage 2D: width too large. Width: 24900
> \[...\]
> \`\`\`
> 
> Images this large are relatively common in astronomy and currently I don't see any tool in Julia able to visualise them.

It seems to me that it is an issue with the OpenGL,  
I am wondering any update or potential walkaround on that?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [August 31, 2023, 10:25am UTC](https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395/2 "2023-08-31T10:25:14Z")

</div>

As a workaround, consider

```julia
using ImageBase
smallvol = restrict(vol)

```

That will do an anti-aliased 2x reduction in size along all three axes.

---

<div class="post-metadata">

**Author:** ![dora\_ho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dora_ho/32/42582_2.png) [@dora\_ho](https://discourse.julialang.org/u/dora_ho)\
**Post date:** [September 1, 2023, 11:33pm UTC](https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395/3 "2023-09-01T23:33:05Z")

</div>

Thanks for the suggestion!  
I also see imresize in the package.  
Which one would you think is preserving the information better?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [September 2, 2023, 6:26pm UTC](https://discourse.julialang.org/t/issue-of-volume-render-with-large-3d-data/103395/4 "2023-09-02T18:26:53Z")

</div>

It’s much better to use `restrict`, as `imsize` doesn’t perform antialiasing.
