<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
Hi Ken
<div><br>
</div>
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><font color="#000000"><span style="caret-color: rgb(0, 0, 0); background-color: rgba(255, 255, 255, 0);">I believe float data in the texture is the full range as long as the underlying VTK data type is float.</span></font></div>
</div>
</div>
</blockquote>
<br>
</div>
<div><br>
</div>
<div>I would have assumed so too!  But as per my follow up note I sent just a little while ago, the floats are unfortunately not the full range as they get converted to rgba 8 bit per channel in the vtkOpenGLTexture::Load() function —- for which I submitted
 a simple fix to indeed keep the full range. </div>
<div>
<div><br>
</div>
<div>Just to be clear, I need to pass data to a shader in order to shade a triangle mesh in a particular way. I don’t need to write to a float framebuffer. 
<div><br>
</div>
<div>The data I need is not pixels and it’s not colors. It’s a float array used for some arbitrary shader computation. </div>
<div><br>
</div>
<div>I used to pass these floats as uniform data to the shader but I ran out of uniforms and had to encode this data elsewhere, eg: in an image buffer instead. In my shader I access this data with the glsl function texelFetch() instead of reading a uniform. </div>
<div><br>
</div>
<div>
<div dir="ltr">Patrick Bergeron</div>
<div dir="ltr"><br>
On Feb 19, 2019, at 08:30, Ken Martin <<a href="mailto:ken.martin@kitware.com">ken.martin@kitware.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><br>
</div>
<div>Two different things here I think<br>
</div>
<div><br>
</div>
<div>I believe float data in the texture is the full range as long as the underlying VTK data type is float.</div>
<div><br>
</div>
<div>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</div>
<div><br>
</div>
<div><a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestFramebufferHDR.cxx">https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestFramebufferHDR.cxx</a></div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Feb 18, 2019 at 7:07 PM Patrick Bergeron <<a href="mailto:pbergeron@spiria.com">pbergeron@spiria.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_3544414889348039846divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="margin-top:0px;margin-bottom:0px">Hi.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">I am trying to pass custom float data to my shader in the form of a vtkTexture which contains VTK_FLOAT data (4 components).</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">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).</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">How can I do this in VTK ?</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Patrick.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<div id="gmail-m_3544414889348039846Signature">
<div id="gmail-m_3544414889348039846divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p></p>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Ken Martin PhD
<div>Distinguished Engineer<br>
<span style="font-size:12.8px">Kitware Inc.</span><br>
</div>
<div>101 East Weaver Street<br>
Carrboro, North Carolina<br>
27510 USA<br>
<br>
<div><span style="font-size:10pt;font-family:Tahoma,sans-serif">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.</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>