Page MenuHome

Fix T83942: Improve error checking when trying to view high resolution volume.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jan 7 2021, 3:24 PM.

Details

Summary

Currently, we have to use a dense 3D texture to render volumes in the viewport. The resolution of this texture is limited by GL_MAX_3D_TEXTURE_SIZE.
At the moment, Blender crashes when trying to render a volume that exceeds this limit. This patch adds some simple error checking to avoid the crash.

Users can quickly find their max resolution with this script:

import bgl
buffer = bgl.Buffer(bgl.GL_INT, 1)
bgl.glGetIntegerv(bgl.GL_MAX_3D_TEXTURE_SIZE, buffer)
max_size = buffer[0]
print(max_size)

This test file contains the above script and a simple setup that generates a very long but thin volume, which will trigger the error. The volume is generated using the Mesh to Volume modifier.

I'm not sure what's the correct way to report such errors to the user.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jan 7 2021, 3:24 PM
Jacques Lucke (JacquesLucke) created this revision.
Jacques Lucke (JacquesLucke) retitled this revision from Fix T83942: Improve error checking when trying to render high resolution volume. to Fix T83942: Improve error checking when trying to view high resolution volume..Jan 7 2021, 3:29 PM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)

Not sure if this is the way to report the error either. But at least it's better than nothing.

This revision is now accepted and ready to land.Jan 7 2021, 5:08 PM