Hi Michael,
Michael Schwier wrote:
> Hello,
>
> I was wondering if it is possible to use 16bit or 32bit floating point
> textures with OpenSG 1.6? Because OSG_RGBA_PF just maps to GL_RGBA and I
> didn't find a mapping to GL_RGBA32F_ARB for example.
>
The internal Image storage is split in the components and format, so the
fact that
OSG_RGBA_PF just maps to GL_RGBA is just convenience but not a problem.
Here's an example on how to create a 32 bit texture:
Real32 imgdata[] =
{ 4,0,0, 0,3,0, 0,0,4, 2,2,0 };
ImagePtr bottom_img = Image::create();
bottom_img->set(Image::OSG_RGB_PF, 2, 2, 1, 1, 1, 0, (UInt8*)imgdata,
Image::OSG_FLOAT32_IMAGEDATA);
TextureChunkPtr bottom_tex = TextureChunk::create();
beginEditCP(bottom_tex);
bottom_tex->setImage(bottom_img);
bottom_tex->setMinFilter(GL_NEAREST);
bottom_tex->setMagFilter(GL_NEAREST); //LINEAR makes it REALLY slow
bottom_tex->setWrapS(GL_CLAMP_TO_EDGE);
bottom_tex->setWrapT(GL_CLAMP_TO_EDGE);
// Commenting out the next line makes it use 8 bit internally
bottom_tex->setInternalFormat(GL_RGBA32F_ARB);
endEditCP(bottom_tex);
Hope it helps
Dirk
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users