I have an existing Win32 OpenGL rendering engine. I decided to integrate VTK into it to extend it’s functionality to volume rendering. This seemed very possible with VTK’s vtkRenderingExternal module.
Hey, I tried again, this time creating the win32 app as you suggested. Again, I was able to get the cube to render but the volume still does not show up.
It would definitely help if I can get some example or tutorial where volume rendering is done in an external opengl context.
I tried them both, it doesn’t work. And there’s no errors either.
So, the interesting thing is that I used RenderDoc to analyse the buffer contents of my application. For the cube example, I can clearly see the geometry being passed to the vertex shader.
However, I can not see anything being passed to the shaders for the volume rendering example. And it’s definitely don’t the case that the volume is not being read or parsed correctly, because I can see the volume bounds using volume->GetBounds() and they are correct.
Is replacing vtkNew<vtkFixedPointVolumeRayCastMapper> volumeMapper; with vtkNew<vtkSmartVolumeMapper> volumeMapper; sufficient? Just doing that is still not rendering the volume.
I’m new to VTK so am unsure if I’m doing things the right way. The image from this post is the only clue I have that makes it seem like volume rendering in an external context is even possible. But, since I can’t find any examples demonstrating it, I’m feeling really struck at this point.
@CK008 Are you getting any errors? Or is it just that you’re not seeing any rendering? If so, my guess is that your camera parameters are clipping the volume away. Could you make sure that your OpenGL camera frustum is set up properly to encapsulate the volume bounds?
Switching to vtkSmartVolumeMapper is definitely the right way to go forward.