Hi,

Dirk Reiners schrieb:

I wonder, if I can use the OpenSG Image Objects for creating 64bit textures?
Sure. Just create it as a float image (type=OSG_FLOAT16_IMAGEDATA or
OSG_FLOAT32_IMAGEDATA)
I've tried to set up some 16 bit float images and textures, but it is not as easy as it seems. I tried the following (just for the test a 1x1 pixel sized image):

float array[] = {0.1f, 0.2f, 0.3f};

beginEditCP(myImage);
myImage->set(Image::OSG_RGB_PF, 1, 1, 1, 1, 1, 0, (UInt8*)array, Image::OSG_FLOAT32_IMAGEDATA, true, 1);
endEditCP(myImage);

But when I want to check the three values, like this,

cout << (float)myImage->getPixel(0) << endl;
cout << (float)myImage->getPixel(1) << endl;
cout << (float)myImage->getPixel(2) << endl;

I'm not getting the values, that I stored before. Why?
What happend to my values, when I cast my array ((UInt8*)array) to UInt8?
Or is something wrong with my code? And how can I access it in a shader? Something like this?

vec3 myVec = vec3 (texture2D (myTexture, vec2 (gl_TexCoord[0])));

What kind of float values are stored in the myVec Vektor? Values from 0 to 1 or from 0 to 32bit?

and tell the TextureChunk which internal format
you want (probably GL_RGB32F_ARB).
And I tried to set up the texture:

beginEditCP (_tcInPart);
_tcInPart->setImage(myImage);
_tcInPart->setInternalFormat(GL_RGB32F_ARB);
endEditCP (_tcInPart);

But the compiler don't know the GL_RGB32F_ARB. What else do I have to include and where do I get it from? I'm using a GeForce 6.

That's all for now,
Oliver


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to