Hi Enrico,

On Fri, 2005-09-30 at 12:22 +0200, Enrico Borrione wrote:
> Hi all OpenSG users,
> i was wondering whether in the new 1.6 version 
> was added support for the 16bit floating point
> half textures. it would be very handy to pass
> half raw pixels to my shaders, without having
> to scale all the image off-line. 
> 

Yup, that should work just fine like this:

    Real16 imgdata2[] = 
        {   Real16(1), Real16(0), Real16(0), Real16(0.5),
            Real16(0), Real16(1), Real16(0), Real16(0.5),
            Real16(0), Real16(0), Real16(1), Real16(1),
            Real16(.5), Real16(1), Real16(1), Real16(1) };
    
    ImagePtr image = Image::create();
    image->set( Image::OSG_RGBA_PF, 2, 2, 1, 1, 1, 0, 
                reinterpret_cast<UChar8*>(imgdata2), 
                Image::OSG_FLOAT16_IMAGEDATA );

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to