# 3D rendering performance without GPU

**URL:** <https://discourse.slicer.org/t/3d-rendering-performance-without-gpu/37160>\
**Category:** Support\
**Created:** [July 3, 2024, 12:11am UTC](https://discourse.slicer.org/t/3d-rendering-performance-without-gpu/37160 "2024-07-03T00:11:52Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 3, 2024, 4:36am UTC](https://discourse.slicer.org/t/3d-rendering-performance-without-gpu/37160/12 "2024-10-03T04:36:27Z")

</div>

Making some more progress: I think this is the place to change the limits on 3D texture dimensions `SWR_MAX_TEXTURE_3D_LEVELS`:

> **[src/gallium/drivers/swr/swr\_screen.cpp · 21.3 · Mesa / mesa · GitLab](https://gitlab.freedesktop.org/mesa/mesa/-/blob/21.3/src/gallium/drivers/swr/swr_screen.cpp?ref_type=heads#L58)**
>
> Mesa 3D graphics library

I changed the value from 12 to 14, assuming it would provide 8K textures size.

This worked up to a point. I can resample the MRhead to 2560x2560x130 (4.7GB) and it does render. At which point the rendering speed is acceptable (i get around 3fps) and much better than CpuRaycasting, which I can’t even move interactively, and also GPU rendering quality is better.

GPU Raycasting:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/c/9ceca644e19ec034cf6bd9ed34a29041a61e9e61.jpeg)

CPU Raycasting:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/7/47320037c3a7f3f95c49611f4df186d414d95a3b.jpeg)

However, when I go to 2560x2560x270 (~3.8GB) in MRHead, Slicer crashes without an error. This seems related to texture memory limit, more than the dimension, since it works fine when I keep the volume dimensions the same but cast the data type as unsigned char instead of short.

There is also this `SWR_MAX_TEXTURE_SIZE ` setting which seems relevant:

> **[src/gallium/drivers/swr/swr\_screen.cpp · 21.3 · Mesa / mesa · GitLab](https://gitlab.freedesktop.org/mesa/mesa/-/blob/21.3/src/gallium/drivers/swr/swr_screen.cpp?ref_type=heads#L54)**
>
> Mesa 3D graphics library

I tried modifying it to be 4096^3, but it still doesn’t seem to make a difference.

This is as far as I can troubleshoot. Someone who know openGL and C++ needs to dig deeper.

@lassoan @pieper @jcfr

---

_[View the full topic](https://discourse.slicer.org/t/3d-rendering-performance-without-gpu/37160)._
