Hi Manfred,
On Thu, 2005-02-10 at 09:10, Manfred Weiler wrote:
>
> With respect to the poor performance, I'm not exactly sure, but
> some dull memory tells me, that images are scaled to the next power
> of two, internally. Since this would require quite some CPU work, it
> could be an idea to explicitly allocate an image of size 512x256 and
> to update only a 320x240 subregion. The additional texture area could
> be hidden by using appropriate texture coordinates.
No, if you set the scale flag in the TextureChunk to false the image is
put into the lower left corner of the POT texture and not scaled.
Alternatively (if your hardware supports GL_ARB_texture_rectangle) you
can use rectangular textures (just set imgtarget to
GL_TEXTURE_RECTANGLE_ARB and rememebr to fix the texture coordinates).
I think the pitfall here was the begin/endEdit. imageContentChanged() is
a function that doesn't correspond to a field, so it doesn't need
begin/endEdits (it's one of the very few, actually it's the only one I
can think of right now). That forced a full redefine and killed the
incremental update. Check out the example I sent to see the best way to
get a video background working.
> The only reason I could think of is that just the slice direction
> is erroneously calculated. (The volume bounding box should always
> be ok. Both could be veryfied by setting NullFC for the shader,
> since this should show the slice planes.)
>
> Dirk is right the volume node needs the current camera position
> with respect to the volume for determining the slice direction.
>
> The camera position is computed as:
>
> action->getCamera()->getBeacon()->getToWorld()[3])
>
> and the view matrix as:
>
> action->getCamera()->getBeacon()->getToWorld();
>
> Maybe this is not the right way to do, but it was the only way
> I could figure out it works. (I didn't want to read
> GL_MODELVIEW/PROJECTION_MATRIX) Maybe there are better interfaces
> now. Dirk, could you comment on that?
I've been battling a similar problem with TexGens lately, so I might
have an idea what a possible fix would be.
Manuel, can you try the following:
In OSGSlicer.cpp and OSGDVRVolume.cpp replace the matrix returned by
action->getCamera()->getBeacon()->getToWorld()
with this matrix:
Matrix cameraMat;
Viewport *vp = action->getViewport();
if(vp != NULL)
{
action->getCamera()->getViewing(cameraMat, vp->getPixelWidth(),
vp->getPixelHeight());
}
and see if that fixes it.
Hope it helps
Dirk
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users