[vtkusers] [vtk-developers] Passing arbitrary float data to a shader through a vtkTexture

Ken Martin ken.martin at kitware.com
Tue Feb 19 08:30:18 EST 2019


Two different things here I think

I believe float data in the texture is the full range as long as the
underlying VTK data type is float.

The image buffer (pixels that get drawn to) by default is unsigned char
normalized 0 to 1. To use float you need a float backed image buffer.
Something like

https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestFramebufferHDR.cxx

But even with that example in the end the framebuffer will be blitted to
screen which is typically an 8bit buffer. But at least in that example you
can accumulate etc in floating point all you want prior to that final blit
to the screen.




On Mon, Feb 18, 2019 at 7:07 PM Patrick Bergeron <pbergeron at spiria.com>
wrote:

> Hi.
>
>
> I am trying to pass custom float data to my shader in the form of a
> vtkTexture which contains VTK_FLOAT data (4 components).
>
>
> As per the documentation, it appears that float data in the
> image buffer gets clamped in the 0-1 range, which is a huge problem for me
> as I'm only getting 0-1 data in the shader: I need the pixel data to be the
> actual float data (which can be anything, not restricted to any particular
> range).
>
>
> How can I do this in VTK ?
>
>
> Patrick.
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
>

-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
101 East Weaver Street
Carrboro, North Carolina
27510 USA

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190219/61a95440/attachment.html>


More information about the vtkusers mailing list