Hello, I have a working offscreen rendering class using VTK version 8.1.2 that loads in a mesh and a texture, sets up an offscreen window, renders it, and pulls the image out of the back buffer. So far so good.
However, I’ve been trying to get this pipeline to support a native 16 bit texture (16 bits per red, green, blue) or a 32 bit floating point texture (0-1 for each channel) to go through cleanly, and so far it appears the core of the opengl render window only supports 8 bit textures.
After searching and testing a lot of changes (e.g. not using vtkWindowToImageFilter, which appears stuck at 8 bit), but so far the pixels values in don’t match the pixel values out. The closest I’ve gotten is loading a 32 bit texture (again, 0-1) with vtkImageData, but it ends up looking quantized after being scaled back up to the original range.
Perusing through the source seems to indicate that the opengl buffers are only ever created with 8 bit texture depth. Is that correct, or did I miss something?
I’m happy to share more of the pipeline as needed, if that helps, but the core question is, if I want to mesh render some say, 12 bit image data, or 16 bit image data, and get it back out the other end without loosing fidelity of the data, can this be done?
I’m not enteriely sure to follow what you are looking for but VTK did add support in regards to HDRI and PBR rendering, which should cover what you are looking for I think.
When you say other end, do you mean write rasterized data to disk? That should be limited by renderbuffer size which is indeed 24 bit color and 32 bit depth.
Appreciate the responses. I looked into this and it’s nice, but not quite what I’m looking for.
I think a more succinct way might have been to say that I’m using the rendered result for scientific analysis, not just a visualization, so ensuring the texture data integrity is maintained regardless of the texture bit depth is important. Something is getting lost, as my rendered result shows clearly quantized histograms.
So it sounds like I’ll probably need to modify VTK on my end to change the render buffers color bit depth, which is what I was suspecting. I’ll look into that, appreciate any pointers. I’m not concerned about maintaining compatibility with other parts of VTK outside vtkImageData / vtkTexture / vtkActor / vtkCamera / vtkRenderer / vtkRenderWindow
That said, i’m currently using vtkTexture from a vtkImageData and not vtkTextureObject, perhaps there is a limitation there as well that I haven’t seen?
Ah, ok, so I’m using vtkActor as part of the setup with the texture and the mesh data, and it can’t load a vtkTextureObject, so it seems I also need to find an example of texture rendering that gets around this as well.