Skip to content

Commit

Permalink
fix(map): Set raycasting rendering options in Image3d initializer
Browse files Browse the repository at this point in the history
The default rendering options for Image3d have colormap_on_gpu and
full_region_on_gpu set to false. This works fine for the shaders that
handle planes drawings, but raycast drawings need both options set to
true. One could previously make an Image3d with one of its default Planes
drawings and then switch to the Raycasting mode, and these two options
would be set to true in set_options. However, that function is not
called during initialization, and if they aren't set then the wrong
shader is compiled for an Image3d object trying to create a Raycast
drawing first. The user would get a nasty graphics traceback. This
commit sets those options during _auto_projection_mode, which is called
early enough.

Fixes Trac#16682
  • Loading branch information
zjp committed Jan 28, 2025
1 parent e3c2f1d commit d5d5dbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bundles/map/src/image3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ def _auto_projection_mode(self):
pm = ("2d-x", "2d-y", "2d-z")[list(s).index(smin)]
else:
pm = "3d"
if pm == 'rays':
self._rendering_options.colormap_on_gpu = True
self._rendering_options.full_region_on_gpu = True
return pm

# ---------------------------------------------------------------------------
Expand Down

0 comments on commit d5d5dbf

Please sign in to comment.