Re: [osg-users] Non-drawable Drawables

2010-04-09 Thread Tim Moore
On Fri, Apr 9, 2010 at 1:26 AM, Martin Beckett m...@mgbeckett.com wrote:


 Tim Moore wrote:
  PrimitiveSet::getNumIndices() returns the number of vertices in the
 PrimitiveSet. PrimitiveSet::index() returns the actual index of vertex n in
 the vertex arrays.


 Sorry - looks like I was a little premature, getNumIndices()  returns the
 number of triangles, just the same as calling size() on the primitve set

My previous answer was a bit confusing. getNumIndices() and index() relate
to the number and order of vertices presented to OpenGL to actually draw the
geometry, for example in DrawArray or DrawElements calls. Yes, it's true
that in a DrawElements-style mesh that the value returned by getNumIndices()
is different from the number of vertices in the vertex arrays. But, starting
with the primitiveIndex value returned in an intersection test, you can
still find the indices of the vertices used by 1 primitive and then get at
the values in the vertex and vertex attribute arrays for that primitive. If
you know you're dealing with triangles, the index of the first vertex used
is ps-index(_primitiveIndex * 3).

 What I needed to know was the range of vertices used, ie. the highest and
 lowest values in the primitiveset.  Because of the way the mesh is generated
 there is no way to get this from the triangle indices

 Essentially all I need is a single number for each geometry showing where
 in the common vertex array it begins.

 In a DrawElements style mesh the vertices aren't necessarily contiguous...
But if that information is what you need to know, you'll need to write a
visitor to extract it. Otherwise, you do have everything you need to
identify the vertices of the intersected triangle, its Drawable, its Geode,
etc.

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


[osg-users] self shadow support in osgShadow

2010-04-09 Thread sumit
Hi,

 I was wondering is self shadow is supported in osgShadow. By self
shadow I mean that can an object cast shadow on itself. Specifically is
there any implementation of shadow map which supports it. If not , then can
you give me some pointer, what changes I may need to do, to enable this.

 

Thanks in advance.

 

Cheers 

Sumit

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


Re: [osg-users] self shadow support in osgShadow

2010-04-09 Thread Sebastian Messerschmidt

Hi summit,


Most of the osgShadow implementations support self-shadowing.
So it is more a matter of the used implementation.
If you use any form of shadow-mapping, there always be self-shadowing 
per se. Look at the osgShadow example to find out more.



cheers
Sebastian

Hi,

 I was wondering is “self shadow” is supported in osgShadow. By self 
shadow I mean that can an object cast shadow on itself. Specifically is 
there any implementation of shadow map which supports it. If not , then 
can you give me some pointer, what changes I may need to do, to enable this.


 


Thanks in advance.

 


Cheers

Sumit




___
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] Shadowmap and spotlight

2010-04-09 Thread sumit
Hi all,

I was working with osgShadow's shadow volume implementation. It seems
that it does not have implementation for spotlight. Am I missing something
or its not actually implemented yet.

 

Cheers 

Sumit

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


Re: [osg-users] Shadowmap and spotlight

2010-04-09 Thread sumit
Sorry for the subject as shadowmap, it should be shadow volume J.

 

Thanks in advance

 

Cheers 

Sumit

 

 

From: sumit [mailto:sum...@darshan3d.com] 
Sent: Friday, April 09, 2010 12:59
To: 'osg-users@lists.openscenegraph.org'
Subject: Shadowmap and spotlight

 

Hi all,

I was working with osgShadow's shadow volume implementation. It seems
that it does not have implementation for spotlight. Am I missing something
or its not actually implemented yet.

 

Cheers 

Sumit

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


Re: [osg-users] fatal error on simple programm

2010-04-09 Thread Alexej Fink

litllechicken wrote:
 Hi, thanks for triing to help me, i found i was not due to OSG but to my 
 visual config witch failed.


Hi,

seems that I have a similar problem: crashing in Intersection destructor with 
corrupted heap.

Can you please explain, what was wrong with your VS config?

// I use osg:2.8.3, Qt:4:6:2, vs2005

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





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


Re: [osg-users] self shadow support in osgShadow

2010-04-09 Thread sumit

Thanks a lot Sebastian, it's working. All I needed to do is set
ReceivesShadowTraversalMask and CastsShadowTraversalMask same.

Cheers 
Sumit



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sebastian
Messerschmidt
Sent: Friday, April 09, 2010 12:59
To: OpenSceneGraph Users
Subject: Re: [osg-users] self shadow support in osgShadow

Hi summit,


Most of the osgShadow implementations support self-shadowing.
So it is more a matter of the used implementation.
If you use any form of shadow-mapping, there always be self-shadowing 
per se. Look at the osgShadow example to find out more.


cheers
Sebastian
 Hi,
 
  I was wondering is self shadow is supported in osgShadow. By self 
 shadow I mean that can an object cast shadow on itself. Specifically is 
 there any implementation of shadow map which supports it. If not , then 
 can you give me some pointer, what changes I may need to do, to enable
this.
 
  
 
 Thanks in advance.
 
  
 
 Cheers
 
 Sumit
 
 
 
 
 ___
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Threading Models

2010-04-09 Thread Robert Osfield
Hi Paul  Jason,

On Fri, Apr 9, 2010 at 1:49 AM, Jason Daly jd...@ist.ucf.edu wrote:
 As you indicated, it seems to be hard-coded at the moment.  There doesn't
 seem to be any way to configure it from the application.  You'll have to
 either change the hard-coded values in your copy of OSG, or dive in and
 implement a way to configure the processor affinity from the application.

Right now you can get the threads that are active and do a
thread-setProcessorAffinity(cpunum) but some OS's require you to
assign the affinity at setup rather than once it's running so it won't
be an option for all.

It's been my plan to revise the way that thread affinity is set up
with the OSG to allow user customization of thread affinity, this
would either have to be done by setting up the GraphicsContext::Traits
and to give hints the DatabasePager prior to the threads starting, or
to have a callback that provides the hints of what affinity to set for
each new thread being created.  The threads would need to identify
themselves in some way for this callback to know what to do with them
- perhaps both a class of thread and other details.

I'm open to suggestions on how this new support might be implemented.

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


Re: [osg-users] OSGExplore

2010-04-09 Thread Rizzen
Thanx J-S, I am one of those that don't go looking for it when the
author does not give links to their work.

Rizzen

Jean-Sébastien Guay wrote:
 Hello Patrick,

 The binaries will definitely help people check your program out, as
 the dependencies might have turned off people from compiling it. Also:

 Also, the application is hosted on sourceforge.

 You mentioned this but never provided an explicit link, which might
 contribute to the absence of responses... Yes, people can be lazy
 sometimes, and if you don't point directly at the site where they can
 get the software, they won't go looking for it.

 For people looking for it, it's:

   http://sourceforge.net/projects/osgexplore/files/

 Hope you get more responses now :-) Keep up the good work,

 J-S

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


Re: [osg-users] OSGExplore

2010-04-09 Thread Rizzen
Patrick,

Where is the source to build the application on Linux?

Rizzen

Jean-Sébastien Guay wrote:
 Hello Patrick,

 The binaries will definitely help people check your program out, as
 the dependencies might have turned off people from compiling it. Also:

 Also, the application is hosted on sourceforge.

 You mentioned this but never provided an explicit link, which might
 contribute to the absence of responses... Yes, people can be lazy
 sometimes, and if you don't point directly at the site where they can
 get the software, they won't go looking for it.

 For people looking for it, it's:

   http://sourceforge.net/projects/osgexplore/files/

 Hope you get more responses now :-) Keep up the good work,

 J-S

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


[osg-users] Uniform Matrix arrays for shaders

2010-04-09 Thread Aitor Ardanza
Hi,

I'm new here, but after being a long time looking at the forum the answer to my 
question, I decided to write this post.
I have the following problem. I need to pass an array of matrix to a vertex 
program. I do as follow:

Code:

osg::Matrixf boneMatrices[MAX_BONES];
Uniform *g_boneMatrixUniform = new Uniform(boneMatrices,*boneMatrices);
cylinderStateSet-addUniform(g_boneMatrixUniform);

//update
cylinderStateSet-getUniform(boneMatrices)-set(*boneMatrices);




Code:

//vertex program
uniform mat4 boneMatrices[3];


The code complie and runs ok, but in the vertex program only pick up right the 
first matrix.
What´s the problem?!

Thank you!

Cheers,
koko

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





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


[osg-users] GraphicsWindowWin32 instead of Producer

2010-04-09 Thread lalialter-radio
    Is it possible to use osgViewer::GraphicsWindowWin32 (like
producer)
with osgUtil::SceneView in order to to makeCurrent or releaseCurrent
context and do the update, cull, draw etc in it?? I've develop
something like that but considering your high recommendation on using
osgViewer instead of osgUtil::SceneView i have some second thoughts. Al
thought it seems to work fine in my current release 2.2.0 but I have just
some problems with texturing. Textures are disappearing on sceneView
recreation. I searched the forum about a solution and your advise was
to update on latest version. The problem is that updating on  final osg
release 2.9.8 there appears a lot of memory leaks.

__
Χρησιμοποιείτε Yahoo!;
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam);   Το Yahoo! Mail διαθέτει την 
καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων  
http://mail.yahoo.gr ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer and multiple QGLWidgets

2010-04-09 Thread Jean-Sébastien Guay

Hi Ben,


BTW, I've been using the OSGAdapterWidget ... trying to specify
sharedContext with traits.


AdapterWidget will force you to single-threaded mode, which will make 
using multiple views painfully slow. QOSGWidget supports the normal OSG 
multi-threading modes, which is much better.



I've looked at all the OSG examples as well as some Delta3D examples,
but I can't find one that is Qt based and sharing the graphics context
and a single scene.


OK, I hadn't understood that you wanted to share the graphics context. 
We're creating a new context for each view. It works OK for us. I don't 
know if it would work or how to do it when sharing the context (I've 
never tried).


Sorry I can't help more.

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Uniform Matrix arrays for shaders

2010-04-09 Thread Jean-Sébastien Guay

Hi Aitor,


I need to pass an array of matrix to a vertex program. I do as follow:

Code:

osg::Matrixf boneMatrices[MAX_BONES];
Uniform *g_boneMatrixUniform = new Uniform(boneMatrices,*boneMatrices);
cylinderStateSet-addUniform(g_boneMatrixUniform);

//update
cylinderStateSet-getUniform(boneMatrices)-set(*boneMatrices);

Code:

//vertex program
uniform mat4 boneMatrices[3];


The code complie and runs ok, but in the vertex program only pick up right the 
first matrix.
What´s the problem?!


You need to pass the number of elements to the osg::Uniform constructor, 
or else it defaults to 1 which explains the behavior you're seeing. The 
constructor's signature is:


  Uniform (Type type, const std::string name, int numElements=1);

The convenience constructors (that take the name and value) are only for 
single element uniforms, not arrays.


So change that initialization code to:

  osg::Matrixf boneMatrices[MAX_BONES];
  Uniform *g_boneMatrixUniform =
  new Uniform(osg::Uniform::FLOAT_MAT4, boneMatrices, MAX_BONES);
  cylinderStateSet-addUniform(g_boneMatrixUniform);

  for (unsigned int i = 0; i  MAX_BONES; ++i)
  boneMatrixUniform-setElement(i, boneMatrices[i]);

And also change the update code to look like the above loop.
That should work.

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Lightness of the ES version

2010-04-09 Thread Lars Ivar Igesund
Hi,

I am looking into scenegraph libraries that can be used over all types of 
platforms, and OSG clearly allows this with the OpenGL ES support.

My question however, is whether this support also includes/allows for pruning 
of the library such that it does not take more memory on a mobile device than 
what is strictly necessary.

Is it at all possible to leave out features in the sake of library size?

... 

Thank you!

Cheers,
Lars

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





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


[osg-users] Multicard memory allocation?

2010-04-09 Thread Akilan Thangamani
Hi,

I have multiple graphics cards in my system and connected to different display. 
I created multiple views(composite viewer) so that each view to one context. 
Each view has its own camera projecting its own texture (similar to osgHud 
example). My assumption is that each texture occupies the memory from 
respective graphics cards referred to by the context. Is that correct? or Will 
they create space on one card only? 
Second,  How to do multi-pipe rendering? Bcoz I have another configuration like 
Multiple graphics cards---3 Projectors--1 screen(1280*1024) in which I 
wud like to render my scene.

Akilan

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





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


Re: [osg-users] Non-drawable Drawables

2010-04-09 Thread Martin Beckett
Thanks - I had combined two different problems into one question so it wasn't 
clear.

The first problem was - I have a subset of vertices that I want to flag in some 
way. One obvious way of doing this was to make a POINTS primitiveset drawable 
of them. But I don't want them to be drawn as points - I was wondering if there 
was a way of having all the functions of a drawable (memory, loading, saving) 
but no drawing. Perhaps by defining my own GL_MODE or by setting some parameter 
that stops them being rendered.

The second problem was having a single vertexarray shared by multiple 
drawables. If I needed to get the range of vertices used by drawable 'A' the 
only option was to walk each drawable finding the high/lowest indices of say a 
triangle mesh.
It occured that this had the same solution - if I just stored a drawarray for 
each component (cheap since it just has a start and end index) then I can 
quickly find which vertices are which component.  But again I don't want to 
actually draw these. 
I thought perhaps OSG might internally store the ranges of vertexes for each 
drawable for it's own reasons and that's what getNumIndices() did.

The quick fix solution is probably to use a vertexattribarray rather than try 
and subvert OSG's drawables. Long term the new osg2 format makes it much easier 
to add custom types.

Thanks for your time 

Martin

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





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


Re: [osg-users] Threading Models

2010-04-09 Thread Jason Daly

Robert Osfield wrote:

It's been my plan to revise the way that thread affinity is set up
with the OSG to allow user customization of thread affinity, this
would either have to be done by setting up the GraphicsContext::Traits
and to give hints the DatabasePager prior to the threads starting, or
to have a callback that provides the hints of what affinity to set for
each new thread being created.  The threads would need to identify
themselves in some way for this callback to know what to do with them
- perhaps both a class of thread and other details.

I'm open to suggestions on how this new support might be implemented.
  


Hi, Robert,

I don't have a lot of input.  I just happened to know where the affinity 
code currently lived so I was able to answer Paul's question.


I don't have a lot of specific requirements in any of my apps, so either 
solution you mentioned sounds workable to me.


--J

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


Re: [osg-users] GraphicsWindowWin32 instead of Producer

2010-04-09 Thread Martin Naylor
You can have a look at the MFC example included in OSG for using a win32
context.

 

Attached is a screen saver for windows that uses OSG and does what you need
I believe, ok not very power friendly  and the code needs tidying J, I have
commented out the section for keyboard input as I did not want to close with
the keyboard during testing, its only small so I thought I would post as its
been kicking around for a while.

Will compile against the latest CVS, not sure about going back to 2.2.0
though.

Sorry about any hard coded paths in the project solution if you use it.

Let us know how it goes, its needs cow.osg or will probably crash!

 

Regards

 

Martin.

 

 

 

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
lalialter-ra...@yahoo.gr
Sent: 09 April 2010 13:39
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] GraphicsWindowWin32 instead of Producer

 


Is it possible to use osgViewer::GraphicsWindowWin32 (like producer)
with osgUtil::SceneView in order to to makeCurrent or releaseCurrent context
and do the update, cull, draw etc in it?? I've develop something like that
but considering your high recommendation on using osgViewer instead of
osgUtil::SceneView i have some second thoughts. Al thought it seems to work
fine in my current release 2.2.0 but I have just some problems with
texturing. Textures are disappearing on sceneView recreation. I searched the
forum about a solution and your advise was to update on latest version. The
problem is that updating on  final osg release 2.9.8 there appears a lot of
memory leaks.


__
Χρησιμοποιείτε Yahoo!;
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την
καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων 
http://mail.yahoo.gr 



OSG-Screensaver.7z
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] GraphicsWindowWin32 instead of Producer

2010-04-09 Thread Martin Naylor
Forgot to add, I am using the latest CVS and have no probs with memory
leaks!

Its probably that your code is taken from the MFC example and that does
produce memory leaks which I have looked at and could not quite grasp why.

Its something to do with the debugger in VS2008 but cant put my finger on it
at the moment, if i remember correctly its probably something to do with
closing/creating the windows and where the OSG viewer? Is declared. Cannot
remember if I came to the conclusion that it was the Visual Studio debugger
and MFC...

But my code don't leak(touch wood), so might be worth giving a go if you are
not using the MFC classes.

 

Regards

 

Martin.

 

 

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
lalialter-ra...@yahoo.gr
Sent: 09 April 2010 13:39
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] GraphicsWindowWin32 instead of Producer

 


Is it possible to use osgViewer::GraphicsWindowWin32 (like producer)
with osgUtil::SceneView in order to to makeCurrent or releaseCurrent context
and do the update, cull, draw etc in it?? I've develop something like that
but considering your high recommendation on using osgViewer instead of
osgUtil::SceneView i have some second thoughts. Al thought it seems to work
fine in my current release 2.2.0 but I have just some problems with
texturing. Textures are disappearing on sceneView recreation. I searched the
forum about a solution and your advise was to update on latest version. The
problem is that updating on  final osg release 2.9.8 there appears a lot of
memory leaks.


__
Χρησιμοποιείτε Yahoo!;
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την
καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων 
http://mail.yahoo.gr 

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


Re: [osg-users] CompositeViewer and multiple QGLWidgets

2010-04-09 Thread Ben Cain
Thanks J-S,

I think I have it working now.  Although, like you said, the adapter
widget will force me to use single-threading mode.  My real goal is to
have one scene with shared textures, etc. (in shared context) used
across multiple windows in a QWorkspace.

I wish there was a osgQt library of sorts ... rather than having to
tweak example code to get the OSG/Qt support.

The Delta3D community provides some Qt/OSG help with their dtQt
library.  I think it grew out of the Delta3D STAGE development effort
(having followed it's code somewhat).  They mentioned submitting some
of this back to OSG.  Here's hoping.

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


Re: [osg-users] CompositeViewer and multiple QGLWidgets

2010-04-09 Thread Jean-Sébastien Guay

Hi Ben,


I wish there was a osgQt library of sorts ... rather than having to
tweak example code to get the OSG/Qt support.


Funny you should mention it, there is now :-)

http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/src/osgQt

It has some utility classes for fonts and such, but eventually Robert 
wants to have a full-fledged GraphicsWindow implementation for Qt so 
that apps can use that directly instead of starting from the examples 
and possibly diverging wildly from there...


Feel free to contribute to that goal if you want :-)

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer and multiple QGLWidgets

2010-04-09 Thread Ben Cain
On 4/9/10, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote:
 Hi Ben,

 I wish there was a osgQt library of sorts ... rather than having to
 tweak example code to get the OSG/Qt support.

 Funny you should mention it, there is now :-)


KUDOS!!!  :)   Whoo hoo!

Btw, I have a great deal of Qt experience.  I'll definitely do what I
can to contribute back.

I've actually been using Qt for quite a while too, but have struggled
at times with the Qt/OSG and Qt/Delta3D integration.

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


[osg-users] HUD camera and depth

2010-04-09 Thread Don Leich

Hi all,

I needed to change an HUD camera so that it would write into the depth
buffer.  To get it to work I had to do something that I don't understand.
I thought that a depth range of (0.,0.) and function of ALWAYS should cause
all subsequent rendering to write at the minimum depth value.  Doing so
would render lines OK but all filled polys and text went missing.  I found
that I had to open up the range a bit in order to see these too.

Does anyone have an idea why I needed to cheat the range here?

-Don



void Scene::createHUDCamera()
{
_hud = new osg::Camera;
_hud-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_hud-setClearMask( 0 );
_hud-setRenderOrder(osg::Camera::POST_RENDER);

_hud-getOrCreateStateSet()-setMode( GL_BLEND, osg::StateAttribute::ON );
_hud-getOrCreateStateSet()-setMode( GL_LIGHTING, osg::StateAttribute::OFF 
);

// Instead of turing off hidden surface (depth test) use a depth func
// to push the hud children in front of everything else.
osg::Depth* depth = new osg::Depth;
depth-setFunction( osg::Depth::ALWAYS );
// setRange(.0, .0) should write all pixels at the minimum depth value.

// depth-setRange( .0, .0 );   //### Loses all filled polys and text...

depth-setRange( .0, .0001 );   // ...unless I do this. ###

_hud-getOrCreateStateSet()-setAttributeAndModes( depth, 
osg::StateAttribute::ON );


_hud-setAllowEventFocus(false);

_hudMembers = new osg::Group;
_hud-addChild( _hudMembers.get() );
}

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


Re: [osg-users] HUD camera and depth

2010-04-09 Thread Paul Martz

Don Leich wrote:

Hi all,

I needed to change an HUD camera so that it would write into the depth
buffer.  To get it to work I had to do something that I don't understand.
I thought that a depth range of (0.,0.) and function of ALWAYS should cause
all subsequent rendering to write at the minimum depth value.  Doing so
would render lines OK but all filled polys and text went missing.  I found
that I had to open up the range a bit in order to see these too.


Hi Don -- I've found that a more direct way to write to the min z value is to 
use a vertex shader that outputs gl_Position with z = -1 and w = 1.


Regardless, there's no reason why your technique shouldn't work in plain OpenGL:
  http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml
Not sure why this isn't working in OSG. First thing to do would be set a 
breakpoint in your Drawable's draw() to see whether or not drawing commands are 
being sent to OpenGL. If your breakpoint doesn't get hit, then you've narrowed 
it down to an OSG issue. If the OpenGL drawing commands are getting issued, then 
something about the OpenGL state machine is being misconfigured.


--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] osgMovie Plugin, detected OpenGL error ?

2010-04-09 Thread artha restu
Hi,
I installed quicktime sdk, I used CMake to configure and generate (like exposed 
in 
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio/VisualStudioPlugins
 ).

When I run osgmovie C:\Program Files\QuickTime\Sample.mov I get the following 
error: 


Code:
Warning: TextureRectangle::apply(..) failed, texture rectangle is not support 
by your OpenGL drivers.
Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,)



Am I forgetting something? 

... 

Thank you!

Cheers,
artha[/code]

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





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


[osg-users] [forum] OSG Training This Year?

2010-04-09 Thread Allen Saucier
Hi everyone,

I hope this is the correct forum to post this question. :-*

Does anyone know or has anyone heard if there will be OSG training this year in 
the United States?

Thank you!

Cheers,
Allen

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





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


Re: [osg-users] OSGExplore

2010-04-09 Thread Biron, Patrick D. (LARC-E402)[ANALYTICAL MECHANICS ASSOCIATES INC]
Rizzen,

I haven't tried to build the application on Linux, but it theoretically 
should compile. I will check with one of my work associates (who is more 
familiar with Linux) to see what I can do to set up a Linux project of the app.

~Patrick

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Rizzen
Sent: Friday, April 09, 2010 8:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OSGExplore

Patrick,

Where is the source to build the application on Linux?

Rizzen

Jean-Sébastien Guay wrote:
 Hello Patrick,

 The binaries will definitely help people check your program out, as
 the dependencies might have turned off people from compiling it. Also:

 Also, the application is hosted on sourceforge.

 You mentioned this but never provided an explicit link, which might
 contribute to the absence of responses... Yes, people can be lazy
 sometimes, and if you don't point directly at the site where they can
 get the software, they won't go looking for it.

 For people looking for it, it's:

   http://sourceforge.net/projects/osgexplore/files/

 Hope you get more responses now :-) Keep up the good work,

 J-S

___
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] OSGExplore

2010-04-09 Thread Biron, Patrick D. (LARC-E402)[ANALYTICAL MECHANICS ASSOCIATES INC]
Doh,

Thank you!

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jean-Sébastien 
Guay
Sent: Thursday, April 08, 2010 12:10 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OSGExplore

Hello Patrick,

The binaries will definitely help people check your program out, as the 
dependencies might have turned off people from compiling it. Also:

 Also, the application is hosted on sourceforge.

You mentioned this but never provided an explicit link, which might 
contribute to the absence of responses... Yes, people can be lazy 
sometimes, and if you don't point directly at the site where they can 
get the software, they won't go looking for it.

For people looking for it, it's:

   http://sourceforge.net/projects/osgexplore/files/

Hope you get more responses now :-) Keep up the good work,

J-S
-- 
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
 http://whitestar02.webhop.org/
___
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] [forum] OSG Training This Year?

2010-04-09 Thread Chris 'Xenon' Hanson
On 4/9/2010 2:35 PM, Allen Saucier wrote:
 Hi everyone,
 I hope this is the correct forum to post this question. :-*
 Does anyone know or has anyone heard if there will be OSG training this year 
 in the United States?

  I don't think Skew Matrix/Blue Newt/TechSoup have announced any public OSG 
courses this
year. I believe they offer private courses -- where are you and what are you 
looking for?

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] dynamic of the pipeline

2010-04-09 Thread Allen Saucier
Hi Harash,

I found one solution that you proposed:

 
 Another Way: The One you are using Keep a UnitInOut parallel to your blurring 
 channel. In the shader for his unit, just pass the Input to the output. 
 Connect the O/P of both to the UnitOut. Enable node mask of the preferred 
 channel as per requirement. 
 


I use a switch node as the enable node mask.  Please check this forum as it 
is the one I found this trick in! ;-)
[url]
http://forum.openscenegraph.org/viewtopic.php?t=3902highlight=
[/url]

I have attached my code example for anyone who might need a simple example of 
how to blur a scene and to turn on and off that blurring effect.

Thank you Art  Harash for your help!


Code:

* OpenSceneGraph example, blur_sceneWrks.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*
* This Code is primarily taken from the glow.cpp example from the osgPPU
*   site.  Thank you Art.
*/

#include stdafx.h
#include osgViewer/Viewer

#include osg/Projection
#include osg/Geometry
#include osg/Texture
#include osg/TexGen
#include osg/Geode
#include osg/ShapeDrawable
#include osg/PolygonOffset
#include osg/CullFace
#include osg/TextureCubeMap
#include osg/TexMat
#include osg/MatrixTransform
#include osg/Light
#include osg/LightSource
#include osg/PolygonOffset
#include osg/CullFace
#include osg/Material
#include osg/PositionAttitudeTransform
#include osg/ArgumentParser
#include osgDB/ReadFile
#include osg/Program
#include osg/Shader
#include osg/Camera
#include osg/TexGenNode
#include osg/Texture2D
#include osg/GLExtensions
#include osgViewer/Renderer
#include osgGA/TrackballManipulator
#include osgDB/WriteFile
#include osgViewer/ViewerEventHandlers


#include osgPPU/Processor.h
#include osgPPU/UnitInOut.h
#include osgPPU/UnitOut.h
#include osgPPU/UnitCameraAttachmentBypass.h
#include osgPPU/UnitCamera.h
#include osgPPU/ShaderAttribute.h
#include osgPPU/UnitTexture.h 


#include iostream


// values taht control the amount of blur to be applied to a scene
// these values are applied through the use of the opengl shaders
//   implemented within the function () by the variables,
//   osgPPU::ShaderAttribute* gaussx and gaussy.
float gBlurSigma2 = 7.0;
float gBlurRadius2 = 20.0;


//--
// Event handler to react on user input
// CAn switch between a blurred scene and a non-blurred scene by using the
//   function keys, F1- blur, and F2- no blur 
// viewer - it is the viewer for the scene though unnecessary in this case
// m_oswBlur - the switch node used to enable/disable the blurring pipeline
// m_oswNoBlur - switch node used to enable/disable the non-blur pipeline
//--
class KeyboardEventHandler : public osgGA::GUIEventHandler
{
public:
osg::ref_ptrosgViewer::Viewer viewer; // not needed
osg::ref_ptrosg::Switch m_oswBlur;
osg::ref_ptrosg::Switch m_oswNoBlur;

KeyboardEventHandler(osg::ref_ptrosgViewer::Viewer v, 
  osg::ref_ptrosg::Switch p_oswBlur,
  osg::ref_ptrosg::Switch p_oswNoBlur) : viewer(v), m_oswBlur(p_oswBlur),
  m_oswNoBlur(p_oswNoBlur)
{
} // ctor

bool handle(const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYDOWN):
case(osgGA::GUIEventAdapter::KEYUP):
{
  switch (ea.getKey())
  {
case osgGA::GUIEventAdapter::KEY_F1 :
  m_oswBlur-setAllChildrenOn();
  m_oswNoBlur-setAllChildrenOff();
break;

case osgGA::GUIEventAdapter::KEY_F2 :
  m_oswBlur-setAllChildrenOff();
  m_oswNoBlur-setAllChildrenOn();
break;
  } // sw on ea
  break;
}// case key up
default:
break;
}// sw
return false;
}// handle
}; // class keyevent




//--
// 

[osg-users] [osgPPU] Would you please consider adding this example to your osgPPU examples?

2010-04-09 Thread Allen Saucier
Hi Art,

I have written an example on how to blur a scene and how to turn that blurring 
effect on and off.  I have attached the code.  Would you please consider adding 
this to your list of examples that one may download with osgPPU?


Thank you for all of your help.

Cheers,
Allen

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




Attachments: 
http://forum.openscenegraph.org//files/blur_scenewrks_243.cpp


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


Re: [osg-users] Background image...

2010-04-09 Thread Shiwei Hu
Hi,

just change renderOder to NESTED_RENDER. it works fine.

Thank you!

Cheers,
HUSHIWEI

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





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


[osg-users] embedded .Net composite views not resizing

2010-04-09 Thread David Cofer
I am working on an .Net MDI application in VS9 and I am trying to use a 
composite viewer that has multiple user created embedded views. I have tested 
the creation/destruction of multiple standalone view windows with a composite 
viewer and it appears to work fine. However, when I embed the views into .Net 
windows re-sizing of the windows stops working correctly. The first window 
works fine, but then when I create a second view window re-sizing quits working 
for both windows. I can resize the .net windows, but the osg views maintain the 
size they were when the second window was created. Other than the resizing 
thing both views appear to still work though. I did some google searches and 
found some stuff that seemed related to this, but most of it was for QT and I 
am not using that. I was wondering if anyone has any ideas or suggestions? I 
have provided the code I am using to embed the osg views into .net using the 
HWND below.


Code:

void VsSimulationWindow::InitEmbedded(Simulator *lpSim, VsSimulator *lpVsSim)
{
m_osgView = new osgViewer::View;
m_lpWinMgr-Viewer()-addView(m_osgView.get());

osg::GraphicsContext::Traits *traits =  new 
osg::GraphicsContext::Traits();

traits-inheritedWindowData = new 
osgViewer::GraphicsWindowWin32::WindowData( m_HWND );
traits-setInheritedWindowPixelFormat = true;
traits-doubleBuffer = true;
traits-windowDecoration = false;
traits-sharedContext = 0;
traits-supportsResize = true;

RECT rect;
GetWindowRect( m_HWND, rect );
traits-x = 0;
traits-y = 0;
traits-width = rect.right - rect.left;
traits-height = rect.bottom - rect.top;

osg::GraphicsContext *gc =  
osg::GraphicsContext::createGraphicsContext(traits);

osg::Camera *cam = m_osgView-getCamera();
cam-setName(MyCam);
cam-setGraphicsContext( gc );
cam-setViewport( new osg::Viewport( traits-x, traits-y, 
traits-width, traits-height ) );
float *vColor = lpSim-BackgroundColor();
cam-setClearColor(osg::Vec4(vColor[0], vColor[1], vColor[2], 
vColor[3]));
m_osgView-setName(MyTest);

m_osgView-setSceneData(lpVsSim-OSGRoot());

   //m_osgView-addEventHandler( new osgViewer::WindowSizeHandler );
//m_osgView-addEventHandler( new osgViewer::ThreadingHandler );

m_osgManip = new VsCameraManipulator(lpSim);
m_osgView-setCameraManipulator(m_osgManip.get());
}




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





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


[osg-users] Problems on head?

2010-04-09 Thread Butler, Lee Mr CIV USA USAMC
I updated source today and have noticed two problems.  I'm using RedHat 
Enterprise 5 on x86_64.

The following code:
  osgUtil::LineSegmentIntersector::Intersections intersections;
  view-computeIntersections(x, y, intersections, ~0);

now causes logging to the console:
 Triangle Functor does not support Vec3d* vertex arrays

and compiling my application now reports warnings:

  /osg/include/osgDB/StreamOperator:87: warning: unused parameter 'str'
  /osg/include/osg/observer_ptr: In copy constructor 
'osg::observer_ptrT::observer_ptr(const osg::observer_ptrT) [with T = 
osg::PagedLOD]':
  /osg/include/osgDB/DatabasePager:353: instantiated from here
  /osg/include/osg/observer_ptr:43: warning: base class 'class osg::Observer' 
should be explicitly initialized in the copy constructor

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