Re: [osg-users] osgUtil::Tessellator not working with double precision

2012-04-04 Thread Robert Osfield
Hi Preet,

On 4 April 2012 01:10, Preet prismatic.proj...@gmail.com wrote:
 I need Vec3d precision for my geometry. I spent a long time trying to
 figure out why tessellator wouldn't work at all on my data, until I
 changed all of my Vec3d's to 'Vec3' on a whim. Now it works fine...
 but the issue still remains. How can I use double precision with
 tessellator?

Support for Vec3d's for geometry in the OSG is relatively new thing
and not all elements support them, Tessellator included.  Internal the
GLU tessellator does use double vertices so there is the potentially
for adding support for Vec3dArray into osgUtil::Tessellator, however,
one will need to modify the internals in a number of places to make
this possible.

As a general comment Vec3d's for geometry will still be very very
inefficient to render on almost all graphics hardware so it's not
recommend to use double for geometry for anything other than importing
GIS data.  Once the data is in the scene graph it's best to decorate
your subgraph MatrixTransform the places a subgraph into it's final
position in space, whilst the subgraph is moved to local coordinate
frame.

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


Re: [osg-users] osgUtil::Tessellator not working with double precision

2012-04-04 Thread Robert Osfield
012/4/4 rcyboom rcyb...@163.com:
 Hi,
 In my here,once inclued osgUtil/Tessellator , the project can't be
 compiling.it make some errors,some 'Key word' like [GLU] [INT].
 vs2008+osg3.01+ qmake(QtCreator).

I'm afraid this makes no sense to me, and I can't image anyone else
having a clue to what you are talking about either. If you have
compile problems then use a separate thread and be clear what the
error is.

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


Re: [osg-users] [osgOcean] Problem: models are too bright, whitewashed.

2012-04-04 Thread Dario Minieri
Hi,

Ok, this is a classic problem about ocean shader. We have to re-set the 
attributes mode with a custom or empty shader.

Thank you!

Cheers, bye.

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





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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Martin Naylor
Hi Torben,
it looks like it is something in the shaders part or driver related.
I cannot test remotely at present, due to shaders not working via RDP.
The shader one's I tested osgforest  crashed with the same error last night.
It crashes in the vector header file template for VS2008, I hate that
template stuff! :)
Maybe your mobile drivers won't support the newer shader stuff(opengl 4.2?),
hence why you don't see the error there.
I will role my Osg back to before all these changes after trying the below
to see if I still get the error, roll back my drivers etc and let you know
how I get on...
Although rolling back drivers may just mask the error as it won't have
support for gl4.2(guessing here), I am not up to speed the newer GL
changes..
Let you know later...

Cheers

Martin

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: 04 April 2012 06:45
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] problem with svn (atomic counter?)

Hi Martin,

interesting, I have exactly the same error! (Win7 x64, GTX480 with 296.10
Driver: OSG in 32 bit and in 64 bit has the error)

My thread is http://forum.openscenegraph.org/viewtopic.php?t=10161

Please verify that your error occurs in all aplications using (and therefor
compiling) shaders. If you runf your apps from console and
OSG_NOTIFY_LEVEL=DEBUG, you should see the last step before shutting down
the app is the shader compilation.

I copied my compiled OSG onto my laptop with older Nvidia mobile graphics,
there it runs fine. I thought my primary build machine ist screwed up and
decided to reinstall the machine from scratch (not done yet). But now I read
your error which seems to be exactly my own one, so it may by a true error.

Any thoughts?

Best regards,
Torben

... 

Thank you!

Cheers,
Torben

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





___
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] How to apply setUseModelViewAndProjectionUniforms to the scene

2012-04-04 Thread Eldar Insafutdinov
Hi

I switched to using osg_* variables in my shaders instead of built-in gl_* in 
order to comply with with OpenGL 3.x/ OpenGL ES 2.0. However it doesn't seem to 
work for me I found that it's managed by the State class, and I can obtain the 
state object from the GraphicsContext. however a code like this doesn't work:


Code:

int main()
{
osgViewer::Viewer viewer;
viewer.setSceneData(new MyCustomNode());

osg::State* state = viewer.getCamera()-getGraphicsContext()-getState();
state-setUseModelViewAndProjectionUniforms(true);
state-setUseVertexAttributeAliasing(true);
return viewer.run();
}




The problem is that viewer.getCamera()-getGraphicsContext() return 0, 
suggesting that I have to setup one myself. But I will need to provide width 
and height and other parameters, which I don't really want to do, because they 
are unrelevant and I didn't have to do that before. Is there a way to get the 
default GraphicsContext instance, as I just need to set the parameters for 
shaders?

Cheers,

Eldar

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





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


Re: [osg-users] [solved] All shader examples/code are crashing

2012-04-04 Thread Martin Naylor
Hi Torben,
I just reviewed the thread and it sounds like we are in the same boat :p
It appears to be the exact error I am receiving...

Cheers

Martin



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: 02 April 2012 06:35
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [solved] All shader examples/code are crashing

Hi,

I've now access again to my office PC. OSG runs fine on that machine, it
seems my build environment ist totally screwed up ( waah I 'love' windows
reinstalls...)

Sorry for the noise!

Cheers,
Torben

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





___
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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Torben Dannhauer
Hi Martin,

yes, my error also claims to happen in the vector header, but the question is 
what causes it, the code inthat file is used for longer times.

regarding the 4.2 and older graphics you may be right! Anyway, I'm happy I 
still have a chance to avoid a complete reinstall of my machine :)

I'm looking forward to your results! Unfortunately I'll be on the road for the 
next 10 days (starting tomorrow) and have only my notebook with me. For that 
days I cannot run test on my machine but I'm still available for discussion!

Thank you!

Cheers,
Torben

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





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


Re: [osg-users] How to apply setUseModelViewAndProjectionUniforms to the scene

2012-04-04 Thread Robert Osfield
Hi Eldar,

You need to call viewer.realize() to create the windows otherwise the
Camera won't haven't anything assigned yet.

In your example code viewer.run() will be calling viewer.realize() for
you unless you've already done so, so as it stands your example code
won't have any windows and hence graphics contexts created when you
attempt to get the State object.

Robert.

On 4 April 2012 12:33, Eldar Insafutdinov e.insafutdi...@gmail.com wrote:
 Hi

 I switched to using osg_* variables in my shaders instead of built-in gl_* in 
 order to comply with with OpenGL 3.x/ OpenGL ES 2.0. However it doesn't seem 
 to work for me I found that it's managed by the State class, and I can obtain 
 the state object from the GraphicsContext. however a code like this doesn't 
 work:


 Code:

 int main()
 {
    osgViewer::Viewer viewer;
    viewer.setSceneData(new MyCustomNode());

    osg::State* state = viewer.getCamera()-getGraphicsContext()-getState();
    state-setUseModelViewAndProjectionUniforms(true);
    state-setUseVertexAttributeAliasing(true);
    return viewer.run();
 }




 The problem is that viewer.getCamera()-getGraphicsContext() return 0, 
 suggesting that I have to setup one myself. But I will need to provide width 
 and height and other parameters, which I don't really want to do, because 
 they are unrelevant and I didn't have to do that before. Is there a way to 
 get the default GraphicsContext instance, as I just need to set the 
 parameters for shaders?

 Cheers,

 Eldar

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





 ___
 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


Re: [osg-users] How to apply setUseModelViewAndProjectionUniforms to the scene

2012-04-04 Thread Eldar Insafutdinov
Thanks, Robert, that did the trick! However after setting 
UseVertexAttributeAliasing parameter I got another problem - the surface nodes 
that don't use any shaders (I keep them as a fallback option) are broken now - 
textures are not applied to them anymore. Is there a way to both use new style 
variable binding and at the same time not to break stuff designed for fixed 
function pipeline?

Cheers,
Eldar

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





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


Re: [osg-users] Primitive Restart

2012-04-04 Thread Robert Osfield
Hi Frederic,

I have a quick look up on the GL primitive restart and understand it a
bit better now.  As this feature has to be enabled/disabled using
glEnable/glDisable it naturally would be an StateSet::setMode() rather
than something embedded in a DrawElements.  The
glPrimitiveRestartIndex call is also something I would be inclined to
put in it's own dedicate StateAttribute as it's likely to be something
that one would set to a particular value for a subgraph and not change
it.  When working to get the best performance out of OpenGL is crucial
to minimize the number of separate glEnable/glDisable and other OpenGL
calls that change the state machine, the OSG manages this by having
fine grained lazy state updating so the setMode and custom
StateAttribute suggestion here would take advantage of this - whereas
putting these in DrawElements work break this lazy state updating
facility and lower performance.  Putting the mode changes into an
DrawElements would also leave the door open to mode changes being done
within a display list which will break the lazy state updating
mechanism and lead to state leakage.

Using a custom StateAttribute for glPrimitiveRestartIndex would
however cause problems for code that parses DrawElements without
knowing that there is a special index embedded it in.  To handle this
one would need to watch out for this custom state attribute and mode
in the parental path and then it's it's value when parsing the
DrawElements.

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


[osg-users] Google Summer of Code

2012-04-04 Thread Chris Hanson
  A number of project I've worked with have made good use of the Google
Summer of Code to make useful improvements.

http://googleblog.blogspot.com/2012/03/new-kind-of-summer-job-open-source.html

  Do we feel like there are useful tasks to be done that might be do-able
by a Summer of Code student?

  Has anyone here worked within the SoC process before?


-- 
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] Google Summer of Code

2012-04-04 Thread Philipp Moeller
Chris Hanson xe...@alphapixel.com writes:

   A number of project I've worked with have made good use of the Google
 Summer of Code to make useful improvements.

 http://googleblog.blogspot.com/2012/03/new-kind-of-summer-job-open-source.html

   Do we feel like there are useful tasks to be done that might be do-able
 by a Summer of Code student?

   Has anyone here worked within the SoC process before?

I have been a student and maybe I'm going to be a mentor this year. I'm
not really involved with OpenSceneGraph but could give some advice for
how to organize participation.

The dead-line for organization applications for this year is over
already and the deadline for student applications is in 2 days, so
nothing can happen this year.

Cheers,
Philipp

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


Re: [osg-users] New FrontFace Modes

2012-04-04 Thread Felix Nawothnig
2012/4/3 Robert Osfield robert.osfi...@gmail.com:
 Having mixed front face/back face within a single subgraph is not
 ideal.  I would generally recommend that one should build/optimize a
 scene graph so that the as much work as possible is done as
 pre-processing/optimization/scene graph construction stage that
 minimizes the number of state changes - in your case avoid if possible
 all the osg::FrontFace entries in a subgraph by flipping the actual
 triangles so that they are all consistent in orientation i.e. all
 front face or all back face.

Well yes - but this is not possible when the same triangles are
rendered with both orientations  (i.e. when they can be reached
through parental paths with both positive and negative determinants in
the MVM)?

The only thing one could do would be to duplicate the geometry...
which is not really an optimization.

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


Re: [osg-users] Primitive Restart

2012-04-04 Thread Felix Nawothnig
2012/4/4 Robert Osfield robert.osfi...@gmail.com:
 I have a quick look up on the GL primitive restart and understand it a
 bit better now.  As this feature has to be enabled/disabled using
 glEnable/glDisable it naturally would be an StateSet::setMode() rather
 than something embedded in a DrawElements.  The
 glPrimitiveRestartIndex call is also something I would be inclined to
 put in it's own dedicate StateAttribute as it's likely to be something
 that one would set to a particular value for a subgraph and not change
 it.  When working to get the best performance out of OpenGL is crucial
 to minimize the number of separate glEnable/glDisable and other OpenGL
 calls that change the state machine, the OSG manages this by having
 fine grained lazy state updating so the setMode and custom
 StateAttribute suggestion here would take advantage of this - whereas
 putting these in DrawElements work break this lazy state updating
 facility and lower performance.  Putting the mode changes into an

Well, the methods I added to osg::State do lazy updating - a
StateAttribute would of course increase performance... but see below
for the problems...

A dummy state which just affects sorting of the leafs would give the
same advantages, without the problems.

 DrawElements would also leave the door open to mode changes being done
 within a display list which will break the lazy state updating
 mechanism and lead to state leakage.

I believe the same dummy state would help to avoid that too, no?

 Using a custom StateAttribute for glPrimitiveRestartIndex would
 however cause problems for code that parses DrawElements without
 knowing that there is a special index embedded it in.  To handle this
 one would need to watch out for this custom state attribute and mode
 in the parental path and then it's it's value when parsing the
 DrawElements.

And this will cause problems all over OSG... suddently all
functionality which deals with the geometry of primitive sets
(intersection visitors, kd trees, exporters) will suddently need to
accumulate the State when traversing graphs... and crash when the code
wasn't written with that in mind. I don't think that this is a
realistic approach...

My changes just add new pure virtual functions to the respective
functors - the compiler then tells you when you need to extend your
code to primitive restart.

And a primitive set still completely describes it's geometry -
independent of the state used to render it. I believe that's a very
nice thing to have...

Cheers,

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


Re: [osg-users] Primitive Restart

2012-04-04 Thread Felix Nawothnig
2012/4/3 Robert Osfield robert.osfi...@gmail.com:
 Is there any reason why you can't just connect the tri strips together
 using a repeated indices to create a degenerate triangle that connects
 two strips together.

Of course you can do that - it just wastes quite some memory for
indices, considering that automatically generated tri strips usually
are just about 5-6 tris long.

For our geometry (30+ million vertices) this really makes quite a
difference, after we put the actual vertex data into a highly packed
format (3x16bit fixed point position, 3x8bit notmals).

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Martin Naylor
Hi,
Ok I have done the following:
Rolled back OSG to 13049: Worked Great with all shaders.
Rolled forward to 13050: Crash Occurs, so its looking like those
changes/driver/GL4.2 that is causing the crash, not mine or Torben's system.
I don't want to rebuild mine either ;)
I see no Nvdia dll in the call stack, not sure if I should, so am thinking
an OSG problem(please take with a pinch of salt).
So I have had a go at debugging, its beyond me but a couple of questions to
help me in my pursuit.
The call before the crash in the vector stl lib is:

if (_extensions-isShaderAtomicCounterSupported())
{
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
atomicCounterMap.end();
 it != end; ++it)
{
uniformIndex.push_back(it-first);
}

_extensions-glGetActiveUniformsiv( _glProgramHandle,
uniformIndex.size(),
(uniformIndex[0]),
GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
(bufferIndex[0]) );


The above is doing a for loop and pushing the first item back, whilst
debugging the 'end' has a bad_ptr, is this correct?
Also why ++it and not it++ ?
It's something in the above code(or related changes) which is causing the
crash as if I try a simpleton fix  by changing 'if
(_extensions-isShaderAtomicCounterSupported())' to be a if not statement it
works fine.
Any pointers (no pun intended) would be much appreciated.

Thanks


Martin


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: 04 April 2012 12:47
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] problem with svn (atomic counter?)

Hi Martin,

yes, my error also claims to happen in the vector header, but the question
is what causes it, the code inthat file is used for longer times.

regarding the 4.2 and older graphics you may be right! Anyway, I'm happy I
still have a chance to avoid a complete reinstall of my machine :)

I'm looking forward to your results! Unfortunately I'll be on the road for
the next 10 days (starting tomorrow) and have only my notebook with me. For
that days I cannot run test on my machine but I'm still available for
discussion!

Thank you!

Cheers,
Torben

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





___
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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Martin Naylor
Hi,
Below is the osg output:
I have also run the atomic counter demo on geeks3d with success, so its
nothing obvious on the driver side that might only occur on a 480 gtx.


OpenGL extension 'GL_ARB_get_program_binary' is supported.
OpenGL extension 'GL_ARB_gpu_shader_fp64' is supported.
OpenGL extension 'GL_ARB_shader_atomic_counters' is supported.
glVersion=4.1980926514, isGlslSupported=YES,
glslLanguageVersion=4.19809
26514

Compiling VERTEX source:
1: varying vec2 texcoord;
2:
3: void main(void)
4: {
5: vec3 position = gl_Vertex.xyz * gl_Color.w + gl_Color.xyz;
6: gl_Position = gl_ModelViewProjectionMatrix *
vec4(position,1.0);
7: gl_FrontColor = vec4(1.0,1.0,1.0,1.0);
8: texcoord = gl_MultiTexCoord0.st;
9: }


Compiling FRAGMENT source:
1: uniform sampler2D baseTexture;
2: varying vec2 texcoord;
3:
4: void main(void)
5: {
6: gl_FragColor = texture2D( baseTexture, texcoord);
7: }

Linking osg::Program  id=3 contextID=0
Uniform baseTexture loc=0 size=1 type=sampler2D
GraphicsContext::setWindowingSystemInterface() 
07FEE5B7AB18

DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
Closing DynamicLibrary osgPlugins-3.1.2/osgdb_rgbd.dll


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: 04 April 2012 12:47
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] problem with svn (atomic counter?)

Hi Martin,

yes, my error also claims to happen in the vector header, but the question
is what causes it, the code inthat file is used for longer times.

regarding the 4.2 and older graphics you may be right! Anyway, I'm happy I
still have a chance to avoid a complete reinstall of my machine :)

I'm looking forward to your results! Unfortunately I'll be on the road for
the next 10 days (starting tomorrow) and have only my notebook with me. For
that days I cannot run test on my machine but I'm still available for
discussion!

Thank you!

Cheers,
Torben

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





___
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


Re: [osg-users] [build] Cmake - The C compiler /usr/bin/gcc is not able to compile a simple test program.

2012-04-04 Thread Thomas Hogarth
Hi Guys

I have just run into this myself, the issue is caused by CMake looking for 
XCode in the old /Developer folder. The very latest xcode installed from the 
app store (4.3.2) now stores xcode and all it's SDKs etc in an app bundle in 
the /Applications folder.

I've found a fix for cmake which requires building from source,

https://github.com/Kitware/CMake/pull/15

I think it is applied the latest master branch of the CMake git repository. 
I've downloaded and built it but I'm still getting the error.

I'm going to keep digging as this as just put a halt to my project.

(Why oh why did I update XCode :( )

Cheers
Tom

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





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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Ulrich Hertlein
Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
 I see no Nvdia dll in the call stack, not sure if I should, so am thinking
 an OSG problem(please take with a pinch of salt).

Without having encountered that crash this to me would indicate that the crash 
is
happening in GL code (such as glGetActiveUniforms) rather than the surrounding 
setup.

 So I have had a go at debugging, its beyond me but a couple of questions to
 help me in my pursuit.
 The call before the crash in the vector stl lib is:
 
 if (_extensions-isShaderAtomicCounterSupported())
 {
 std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
 std::vectorGLuint uniformIndex;
 for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
 atomicCounterMap.end();
  it != end; ++it)
 {
 uniformIndex.push_back(it-first);
 }
 
 _extensions-glGetActiveUniformsiv( _glProgramHandle,
 uniformIndex.size(),
 (uniformIndex[0]),
 GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
 (bufferIndex[0]) );
 
 
 The above is doing a for loop and pushing the first item back, whilst
 debugging the 'end' has a bad_ptr, is this correct?
 Also why ++it and not it++ ?

Can you verify that 'uniformIndex' and 'bufferIndex' are *ALWAYS* non-empty?  
Otherwise
the 'uniformIndex[0]' will definitively cause a crash.

If that cannot be assured then we need a bit of

if (!uniformIndex.empty()  !bufferIndex.empty())
{
   // glGetActiveUniform()
}

Not sure why 'end' is bad, that certainly shouldn't be the case unless the
atomicCounterMap is not properly set up.

'++it' is a sort of code optimization hint to the compiler and may-or-may-not 
produce
faster code; the end result is the same.

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Ulrich Hertlein
Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
 if (_extensions-isShaderAtomicCounterSupported())
 {
 std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
 std::vectorGLuint uniformIndex;
 for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
 atomicCounterMap.end();
  it != end; ++it)
 {
 uniformIndex.push_back(it-first);
 }

Coming to think of it, I believe the whole block should check if 
atomicCounterMap is not
empty.  It does not need to be called if GL_UNSIGNED_INT_ATOMIC_COUNTER is 
supported but
not used.

code
if (_extensions-isShaderAtomicCounterSupported()  !atomicCounterMap.empty())
{
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
/code

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Martin Naylor
Hi all,
Thanks Ulrich that both options supplied seemed to work ok, but the latter
does seem more appropriate.
I cant see the values from glGetActiveUniformsiv, so not even sure if it is
returning any values, don't believe it is.
There is a check earlier in the code for GL_UNSIGNED_INT_ATOMIC_COUNTER, but
I have just checked and it gets skipped over when stepping through with
debugger, which leaves atomiccountermap not set.
If I understood correctly!

Cheers

Martin


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich
Hertlein
Sent: 04 April 2012 23:43
To: OpenSceneGraph Users
Subject: Re: [osg-users] problem with svn (atomic counter?)

Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
 if (_extensions-isShaderAtomicCounterSupported())
 {
 std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
 std::vectorGLuint uniformIndex;
 for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), 
 end = atomicCounterMap.end();
  it != end; ++it)
 {
 uniformIndex.push_back(it-first);
 }

Coming to think of it, I believe the whole block should check if
atomicCounterMap is not empty.  It does not need to be called if
GL_UNSIGNED_INT_ATOMIC_COUNTER is supported but not used.

code
if (_extensions-isShaderAtomicCounterSupported() 
!atomicCounterMap.empty()) {
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
/code

Cheers,
/ulrich
___
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


Re: [osg-users] OSG + PhysX + Havok demos

2012-04-04 Thread Thomas Hogarth
Building the latest version of CMake did fix my issue, I just needed to start 
the process from scratch.

Here's hoping they release a new stable version soon.

I also ran into a separate issue using latest IOS sdk 5.1.  A few of the unused 
sampler defines have been removed. I'll submit my fix later

Cheers
Tom

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





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


[osg-users] IOS SK 5.1, XCode 4.3.2 and CMake

2012-04-04 Thread Thomas Hogarth
Hi All

Just sharing an issue I have had with latest version of XCode 4.3.2. XCode
and all it's libs etc
are now installed into an app bundle in the applications folder.

When trying to run the current stable version of cmake 2.8.7, you receive
an error stating the
gcc compiler is not working.

Downloading the latest nightly build of CMake fixes the issue

http://www.cmake.org/files/dev/

There are also a few compile errors using the 5.1 IOS sdk, a fix has been
submitted and is also
attached.

Cheers
Tom


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


Re: [osg-users] [ANN] OpenSceneGraph 3 Cookbook Published!

2012-04-04 Thread walter perdan
Hello dear Wang Rui,

I' ve purchased your book because i want to improve my Knowledge and my skill 
in OSG. The book , of course, it is not yet arrived, but looking at github to 
the examples i can't find chapter 7, the most important for me about terrain. 
Is there a specific reason for this? or are they in an other location?

Best regards,
walter

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





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


[osg-users] glGetActiveUniformsiv error

2012-04-04 Thread Michael A. Eriksen
With the latest update I get an error in 

void Program::PerContextProgram::linkProgram(osg::State state)

There error is in 

  _extensions-glGetActiveUniformsiv( _glProgramHandle, uniformIndex.size(),
(uniformIndex[0]), 
GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
(bufferIndex[0]) );

The size of uniformIndex is 0!!

Try and run osgsimplegl3!!

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





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


[osg-users] Geometry not rendered on ATI using GL3 shaders

2012-04-04 Thread Roland Hill
Hi,

I have been trying to convert my application to use version 1.50 compliant 
shaders and found that they work on my NVidia machine, but not on my ATI 
Mobility Radeon HD 5850 laptop. The shaders compile and link on the ATI, but  
no geometry gets rendered. Both machines are running Ubuntu 11.10 64 bit and 
the ATI drivers are the latest available. OSG version is 3.1.1 (developer 
release) / trunk (I've been trying both).

The same issue can be seen using the osgsimplegl3 example. If I execute 
./osgsimplegl3 cow.osg the NVidia desktop machine shows the cow, while the ATI 
machine shows an empty window.

osgsimplegl3 was executed after export OSG_NOTIFY_LEVEL=INFO and the 2 logs 
are attached.

I would like to use version 1.40+ shaders to make potential porting to ES2 
devices easier in the future. In any case, osgsimplegl3 example should work on 
ATI cards.

I am quite new to shader coding and this has me thoroughly confused. Any help 
would be much appreciated.

Thank you!

Cheers,
Roland

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




Attachments: 
http://forum.openscenegraph.org//files/osg_nv_log_123.txt
http://forum.openscenegraph.org//files/osg_ati_log_274.txt


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


[osg-users] issues with osg on visual studio 10

2012-04-04 Thread Subhadip Ghosh
Hello 
I have been trying to get osg setup and run with vs 2010 on a win7 x64 machine 
but there are some linking issues that I just can't figure out.

Here's what I did -
- got the debug/release osg binaries for version 3.0.1
- setup $(OSG_ROOT) to the base osg directory
- added $(OSG_ROOT)\bin to PATH
in project properties (debug)
C/C++ - General - Additional Include Directories = $(OSG_ROOT)\include
Linker - General - Additional Library Directories = $(OSG_ROOT)\lib
Linker - Input - Additional Dependencies =  osgd.lib osgGAd.lib osgDBd.lib 
osgViewer.lib OpenThreadsd.lib

I was trying to get the code for the osgbillboard.cpp example run in my own 
project (the executable that comes in with osg runs fine!)
- all include files get included fine and intellisense doesn't detect any 
problem

But on trying to compile I am getting a host of 'unresolved external symbol' 
link errors.
Tried putting in explicit paths for the include,lib and the dependencies - 
still didn't work
ofcourse same thing happens in the release mode and in the stable version of 
2.8.5

It's been many hours and it's frustrating when this kind of problems occurs.
Can anyone please help me out?

... 

Thanks a lot !

Cheers,
Subhadip

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





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


Re: [osg-users] Multiple views

2012-04-04 Thread Sagar Rajput
Hi,
 Friends !
It's My first post in this forum . I have some problems in creating 
different views of scene .My total problem is:
I need to create 3 different views of scene .2 views should be rendered on one 
window and other one should be on another window.When I move one window scene 
using mouse  the corresponding effect also should be visible in other window .
 
Can someone help me plz ? 

Thank you!

Cheers,
Sagar

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





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


[osg-users] [vpb] osgthreadedterrain example how to use?

2012-04-04 Thread walter perdan
Hi,

i would like to know  what osgthreadedterrain example does or if someone point 
me where find info on how use it . Seraching on the forum and on the OSG wiki 
doesn't help me a lot. i tryed to run the puget.ive as suggested in the VPT 
wiki but the application refused it. I imagine that is needed a specific file ( 
and big in memory of course..) . At least would be great an command line 
example to run to build a file for it.


Thank you!

Cheers,
walter :)

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





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


[osg-users] [vpb] osgdem not output .osga compressed file

2012-04-04 Thread walter perdan
Hi,
yes, osgdem not output .osga compressed file .As final result is: a puget.ive 
file, a folder puget_root_L0_X0_Y0, other two files puget.ive.task.0.added 
andpuget.ive.task.0.modified.I'm working in Ubuntu 11.04. I launched from a 
console osgdem in this way: 


Code:
--xx 10 --yy 10 -t ps_texture_1k.tif  --xx 10 --yy 10 -d ps_height_1k.tif  -l 8 
-v 0.01 -o puget.ive -a pegout.osga 



as suggested in the wiki.
 
this the output in a console (i left the other part..):  
 
Code:
 Warning: archive option -a is temporarily disabled, building with archive 



i thought that i miss to enable some option during the building process of VPB 
, so i rebuld and reinstall the software ( even if i didn't see an option to 
disable or enable this feature in Cmake..) .
On my system i have also libzip and libminizip installed. I'm using the last 
version of OSG . 

Other people encounter this issue before? Or i miss some step...


Thank you!

Cheers,
walter

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





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


[osg-users] Write access violation after attaching debugger in VS 2010

2012-04-04 Thread Andrea Proli
Hi all,

I am new to this community and would like to get some help with a problem I am 
having. I hope I am posting it in the right section and I apologize if that is 
not the case.

I am experiencing write access violations upon every frame update 
(pViewer-frame()) after attaching the VS 2010 debugger to a running process 
which uses the OSG viewer. I first started to see this error with the MFC-based 
multithreaded app I developed, and I of course blamed my code and my handling 
of synchronization objects for that. After a few hours of debugging and 
scratching my head, however, I realized the following things:

1) The access violation happens only when the debugger is attached to an 
already running process. If I start the process by debugging it in VS, no 
access violation exception is raised; 
2) The problem is not just with my application: if I attach the VS debugger to 
the osgviewerd.exe or osgviewermfcd.exe process after loading the Avatar.osg 
model, I can observe the same behavior, i.e. write access violations after 
attaching the debugger when the process is already running, no access violation 
when starting the process from VS with the debugger attached;
3) If I tell VS to ignore the access violation (from the Exceptions dialog), 
everything works fine, except that the debugger output window is flushed with 
access violation messages - one per frame update;
4) The place in the code where the access violation occurs varies depending on 
the process being debugged and model loaded. Sometimes it is in OSG sources, 
sometimes in STL sources, but never in my own code - or in the code of the 
application i am debugging;
5) Not all models cause the problem - with osgviewerd.exe, for instance, the 
Cessna.osg model does not cause any access violation even after attaching the 
debugger when the process is already running;
6) The access violation after attaching the debugger occurs both in debug and 
in release configurations;
7) After reproducing the problem with osgviewermfcd.exe and the Avatar.osg 
model, if I keep the debugger attached, tell VS to ignore access violation 
exceptions (so I can actually keep interacting with the app, otherwise an 
exception dialog would pop up after each frame update), close the window which 
shows the Avatar.osg model and open the same model in a new window, I see no 
access violations in the debug output.

I thought there might be a problem with the OSG binaries I downloaded, so I 
downloaded the source code and built them myself, but the issue persists. I am 
using Win7 64 bit and VS 2010 SP1.

I suspect this to be an issue with the VS 2010 debugger, but I haven't seen it 
with any other application before. Did anybody experience this problem or has 
an idea what could it be caused by?

I would very much appreciate any kind of help. In case you need more 
information which I might have forgotten to type, please do not hesitate to ask.

Thank you in advance,

Andrea

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





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


[osg-users] [vpb] osgTerrain inside OpenFramework

2012-04-04 Thread walter perdan
Hi to all,

this is my first post in the osg forum. I'm using Openframework  in a creative 
way. I like interactivity and 3d graphics. I would like to make an installation 
in which you can see a big large terrain and other things. My first idea was to 
implement a terrain system with LOD and multipaging. I made a lot of  searching 
,finding many resources, different algorithm implementations, and libraries. 
Then i found and addon a ofxOpenSceneGraph to port osg into Openframework. 
that's great ! because osg has a terrain plugin... I was able to run osgTerrain 
inside Openframework but i have a problem , you can see in the image attached. 
Just a note : i ve used puget sound at the big resolution as explain in the osg 
HOW TO. In osg the same puget,ive works fine intead in Openframework the 
texture is not handled in the best way ( there are no detail but coloured 
square that became smaller with LOD) . wht could be? 
Is it an issue with openframework or i miss something in the code?  
i leave also part of the code (partially of course...)


Code:
#include testApp.h

#include osg/Geode
#include osg/ShapeDrawable
#include osg/Shape
#include osgViewer/View
#include osgGA/TrackballManipulator
#include osgDB/ReadFile


#include osgTerrain/Terrain
#include osgTerrain/TerrainTile
#include osgTerrain/GeometryTechnique
#include osgTerrain/Layer
#include iostream

using namespace std;
using namespace osg;
using namespace osgUtil;

templateclass T
class FindTopMostNodeOfTypeVisitor : public osg::NodeVisitor
{
public:
FindTopMostNodeOfTypeVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_foundNode(0)
{}

void apply(osg::Node node)
{
T* result = dynamic_castT*(node);
if (result)
{
_foundNode = result;
}
else
{
traverse(node);
}
}

T* _foundNode;
};


templateclass T
T* findTopMostNodeOfType(osg::Node* node)
{
if (!node) return 0;

FindTopMostNodeOfTypeVisitorT fnotv;
node-accept(fnotv);

return fnotv._foundNode;
}

//--
void testApp::setup(){
std::cout  setup  std::endl;
//ofSetColor(120,120,120);
osg::setNotifyLevel(osg::DEBUG_INFO);


//osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new 
osg::Box(osg::Vec3(0,0,0), 1.0f));
//osg::Geode* geode = new osg::Geode();
//geode-addDrawable(drawable);

// obtain the vertical scale
float verticalScale = 1.0f;
//while(arguments.read(-v,verticalScale)) {}

// obtain the sample ratio
float sampleRatio = 1.0f;
//while(arguments.read(-r,sampleRatio)) {}

std::string strBlendingPolicy;
strBlendingPolicy = ENABLE_BLENDING;

 osgTerrain::TerrainTile::BlendingPolicy blendingPolicy = 
osgTerrain::TerrainTile::ENABLE_BLENDING;
 //osgTerrain::TerrainTile::setDirtyMask(1);// dirtyMask = 
osgTerrain::TerrainTile::IMAGERY_DIRTY;
   //osgTerrain::TerrainTile-setDirty(true) dirty = 
osgTerrain::TerrainTile::true ;
 /*
std::string strBlendingPolicy;
while(arguments.read(--blending-policy, strBlendingPolicy))
{
if (strBlendingPolicy == INHERIT) blendingPolicy = 
osgTerrain::TerrainTile::INHERIT;
else if (strBlendingPolicy == DO_NOT_SET_BLENDING) blendingPolicy = 
osgTerrain::TerrainTile::DO_NOT_SET_BLENDING;
else if (strBlendingPolicy == ENABLE_BLENDING) blendingPolicy = 
osgTerrain::TerrainTile::ENABLE_BLENDING;
else if (strBlendingPolicy == ENABLE_BLENDING_WHEN_ALPHA_PRESENT) 
blendingPolicy = osgTerrain::TerrainTile::ENABLE_BLENDING_WHEN_ALPHA_PRESENT;
}
*/

// load the nodes from the commandline arguments.
osg::ref_ptrosg::Node rootnode = osgDB::readNodeFile(puget.ive);

if (!rootnode)
{
osg::notify(osg::NOTICE)Warning: no valid data loaded, please 
specify a database on the command line.std::endl;
return ;
}

  osg::ref_ptrosgTerrain::Terrain terrain = 
findTopMostNodeOfTypeosgTerrain::Terrain(rootnode.get());
if (!terrain)
{
// no Terrain node present insert one above the loaded model.
terrain = new osgTerrain::Terrain;

// if CoordinateSystemNode is present copy it's contents into the 
Terrain, and discard it.
osg::CoordinateSystemNode* csn = 
findTopMostNodeOfTypeosg::CoordinateSystemNode(rootnode.get());
if (csn)
{
terrain-set(*csn);
for(unsigned int i=0; icsn-getNumChildren();++i)
{
terrain-addChild(csn-getChild(i));
}
}
else
{
terrain-addChild(rootnode.get());
}

rootnode = terrain.get();
}
terrain-setSampleRatio(sampleRatio);
terrain-setVerticalScale(verticalScale);
terrain-setBlendingPolicy(blendingPolicy);


   glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

getView()-setSceneData(rootnode.get());

Re: [osg-users] issues with osg on visual studio 10

2012-04-04 Thread Chris Hanson
On Mon, Mar 26, 2012 at 10:27 AM, Subhadip Ghosh subhadip9...@gmail.comwrote:

 Hello
 I have been trying to get osg setup and run with vs 2010 on a win7 x64
 machine but there are some linking issues that I just can't figure out.

 But on trying to compile I am getting a host of 'unresolved external
 symbol' link errors.



   Like...?


 Tried putting in explicit paths for the include,lib and the dependencies -
 still didn't work
 ofcourse same thing happens in the release mode and in the stable version
 of 2.8.5
  It's been many hours and it's frustrating when this kind of problems
 occurs.


  Are you compiling using 3rdpart dependencies that were made for VS2010/64?


 Can anyone please help me out?

 ...

 Thanks a lot !

 Cheers,
 Subhadip

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





 ___
 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 • 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