Re: [osg-users] Use glTexStorrage to avoid frame rate breaks when osg::ICO is uploading mipmap texture

2014-05-30 Thread Marcel Pursche
Hi,

to me this looks like a driver implementation specific problem. I would guess 
that the nVidia driver only allocates enough memory for the first mipmap-level 
on the first glTexImage2D. On the second glTexImage2D call it reallocates 
memory for all mipmap-level and copies the first level to the new memory. This 
would explain why the second glTexImage2D call is the slowest.
Have you tried setting GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL before 
the first glTexImage2D call? Maybe this gives a hint to the driver, that the 
texture will have more than just one level.

Another problem you should consider is that glTexStorage2D is only in the core 
since version 4.2. So it will not work on older hardware.

Another question: Do you now how osgEarth creates the new textures? Does is 
create a new texture for every loaded image? If yes, it could be a good idea to 
create set of textures at startup and re-use them(only change the content with 
glTexSubImage2D). This could also help to improve the performance. 

Thank you!

Cheers,
Marcel

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59611#59611





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to cancel transparency ?

2014-05-30 Thread Paul Martz
In the osgWorks osgwTools library, TransparencyUtils.cpp, I enable
transparency by first copying the original StateSet and saving it as
UserData, then modifying the active StateSet to turn on transparency
(BlendFunc, RenderBin, etc).

To disable transparency, I simply restore the original StateSet from
UserData.
   -Paul



On Fri, May 30, 2014 at 5:08 AM, sunpeng  wrote:

> I use following code to set transparency:
>
> osg::StateSet* state = root->getOrCreateStateSet();
>
>
> state->setMode(GL_LIGHTING,osg::StateAttribute::OFF|osg::StateAttribute::PROTECTED);
>
> state->setMode(GL_BLEND,osg::StateAttribute::ON);
> state->setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);
> state->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
>
> osg::BlendColor* bc =new osg::BlendColor(osg::Vec4(1.0,1.0,1.0,0.0));
> osg::BlendFunc*bf = new osg::BlendFunc();
> state->setAttributeAndModes(bf,osg::StateAttribute::ON);
> state->setAttributeAndModes(bc,osg::StateAttribute::ON);
> bf->setSource(osg::BlendFunc::CONSTANT_ALPHA);
> bf->setDestination(osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA);
> bc->setConstantColor(osg::Vec4(1,1,1,0.5));
>
> How to close transparency effect? I tried to use:
>  state->setMode(GL_BLEND,osg::StateAttribute::OFF);
>  state->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
>
> but it seems not work?
> tks!
>
> peng
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
   -Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Info about panoramic images in OSG

2014-05-30 Thread Adrián López
Hi,

sorry for my bad explaining skills! I'll ask for a meeting and we will try to 
clarify ourselves. Then, I'll write back here a better explanation of what we 
want to do.

And thanks for your help. In the meantime I'll search for info on 
texture-mapping.

Cheers,
Adrián

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59609#59609





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FirstPersonManipulator moveForward()/moveUp() Question

2014-05-30 Thread Fitz Chivalrik
Hi,

Nobody can give me a hint in the right direction? Or is it just plain obvious?

Cheers,
Fitz

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59608#59608





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] (no subject)

2014-05-30 Thread wyg030...@163.com



Dearl all,
I have tried to use quad buffer stereo displaying mode, and it successed.
Here, I have the problem, I want to save the scene as a picture, especially one 
left-eye and right-eye.
I do not want to render the scene using LEFT_EYE and RIGHT_EYE one by one, 
sometimes we need interaction.

Then,I met the problem, I used the camera's attach function api, then got a 
image, frame by frame (just testing it).
but the result is not a left-eye and a right-eye. 
How to solve it ??
how to get the left-color-buffer and right-color-buffer ?
can someone give me suggestion or show the code segment?

thanks.

whu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [build] OSG build on maverick

2014-05-30 Thread livio isaia
Hi,

I' trying to build OSG on mac OSX Maverick and always get error:
ld: framework not found SDL
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Now I have SDL framework installed on /System/Library/Frameworks
so why cannot be found?
Does anybody have an idea?
Thank you!

Cheers,
livio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59600#59600





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgViewer::CompositeViewer] Transparency between views

2014-05-30 Thread Stephane Mas
Hi all, and thanks in advance for any interest to this post.

I'm trying to build an application with multiple views and an overlay GUI. 

I dediced to use the CompositeViewer to allow different scenes and manipulators 
in each background views. Unfortunately, I don't manage to make the foreground 
view transparent. It always hide the background views. Is it only a 
configuration issue (camera, graphical context ?), or is it something that 
Views can't do ?

Here is my code for now :

Code:

osgViewer::CompositeViewer * compositeViewer = new osgViewer::CompositeViewer();

// Initialize the graphic context
osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;
traits->x = 100;
traits->y = 100;
traits->width = 300;
traits->height = 300;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
osg::ref_ptr gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

// Build background view
osgViewer::Viewer * backgroundView = new osgViewer::Viewer();
backgroundView->getCamera()->setGraphicsContext(gc.get());
backgroundView->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width, 
traits->height));
compositeViewer->addView( backgroundView );

// Fill background view
osg::ref_ptr backgroundNode = osgDB::readNodeFile(pathToScene);
backgroundView->setSceneData(backgroundNode);

// Build foreground view
osgViewer::Viewer * foregroundView = new osgViewer::Viewer();
foregroundView->getCamera()->setGraphicsContext(gc.get());
foregroundView->getCamera()->setViewport(new osg::Viewport(traits->width/2, 0, 
traits->width/2, traits->height/2));
compositeViewer->addView( foregroundView );

// Try to set it transparent
foregroundView->getCamera()->setClearColor(osg::Vec4(0, 0, 0, 0));

// Fill foreground view
osg::ref_ptr foregroundNode = osgDB::readNodeFile(pathToScene);
foregroundView->setSceneData(foregroundNode);

// Run the composite viewer
compositeViewer->run();




The foregroundView is indeed set to black, but is not transparent at all.

Thank you for any help !
Stephane[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59592#59592





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] App android with OSG

2014-05-30 Thread Mario Blangiforti
Hi,
 i'm new user in the forum. 
I have to realize an android app (i use Eclipse like IDE) in which i'll use OSG 
to load a .tiff file. 
First of all i didn't understand how to install the library using Windows 8 
like operative system.Is there some tutorial which i can consult ?
Eventually, which way have i to use to load the file .tiff?

Thank you!

Cheers,
Mario

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59566#59566





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Info about panoramic images in OSG

2014-05-30 Thread Chris Hanson
Well, considering I don't really know what you're trying to actually
_achieve_, I can't really suggest much on the technique. I think I would
have probably texture-mapped the points, but I don't know what actual
effect you're looking for here.

Feel free to email me privately if you wish.


On Fri, May 30, 2014 at 4:36 AM, Adrián López  wrote:

> Hi,
>
> For what I've been told, the idea is to "load" the panoramic cube-faces
> onto the osg::Viewer where we're displaying the point cloud and "insert"
> them in their respective positions in the cloud (we have available the XYZ
> parameters for each shot).
>
> And yes, we thought of texturing the part of the point cloud we are
> visualizing with its associated cube face. But as I said, I'm blind about
> this topic so I would like to hear your thoughts and receive some guidance
> to point me in the right direction.
>
> Cheers!
> Adrián
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59604#59604
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to cancel transparency ?

2014-05-30 Thread sunpeng
I use following code to set transparency:

osg::StateSet* state = root->getOrCreateStateSet();

state->setMode(GL_LIGHTING,osg::StateAttribute::OFF|osg::StateAttribute::PROTECTED);

state->setMode(GL_BLEND,osg::StateAttribute::ON);
state->setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);
state->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

osg::BlendColor* bc =new osg::BlendColor(osg::Vec4(1.0,1.0,1.0,0.0));
osg::BlendFunc*bf = new osg::BlendFunc();
state->setAttributeAndModes(bf,osg::StateAttribute::ON);
state->setAttributeAndModes(bc,osg::StateAttribute::ON);
bf->setSource(osg::BlendFunc::CONSTANT_ALPHA);
bf->setDestination(osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA);
bc->setConstantColor(osg::Vec4(1,1,1,0.5));

How to close transparency effect? I tried to use:
 state->setMode(GL_BLEND,osg::StateAttribute::OFF);
 state->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);

but it seems not work?
tks!

peng
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Info about panoramic images in OSG

2014-05-30 Thread Adrián López
Hi,

For what I've been told, the idea is to "load" the panoramic cube-faces onto 
the osg::Viewer where we're displaying the point cloud and "insert" them in 
their respective positions in the cloud (we have available the XYZ parameters 
for each shot).

And yes, we thought of texturing the part of the point cloud we are visualizing 
with its associated cube face. But as I said, I'm blind about this topic so I 
would like to hear your thoughts and receive some guidance to point me in the 
right direction.

Cheers!
Adrián

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59604#59604





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org