Hello Victor,

On 06/11/2012 10:18 AM, Victor Haefner wrote:
> I have a problem with passing a 1D Array of floats to my shader:
>
> TextureObjChunk::initialize image failed: invalid value(0x501)
>
> This error happens when I try to use a 1D Image:
> img->set( Image::OSG_RGBA_PF, N, 1, 1, 1, 1, 0, (UChar8*) &buffer[0],
> OSG::Image::OSG_FLOAT32_IMAGEDATA);

that looks correct.

> where buffer is a std vector<float> with size 4*N
>
> Texture:
> tex_obj_chunk->setTarget(GL_TEXTURE_1D);
> tex_obj_chunk->setInternalFormat(GL_RGBA_FLOAT32_ATI);

have you tried not setting any internal format? IIRC the texture chunk 
usually figures it out by looking at the image attached to it.
If leaving internal format unset does not work, internal format should 
be GL_RGBA or GL_RGBA32F for your case (at least that is my reading of 
http://www.opengl.org/sdk/docs/man4/xhtml/glTexImage1D.xml).
Please note that GL_RGBA32F is the core spec name for that enum value, I 
guess the extension name is GL_RGBA32F_ARB (from GL_ARB_texture_float 
extension).

        Cheers,
                Carsten

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to