Hi,

OSG-2.0 does support a wider range of pixel formats so rather than
chase ghosts it would probably be best just upgrading.  Porting to 2.0
should not be that difficult, if you use osgProducer there is the
library still existing as its own separate project and works fine with
2.0.  The core OSG has seen a number of changes, but most shouldn't
effect backwards compatibility too much.

Robert.

On 6/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

----- Original Message -----
From: "Robert Osfield" <[EMAIL PROTECTED]>
To: "osg users" <[email protected]>
Sent: Tuesday, June 26, 2007 3:28 PM
Subject: Re: [osg-users] Reading from texture


> On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Thanks for the advice,
> > After implementing it, I encountered 3 problems:
> > 1. There are minor differences of the data values between the two
> > implementations (reading from the current texture, and attaching image)
> > maybe images doesn't support half float precision?
>
> There is some half float support in the 2.0 version of osg::Image, but
> this might not coverage your usage.
>

I'm still working with OSG1.2. currently I don't have time for the porting
(even that I played a little with OSG2.0 on my free time :)). anyway, I will
try to compile the OSG2.0 image code with OSG1.2 and see what happens.

> > 2. The image was rescaled to power of 2. (300x300 ---> 256x256) while
> > textures sizes don't have to be power of two. (is there a way to define
> > image that won't be a power of 2 and attach it to the FBO?)
>
> What makes you think the images are rescaled to a power of two when
> reading?  There isn't any such code.

I don't remember the exact words but OSG prompts in the console something
like "rescaling (300x300) image to (256x256)".

> There only code for rescaling to
> power of two happens when applying on non power of two image to a
> power of two texture.

I allocated both at the same code section using the same width and height.

> Note the OSG support non power of two texture
> where supported by OpenGL drivers, but by default this is switched off
> due to portability problems related to OpenGL driver saying non power
> of two is supported, but then implementing it in software...
>
> See osg::Texture::setResizeNonPowerOfTwoHint(bool);

I'll look for it.

>
> > 3. It run slower than binding the texture object and reading from
current
> > texture.
>
> It shouldn't run slower, if it is then there is possible some issue
> along the way such as pixel formats being inconsistent.

Both are using GL_RGBA mode with GL_FLOAT as the type. The texture has
internal format of half float, I don't seem to remember setting the image to
half float but I did what I saw in one of the examples that show how to
attach image to texture and having the texture automaticlly updated when the
image is changed.
Could that be the problem? is it possible to set image "internalFormat"?
did you mean something else by pixel format?

>
> Robert.

thanks,
 Guy.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to