Re: [osg-users] Why to reset OSG settings every time while rendering in Android

2012-09-24 Thread Koduri Lakshmi
Hi,

I came to know that the QCAR::Renderer::getInstance().drawVideoBackground() 
statement clears the OpenGLES context. I think this is the reason to reset the 
OSG setting every time.

I tried to restore the  OpenGLES context as follows. Store the State object at 
initial time and restore it after every render (viewer-frame()).
 But still I am not able to see model with background.

in initOsgWindow(int sW,int sH) (calling only once) function


Code:
prevStateSet = new osg::StateSet();

_viewer-getCamera()-getGraphicsContext()-getState()-captureCurrentState(*prevStateSet.get());
 



After render (viewer-frame()) I wrotet he code as follows


Code:
osgState = _viewer-getCamera()-getGraphicsContext()-getState();
  osgState-reset();
  osgState-apply(prevStateSet.get()); 



Even after this I am not getting model.

In the similar way I reseted the Graphics context (getGraphicsContext from 
camera at init and reset after render). But this too not working.

Can anyone please help me what to do?


... 

Thank you!

Cheers,
Koduri

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




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


Re: [osg-users] issue with OSG on Mac OS Lion

2012-09-24 Thread Mike Krus
Hi

thanks for the details. We recently tried to the visibility flag thing on GCC 
to try and speed up link times. What not significantly improving it anyway so 
happy to do without it.


Mike

On 21 Sep 2012, at 22:38, Stephan Huber wrote:

Hi Mike,
Am 21.09.12 10:00, schrieb Mike Krus:

well, you what? turning that off has fixed the issue!! Any explanation why? is 
it an llvm-gcc bug?

no, it's not a bug, it's a feature :) Basically gcc's dynamic_cast
compares two classes by pointer to their type_info and not by their
names, so if you have the same class compiled in your app and in your
lib, the dynamic_cast will fail, if visibility is set to hidden, as the
linker cannot merge the two classes into one.

I hope the underlying issue gets a little bit clearer, here is a ink for
more info:

http://osdir.com/ml/xcode-users/2010-01/msg00305.html

cheers,

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


Mike Krus (PhD) - Principal Software Engineer

Midland Valley Exploration
144 West George Street
Glasgow G2 2HG, UK
Tel: +44 141 332 2681
Fax: +44 141 332 6792

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


[osg-users] Matrix mode GL_COLOR

2012-09-24 Thread Filip Arlet
Hi,

I want to use GL_COLOR matrix mode. I want to render everything under 
osg::Group node in slightly different color. Is GL_COLOR matrix mode capable of 
this ? And what is the best implementation approach in osg ?

Thank you!

Cheers,
Filip

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





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


Re: [osg-users] Matrix mode GL_COLOR

2012-09-24 Thread Sebastian Messerschmidt

Hello Filip,

As far as I remember, there is no hardware support for color matrix.
It was supposed to be used for things like rendering the lumiance etc. 
of a color, which can be done with fragment/vertex shaders nowadays.
If you want to change the color you should use the Material 
stateAttribute or change the color array of your geometry.


cheers
Sebastian


Hi,

I want to use GL_COLOR matrix mode. I want to render everything under 
osg::Group node in slightly different color. Is GL_COLOR matrix mode capable of 
this ? And what is the best implementation approach in osg ?

Thank you!

Cheers,
Filip

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





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


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


[osg-users] Shader reloading

2012-09-24 Thread Christian Rumpf
hello!

I'm trying to simulate noise effects in real time using OSG and GLSL.

I rendered to texture a scene to get a sampler2D. Mu and Sigma for noise 
simulation are static. My idea is to reload fragment shader in a while loop 
with a random number as uniform because GLSL's noise() function doesn't seem to 
work on my computer. Therefore I wrote a function randomNumber(int from, int 
to) which returns a random int between from and to.


Code:

void loadNoiseShader(int width, int height, osg::Vec3d mue, osg::Vec3d sigma, 
osg::Geode* geode)
{
osg::ref_ptrosg::Shader vertShader = 
osgDB::readShaderFile(osg::Shader::VERTEX, noise.vert);
osg::ref_ptrosg::Shader fragShader = 
osgDB::readShaderFile(osg::Shader::FRAGMENT, noise.frag);

osg::ref_ptrosg::Program program = new osg::Program;
program-addShader(vertShader.get());
program-addShader(fragShader.get());

osg::StateSet* ss = geode-getOrCreateStateSet();
ss-setAttributeAndModes(program.get());

osg::ref_ptrosg::Uniform texUniform = new osg::Uniform(RTScene, 0);
osg::ref_ptrosg::Uniform windowSize = new osg::Uniform(screen, 
osg::Vec2(width, height));
osg::ref_ptrosg::Uniform mueUniform = new osg::Uniform(mue, mue);
osg::ref_ptrosg::Uniform sigmaUniform = new osg::Uniform(sigma, 
sigma);
osg::ref_ptrosg::Uniform randomUniform = new osg::Uniform(random, 
randomNumber(-255, 255));
ss-addUniform(texUniform.get());
ss-addUniform(windowSize.get());
ss-addUniform(sigmaUniform.get());
ss-addUniform(mueUniform.get());
ss-addUniform(randomUniform.get());
}

/*...*/

while(!viewer.done())
{
   loadNoiseShader(width, height, mu, sigma, geode.get());
   viewer.frame();
}




I thought that this would work, but unfortunately the executive crashes at the 
beginning. Can someone explain me that please?

lg Chris

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





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


Re: [osg-users] Shader reloading

2012-09-24 Thread Sergey Polischuk
Hi, Christian

Can't help you with crash, but i think you can find this usefull:
1) noise functions for glsl not implemented in hardware\drivers of most 
vendors, so dont even bother to use them.
2) why do you ever need to recreate program and all that stuff, if all you need 
is to change randomUniform value like randomUniform-set(randomNumber(-255, 
255)) in a frame loop?
3) i think you are just chosen wrong way to do it. Most common approach is to 
use one or several pre-generated noise textures and mix and match them in 
shader with various texture coordinate sets (if you need some kind of animation 
- change texcoords by function of time or some uniform value).

Cheers,
Sergey.

24.09.2012, 18:15, Christian Rumpf ru...@student.tugraz.at:
 hello!

 I'm trying to simulate noise effects in real time using OSG and GLSL.

 I rendered to texture a scene to get a sampler2D. Mu and Sigma for noise 
 simulation are static. My idea is to reload fragment shader in a while loop 
 with a random number as uniform because GLSL's noise() function doesn't seem 
 to work on my computer. Therefore I wrote a function randomNumber(int from, 
 int to) which returns a random int between from and to.

 Code:

 void loadNoiseShader(int width, int height, osg::Vec3d mue, osg::Vec3d 
 sigma, osg::Geode* geode)
 {
 osg::ref_ptrosg::Shader vertShader = 
 osgDB::readShaderFile(osg::Shader::VERTEX, noise.vert);
 osg::ref_ptrosg::Shader fragShader = 
 osgDB::readShaderFile(osg::Shader::FRAGMENT, noise.frag);

 osg::ref_ptrosg::Program program = new osg::Program;
 program-addShader(vertShader.get());
 program-addShader(fragShader.get());

 osg::StateSet* ss = geode-getOrCreateStateSet();
 ss-setAttributeAndModes(program.get());

 osg::ref_ptrosg::Uniform texUniform = new osg::Uniform(RTScene, 
 0);
 osg::ref_ptrosg::Uniform windowSize = new osg::Uniform(screen, 
 osg::Vec2(width, height));
 osg::ref_ptrosg::Uniform mueUniform = new osg::Uniform(mue, mue);
 osg::ref_ptrosg::Uniform sigmaUniform = new osg::Uniform(sigma, 
 sigma);
 osg::ref_ptrosg::Uniform randomUniform = new osg::Uniform(random, 
 randomNumber(-255, 255));
 ss-addUniform(texUniform.get());
 ss-addUniform(windowSize.get());
 ss-addUniform(sigmaUniform.get());
 ss-addUniform(mueUniform.get());
 ss-addUniform(randomUniform.get());
 }

 /*...*/

 while(!viewer.done())
 {
    loadNoiseShader(width, height, mu, sigma, geode.get());
    viewer.frame();
 }

 I thought that this would work, but unfortunately the executive crashes at 
 the beginning. Can someone explain me that please?

 lg Chris

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

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


[osg-users] Updated FFmpeg plugin

2012-09-24 Thread David Longest
Hello!

I have been making updates to the FFmpeg plugin that I believe would be useful 
for others using OpenSceneGraph. The updates mostly revolve around changing the 
plugin to use APIs from FFmpeg 0.11. Since the previously supported version of 
FFmpeg is at least two years old, is it important to maintain backwards 
compatibility with that release?

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


Re: [osg-users] VPB in VS10...

2012-09-24 Thread Shayne Tueller
Chris,

See my previous post. 

The template compile errors that I'm getting are strange. Perusing the forum, I 
did find something similar when someone was compiling osgPhysics against OSG...

Thanks,
Shayne

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





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


Re: [osg-users] VPB in VS10...

2012-09-24 Thread Chris Hanson

 See my previous post.
  The template compile errors that I'm getting are strange. Perusing the
 forum, I did find something similar when someone was compiling osgPhysics
 against OSG...


  I didn't find it at a quick glance. Can you email it to me privately?


-- 
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 • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VPB in VS10...

2012-09-24 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
You've got mail...

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris
Hanson
Sent: Monday, September 24, 2012 1:59 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] VPB in VS10...

See my previous post.
 The template compile errors that I'm getting are strange.
Perusing the forum, I did find something similar when someone was
compiling osgPhysics against OSG...




  I didn't find it at a quick glance. Can you email it to me privately?
 

-- 

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 *
Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded *
Mobile * iPhone/iPad/iOS * Android

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


Re: [osg-users] Can I run OSG even on 128MB RAM grapics card

2012-09-24 Thread Ulrich Hertlein
Hi Koduri,

On 21/09/12 22:17, Koduri Lakshmi wrote:
 I did a sample program to render a model using OSG.
 
 I created a complex model from 3dsmax having  1lack of vertices.
 I exported it as OSG using OSGExporter. I used optimization techniques to 
 reduce size
 of the final osg file (don't know whether the vertexes are optimized or not ).
 
 It renders very well on the system having NVIDIA GeForce 8400GS with a RAM of 
 512 MB graphics card. 
 
 Now when I run this on a system having Intel graphics card with 128 MB RAM 
 then the
 performance is very poor. I did a small transformation from left to right. 
 The moving is
 sooo slow and getting
 Scaling Image from 640 by 480 to 512 by 512 on command prompt (for textures 
 of the model).

Scaling the textures will kill performance.

- if your hardware does not support non-power-of-two textures then rescale them 
offline.
- if you're running out of texture memory scale them down, e.g. 128x128 rather 
than 512x512.

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


[osg-users] Qt crashes on key press

2012-09-24 Thread Max Sergeev
Hello!

I've a problem with Qt once again :)

There is OSG scene, where I put some Qt controls, like in osgQtBrowser example, 
where Qt controls are getting rendered like OSG objects (I create camera for 
them and stuff).
So, when I press any key on keyboard, Qt controls just jump somewhere around 
the screen and stop reacting on any actions (mouse clicks etc). 
What can this possibly be? Or, in other case, is there a way to make Qt objects 
(each in it's own camera) ignore any keyboard actions?

Sorry for poor explanation, and thank you in advance!

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





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


[osg-users] how to pick a cluster of points

2012-09-24 Thread wh_xiexing
Dear friends .
i want to create an editor  tool that can select a cluster of points 
one time in order to remove the selected points .
osg provide the functions to do that job?   or i need to code from 
scratch?
thank you for your help




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