[of-dev] ofTexture and glDataType
memo at memo.tv
Thu Apr 14 09:16:31 PDT 2011
You can create a 16bit float rgba texture (half precision floats) by
passing GL_RGBA16F_ARB to ofTexture. When filling it you can pass an array
of normal 32bit floats. I"ve never had to readback from these, but as far as
I know you can have it converted to 32bit on the read back.
2011/4/14 Elliot Woods <elliot at kimchiandchips.com>
> how are the 16bit floats defined? custom type?
> On 15 April 2011 00:58, Memo Akten <memo at memo.tv> wrote:
>> Yea this always concerned me too! I added the switch statement a while ago
>> because I needed float textures. Before the switch it was hardcoded to
>> luminance+unsigned byte. So when I added the switch+float textures, I didn't
>> want to change the default in case it broke some existing apps.
>> The 3rd parameter is a hint, so like golan says the implementation
>> (drivers) decides what to do and picks the most suitable format.
>> Moving forward I'd vote for ofImage (and ofPixels) to support float
>> textures too. I think we could do with a generic imageFormat class/struct
>> which stores info on all relevant info of an image - but ideally it should
>> be able to support float, and half-float (crucial when dealing with fast fbo
>> based stuff). And then ofTexture, ofPixels and ofImage can all read from
>> this format struct and do everything accordingly.
>> On 14 April 2011 16:38, Golan Levin <golan at flong.com> wrote:
>>> "fortunately, the fact that this works means, i think, that GL is always
>>> storing colors as 4 bytes regardless of whether you tell it GL_LUMINANCE or
>>> GL_RGB, otherwise we would have seen this sooner..."
>>> I believe this is graphics-card (i.e. implementation) dependent.
>>> On Thu, Apr 14, 2011 at 10:39 AM, Kyle McDonald <kyle at kylemcdonald.net>wrote:
>>>> i just wanted to bring this to the attention of the more advanced
>>>> users here on the dev list:
>>>> tl;dr: there is a really weird ambiguity hidden deep in the heart of
>>>> OF that has never made sense to me,
>>>> and now that i've looked closer i think something must be wrong and
>>>> should be addressed.
>>>> of-dev mailing list
>>>> of-dev at dev.openframeworks.cc
>>> of-dev mailing list
>>> of-dev at dev.openframeworks.cc
>> Memo Akten
>> of-dev mailing list
>> of-dev at dev.openframeworks.cc
> Elliot Woods
> Kimchi and Chips' <http://www.kimchiandchips.com/> technical designer
> *We've enjoyed some fantastic press attention recently, and we're very
> grateful to you all for sharing our work and experiments. Please click the
> logos below to read recent articles. *
> 저희의 일과 작업을 함께 공유해준 여러 미디어들께 감사합니다.
> 아래 로고를 클릭하시면 김치앤칩스의 기사를 읽을 수 있습니다. [image: design boom]<http://www.designboom.com/weblog/cat/10/view/12885/kimchi-and-chips-link.html> [image:
> create digital motion]<http://createdigitalmotion.com/2011/01/kinect-augmented-reality-as-projection-mapping-meets-depth-sensing-hint-its-awesome/> [image:
> creative applications]<http://www.creativeapplications.net/flash/link-openframeworks-ipad-flash-vvvv/> [image:
> engadget]<http://www.engadget.com/2011/01/17/kinect-projector-augmented-reality-fireballs-video/> [image:
> designnet] <http://newsletter.kimchiandchips.com/2011-01/designnet.jpeg>
> of-dev mailing list
> of-dev at dev.openframeworks.cc
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the of-dev