Re: [osg-users] [Non-DoD Source] Re: 3.2.3 Tag Missing

2018-02-05 Thread Cary, Karl A CTR NSWCCD West Bethesda, 7340
Thank you, and I totally understand. 3.2.3 is perfectly fine with me.

Karl Cary
Senior Software Engineer
Leidos
Office: 301-227-5656 (Wednesday and Thursday)
Home Office: 434-589-3164 (Monday, Tuesday, and Friday)


-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Sunday, February 04, 2018 7:35 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] [Non-DoD Source] Re: 3.2.3 Tag Missing

I have now created a tag for 3.2.3 from the original release date.

On 3 February 2018 at 14:46, Robert Osfield  wrote:
> Hi Karl,
>
> On 2 February 2018 at 15:41, Cary, Karl A CTR NSWCCD West Bethesda,
> 7340  wrote:
>> Did you ever figure out what happened here?
>
> No, I looked into what we have in git but there isn't a 3.2.3 tag like 
> there should be.  I don't know what happened there, either when we 
> imported from svn to git this tag didn't get imported or that there 
> was an error in the script that should tag the release, or... I didn't 
> actually run it as I should have
>
> I don't have a time machine so we'll never know.
>
>>  Is taking the tip of the 3.2 branch equivalent to grabbing the 3.2.3 build?
>
> 3.2 head has lots of changes since the 12 August 2015 release data of
> 3.2.3 so it's not the same.
>
> I have just checked out the commit on the 12th of August that will 
> have been the last one for the 3.2.3 release and if it builds fine 
> I'll create a tag for this.
>
> Probably makes sense to update the version number to 3.2.4 on this 
> branch and tag this.  I would require some testing though...  I'm not 
> in position right now to go corral the community into testing and 
> making the release myself as I have other pressing work to get on 
> with.  If required I could do this later in the month.
>
> Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [Non-DoD Source] Re: 3.2.3 Tag Missing

2018-02-02 Thread Cary, Karl A CTR NSWCCD West Bethesda, 7340
Robert,

Did you ever figure out what happened here? Is taking the tip of the 3.2 branch 
equivalent to grabbing the 3.2.3 build?

Karl Cary
Senior Software Engineer
Leidos
Office: 301-227-5656 (Wednesday and Thursday)
Home Office: 434-589-3164 (Monday, Tuesday, and Friday)


-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Tuesday, January 16, 2018 3:57 PM
To: OpenSceneGraph Users
Subject: [Non-DoD Source] Re: [osg-users] 3.2.3 Tag Missing

On 16 January 2018 at 20:11, Cary, Karl A CTR NSWCCD West Bethesda,
7340  wrote:
> I just noticed that 3.2.3 is missing a tag. As a result, the link from the 
> stable releases is broken. Is the 3.2.3 release simply the latest on the 3.2 
> branch?

Curious, don't know what went wrong there.  I am away from my dev machine right 
now, I'll look into when I'm back at work tomorrow.

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



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 3.2.3 Tag Missing

2018-01-16 Thread Cary, Karl A CTR NSWCCD West Bethesda, 7340
I just noticed that 3.2.3 is missing a tag. As a result, the link from the 
stable releases is broken. Is the 3.2.3 release simply the latest on the 3.2 
branch? 

Karl Cary
Senior Software Engineer
Leidos
Office: 301-227-5656 (Wednesday and Thursday)
Home Office: 434-589-3164 (Monday, Tuesday, and Friday)




smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [Non-DoD Source] Re: OSG gathering during my visit to Virginia in December

2017-12-13 Thread Cary, Karl A CTR NSWCCD West Bethesda, 7340
Also nearby is a Greene Turtle Sports Bar
21035 Dulles Town Cir, Sterling, VA 20166

Looks like all 3 options are about the same distance away for Robert.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Glenn Waldron
Sent: Wednesday, December 13, 2017 10:30 AM
To: OpenSceneGraph Users
Subject: [Non-DoD Source] Re: [osg-users] OSG gathering during my visit to 
Virginia in December

Gents,
A couple options that are close by for a beer or three..

Lost Rhino Brewing - microbrewery, smaller and probably quieter
21730 Red Rum Dr #142, Ashburn, VA 20147



Buffalo Wing Factory - decent local beer selection (MD/VA), average food
22034 Shaw Rd, Sterling, VA 20164



Glenn Waldron

On Tue, Dec 12, 2017 at 10:06 PM, Robert Osfield  
wrote:


Hi Jeremy,

On 12 December 2017 at 18:36, Jeremy Smith  
wrote:
> One of my coworkers replied on Monday but is still waiting approval.
>
> A few of us are interested in meeting up. Thursday evening would work 
best. We know the area well and can pick a venue. Let us know!

Excellent, Thursday is the evening that Pelican Mapping guys can make
as well.  No suggestions on venue yet so happy to hear about
suggestions.

FYI, I'm stay at the DoubleTree by Hilton Hotel, Sitirling:

   
http://doubletree3.hilton.com/en/hotels/virginia/doubletree-by-hilton-hotel-sterling-dulles-airport-IADSLDT/index.html
 

 

I have a car, but fancy a beer so walking distance or an uber would be 
good.

Robert.

___
osg-users mailing list
osg-users@lists.openscenegraph.org 
 

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
 





smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] EXTERNAL: Forum

2017-07-12 Thread Cary, Karl A.
I could be wrong, but I don't think the link between the mail list and forum is 
working any more. I see quite a few new posts on the forums, and have not 
gotten them through the mail list.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Sebastian Messerschmidt
Sent: Monday, July 10, 2017 4:10 AM
To: OpenSceneGraph Users
Subject: EXTERNAL: [osg-users] Forum

Hi folks,

The forum seems up and running again. My best guess is, that Art Tevs (who is 
hosting the forum) has fixed the issue.

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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Read FBO with PBO

2017-07-07 Thread Cary, Karl A.
I have a unique situation where I have to render my full scene to the screen, 
but then also render a separate subset out to a shared memory segment. This was 
achieved by creating a second camera, attaching the needed subset, rendering to 
an FBO with a texture applied, and then doing a readImageFromCurrentTexture in 
the final draw callback. This all works. The resultant data is then memcpy'd to 
the location in shared memory that it needs to go (unfortunately I can't change 
that requirement at all, the target is raw data at the location). Alternatively 
I also tried applying the image directly to the fbo rather than a texture, and 
it was slightly faster, but still very slow. To test that this method will 
ultimately work, if I attach the texture but then only do the 
readImageFromCurrentTexture if I signal it, via keyboard input, the scene 
continues to render to the FBO and the last scene copied from the texture will 
be continually sent to the shared memory segment. The performanc
 e of this is what we are looking for, we just have the one frame hit every 
time I signal it. All this really does is prove that if I can speed up the 
read, this solution will work.

The issue I have is the readImageFromCurrentTexture is extremely slow, about 20 
ms. My initial thought was to use a pixel buffer object just like in the 
osgscreencapture example, which we have done before for applying some post 
processing effects with the data from the backbuffer with great success. The 
problem is, I can't figure out how to bind to the frame buffer object. In raw 
GL, you bind to GL_COLOR_ATTACHMENT0_EXT. That fails and gives a State::apply 
error and results in simply reading the back buffer instead. I have tried all 
of the COLOR_ATTACHMENT buffers and they all give me the same result.

Is it possible to bind just to the texture and do a glTexSubImage2D instead of 
a glReadPixels? If so, how do I actually get that set up? I have attempted to 
do it the same way I bind the texture for doing the readImageFromCurrentTexture 
but that does not work either.


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [Repost while forums down] Convert from screen space to world space and back to screen space

2017-06-23 Thread Cary, Karl A.
I am posting this for my coworker, NavyBas, as he is not on the email list yet 
and he was hoping to get a response before the forums get fixed. He had posted 
this yesterday.

Hello and thanks in advance for any assistance, 

 First question: What is the simplest way to convert from 2D space to 3D space 
with OSG? 
 Second question: What is the simplest way to convert from 3D space to 2D 
(screen) space with OSG? 

 I want to convert a screen coordinate to 3D (world) space, make a couple of 3D 
matrix rotations, then convert the resulting 3D coordinate back to screen 
space. 

 Thanks again for your help! 

 Cheers, 
 Zach


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] General Forum Down?

2017-06-23 Thread Cary, Karl A.
Is the general forum down for anyone else? My coworkers and I have not been 
able to get to it since yesterday and we noticed a post a coworker made 
yesterday didn't come through the mailing list either (even though I have been 
receiving other messages through it today). This is the error we receive:

Could not obtain topic information

DEBUG MODE

SQL Error : 3 Error writing file '/tmp/MYXfAfQ7' (Errcode: 28)

SELECT t.*, u.username, u.user_realname, u.user_allow_viewrealname, 
u2.user_realname as realname2, u2.user_allow_viewrealname as 
user_allow_viewrealname2, u.user_id, u2.username as user2, u2.user_id as id2, 
p.post_username, p2.post_username AS post_username2, p2.post_time FROM 
phpbb2_topics t, phpbb2_users u, phpbb2_posts p, phpbb2_posts p2, phpbb2_users 
u2 WHERE t.forum_id = 1 AND t.topic_poster = u.user_id AND p.post_id = 
t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = 
p2.poster_id AND t.topic_type <> 2 AND t.topic_type <> 3 ORDER BY t.topic_type 
DESC, t.topic_last_post_id DESC LIMIT 0, 50

Line : 463
File : viewforum.php


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Issue Subclassing GraphicsWindowX11

2015-05-28 Thread Cary, Karl A.
I will look in to this. I was unaware that would allow me to do what I wanted. 
Aside from the GraphicsWindowX11, I was able to do what I want another way too. 
We were already subclassing osgViewer so I added a custom renderingTraversals 
function. I copied the original one and then changed the SwapBuffersOperation 
to a custom one that I subclassed. This is a pain though due to the length of 
renderingTraversals and potential of updates in the future. I was going to look 
in to doing a GraphicsContext->getOperationsQueue and then rebuilding it with a 
the custom SwapBuffersOperation, but the setSwapCallback() sounds like a better 
idea.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Voerman, L.
Sent: Thursday, May 28, 2015 4:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Issue Subclassing GraphicsWindowX11

Hi Karl,
Did you find the GraphicsContext->setSwapCallback() call? It seems to me you 
are taking a very difficult route to get a custom swapBuffersImplementation.
Regards, Laurens.

On Thu, May 28, 2015 at 9:56 AM, Robert Osfield  
wrote:


Hi Karl,


I haven't heard of this specific problem before, but then most users 
won't be subclassing from GraphicsWindowX11.  In principle I can't see any 
reason why it wouldn't work.  Without code in front of me that fails to compile 
I can only provides guesses as to what is amiss - my best guess is that either 
a X11 header needs to be added, or the ordering needs to be adjusted.


I can't be any more specific without seeing the problem first hand and 
attempting to resolve it.


Robert.



    On 27 May 2015 at 15:32, Cary, Karl A.  wrote:


I need to subclass the GraphicsWindowX11 class in order to 
provide a custom swapBuffersImplementation. However, when I do this I then get 
a really random error in the middle of one of my enumerations (expected 
identifier before numeric constant). It happens when I include 
osgViewer/api/X11/GraphicsWindowX11, which I have to include in order to 
subclass GraphicsWindowX11. If not I am told 'expected class name before {'. As 
for the enumeration, it happens on the definition of an enumeration value 
called 'None' (NOTE: the value is called None, not the enumeration). It is a 
3rd party header/library so it cannot be changed. Any idea what is going on? Or 
is there a different way I need to be including/subclassing/declaring 
GraphicsWindowX11? Thank you.

#include 
#include 

class MyWindow : public osgViewer::GraphicsWindowX11
{
public:
MyWindow(osg::GraphicsContext::Traits* traits):
osgViewer::GraphicsWindowX11(traits) {}

virtual void swapBuffersImplementation();
};


___
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






smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Issue Subclassing GraphicsWindowX11

2015-05-27 Thread Cary, Karl A.
I need to subclass the GraphicsWindowX11 class in order to provide a custom 
swapBuffersImplementation. However, when I do this I then get a really random 
error in the middle of one of my enumerations (expected identifier before 
numeric constant). It happens when I include 
osgViewer/api/X11/GraphicsWindowX11, which I have to include in order to 
subclass GraphicsWindowX11. If not I am told 'expected class name before {'. As 
for the enumeration, it happens on the definition of an enumeration value 
called 'None' (NOTE: the value is called None, not the enumeration). It is a 
3rd party header/library so it cannot be changed. Any idea what is going on? Or 
is there a different way I need to be including/subclassing/declaring 
GraphicsWindowX11? Thank you.

#include 
#include 

class MyWindow : public osgViewer::GraphicsWindowX11
{
public:
MyWindow(osg::GraphicsContext::Traits* traits):
osgViewer::GraphicsWindowX11(traits) {}

virtual void swapBuffersImplementation();
};


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stat handler display corrupted

2015-02-03 Thread Cary, Karl A.
I've seen something VERY similar when we were doing custom OpenGL in an 
overridden draw command and didn't clear ALL of the state objects that we 
manipulated. Everything else in the scene was fine except for the stats 
handler. It's pure luck that the stats is the only thing messed up.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Tuesday, February 03, 2015 4:16 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Stat handler display corrupted

Hi Mark,


I haven't seen an issue like this before.  Somehow the state has got screwed up.


Are you using custom OpenGL or 3rd party code?


Robert.



On 31 January 2015 at 22:28, Mark Pai  wrote:


Hello,

I no longer get to see that nice stat handlers HUD display (pl see
the enclosed screen shot) and have no clue how to fix it. Pl help
me with possible clues to get it back up.

Thank you advance!

Regards,
-mpai

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




___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Texture Not Found For ive, but is for osg

2015-01-26 Thread Cary, Karl A.
I am working on updating our modeling to simulation model pipeline and have ran 
in to an issue. If we export to a .ive file, when loaded in our program or 
osgviewer, there are no textures. I set the OSG_NOTIFY_LEVEL to DEBUG and it 
never attempts to find them. If I do an osgconv to a .osg file, the textures 
show up just fine. The textures themselves are .png currently (issue with 
nvidia texture tools to make them .dds for now). They are located in the 
OSG_FILE_PATH, and I would presume correctly if they get loaded by the .osg. 
What could I be missing that has them not showing up in the .ive? If I do our 
export directly to .osg, it works as well and produces the exact same file as 
an osgconv from .ive. Thanks in advance.

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


Re: [osg-users] FLATTEN_STATIC_TRANSFORMS Not Always Working

2015-01-22 Thread Cary, Karl A.
I can probably post up the scenegraph, need to double check, but it will have 
to wait till tomorrow, I left the laptop it's on at home. As for multiple 
parents, I did check that and everything in the graph has only 1 parent. All I 
am using the optimizer for is to remove nested groups created for modelling 
purposes that aren't needed and to collapse the transforms, as they are not 
needed once modelling is finished as well. Since rebuilding OSG is pain in our 
current environment, I may just try copying the flatten code from the optimizer 
in to my own function and do some debugging to try and find out why they are 
not being collapsed.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Thursday, January 22, 2015 8:06 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] FLATTEN_STATIC_TRANSFORMS Not Always Working

Hi Karl,

There isn't any way for me to know whether you have hit upon a bug or just that 
the scene graph you are trying to optimize is structured in way that could can 
eliminate the transforms as I simply don't have a dataset that reproduces it.  
One of the things that prevent transforms being flattened and then removed is 
if a subgraph has two parents each with it's own unique transform.


I would add that the Optimizer and all it's parts is a sticky plaster fix for 
bad scene graphs, it tries it's best to fix bad scene graphs but it can't 
always do everything that could be done.  In an ideal world all scene graph 
would be built optimally in the modelling software and never need this fix up 
processing.


Robert.


On 22 January 2015 at 11:39, Cary, Karl A.  wrote:


I was recently doing some updates to a converter we wrote and found 
that the FLATTEN_STATIC_TRANSFORMS option to the optimizer isn't always 
flattening the transforms and I do not understand why. I have verified that the 
MatrixTransforms are marked as STATIC. The only thing I can think of is that I 
have 2 transforms nested, i.e. 1 MatrixTransform has a MatrixTransform as it's 
child which in turn has multiple groups and geodes under it. I can flatten it 
eventually if I first do an optimization removing redundant nodes, and then do 
a second optimization to flatten the transforms. The problem is that then I 
have to do a 3rd optimization to remove redundant nodes again. This doesn't 
make any sense to me. I also tried throwing in the 
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS, but this causes a 
crash. This is being run on the output of a maya2osg conversion from a maya 
file in to a .osg file. Any help in understanding what is wrong would be 
greatly appreciated. Thanks 
 i
 n advance.

Karl

___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FLATTEN_STATIC_TRANSFORMS Not Always Working

2015-01-22 Thread Cary, Karl A.
I've verified that the DataVariance is STATIC. Both before the optimization and 
then after the optimization it remained static.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Julien Valentin
Sent: Thursday, January 22, 2015 6:59 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] FLATTEN_STATIC_TRANSFORMS Not Always Working

..seams a DataVariance issue..no?


Cary, Karl A. wrote:
> I was recently doing some updates to a converter we wrote and found that the 
> FLATTEN_STATIC_TRANSFORMS option to the optimizer isn't always flattening the 
> transforms and I do not understand why. I have verified that the 
> MatrixTransforms are marked as STATIC. The only thing I can think of is that 
> I have 2 transforms nested, i.e. 1 MatrixTransform has a MatrixTransform as 
> it's child which in turn has multiple groups and geodes under it. I can 
> flatten it eventually if I first do an optimization removing redundant nodes, 
> and then do a second optimization to flatten the transforms. The problem is 
> that then I have to do a 3rd optimization to remove redundant nodes again. 
> This doesn't make any sense to me. I also tried throwing in the 
> FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS, but this causes a 
> crash. This is being run on the output of a maya2osg conversion from a maya 
> file in to a .osg file. Any help in understanding what is wrong would be 
> greatly appreciated. Thanks
  i
> n advance.
> 
> Karl
> 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] FLATTEN_STATIC_TRANSFORMS Not Always Working

2015-01-22 Thread Cary, Karl A.
I was recently doing some updates to a converter we wrote and found that the 
FLATTEN_STATIC_TRANSFORMS option to the optimizer isn't always flattening the 
transforms and I do not understand why. I have verified that the 
MatrixTransforms are marked as STATIC. The only thing I can think of is that I 
have 2 transforms nested, i.e. 1 MatrixTransform has a MatrixTransform as it's 
child which in turn has multiple groups and geodes under it. I can flatten it 
eventually if I first do an optimization removing redundant nodes, and then do 
a second optimization to flatten the transforms. The problem is that then I 
have to do a 3rd optimization to remove redundant nodes again. This doesn't 
make any sense to me. I also tried throwing in the 
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS, but this causes a 
crash. This is being run on the output of a maya2osg conversion from a maya 
file in to a .osg file. Any help in understanding what is wrong would be 
greatly appreciated. Thanks i
 n advance.

Karl


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multiples Camera CallBack?

2014-12-24 Thread Cary, Karl A.
We ran in to this same issue, but used the FinalDrawCallback to get around it. 
Just means if you have multiple post draws that you want to do, that you have 
to combine them in to one. Maybe writing an inherited callback for the 
finaldrawcallback that you can append multiple function calls to? Just an idea, 
not something I've done. We at one point just rewrote the OcclusionQueryNode's 
callback in to ours, but that ran in to all sorts of issue when we upgraded 
from 2.8.2 to 3.0.0.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Julien Valentin
Sent: Tuesday, December 23, 2014 6:04 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Multiples Camera CallBack?

Hi,
Tell me I'm dumb but I'm kind of surprise that ones can't add several Camera 
postdraw callbacks.
Is there a reason for it? 

Ex:I'm using osg::OcclusionQueryNodes in my scene, so when I set the 
PostDrawCallBack of the Camera during CullTraversal it replaces the one setted 
up by   osg::OcclusionQueryNode cull traversal

Thank you!

Cheers,
Julien

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] maya2osg with Maya 2015

2014-11-13 Thread Cary, Karl A.
Has anyone attempted to use it with Maya 2015 yet? Last time we tried it was 
2012, and it has been raised again that they want us to start trying to export 
directly to ive/osgb instead of our complex conversion process currently in 
place. Last I can see were some changes to get it compatible with 2014. This is 
probably mostly directed towards Javier Taibo. I just wanted to make sure this 
has been tested by someone before we put in for our upgrade from 2014 to 2015. 
Thanks.

Karl


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Full Screen Offset Problem

2014-11-12 Thread Cary, Karl A.
We have been having this problem for a long time, but only when we are using 
dual monitors. If we go to a single monitor, then all is fine. Also ours is set 
to run in full screen, but only on one of the 2 monitors. It seems completely 
random when it would work and when it wasn't. We just ignored it since our 
delivery target will only have a single screen and it is fine then. I would be 
interested in the answer though.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Chris Hidden
Sent: Wednesday, November 12, 2014 5:27 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Full Screen Offset Problem


Voerman, L. wrote:
> Just a fast suggestion:did you try:
> _graphicsWindow->setWindowDecoration(false);
> 
> Regards, Laurens.
> 


Well I have set windowDecoration in traits to false:

windowDecoration= false;

If thats what you meant.  I also have the extended styles and styles (Added in 
the OSG source GraphicsWindowWin32.cpp):

windowStyle= WS_VISIBLE | WS_POPUP ;
extendedStyle = WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TRANSPARENT | 
WS_EX_NOACTIVATE ; 

None of these styles though should give this sort of effect that I am aware of 
at least.  I also built a simple program to try and narrow down the problem and 
found a fix.  I don't like it because I don't really understand why its 
behaving this way.  

To solve it I simply shifted the view 10 units to the right and 10 units up so:

viwer->setUpViewInWindow(10, -10, screen->width(), screen->height());

That solves it.  However I haven't tested this on other screen with other 
resolutions so I am skeptical.

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] invalid enumerant error

2014-10-23 Thread Cary, Karl A.
Just checked my changelog, I thought it was a min filter, but actually it was I 
was enabling wrap, which isn't allowed for a texture rectangle. Not sure if 
this is it or not. From it saying GLMode, I would suspect you are doing a 
stateset setAttribute or setMode that isn't viable. Personally I would suggest 
commenting out large groups of stateset code until the error goes away and use 
that to track down what section of your code is doing it.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Trajce Nikolov NICK
Sent: Thursday, October 23, 2014 7:36 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] invalid enumerant error

Thanks Karl,

I set this in my code: 

std::ostringstream oss;
oss << "OSG_GL_ERROR_CHECKING=ON";
_putenv(oss.str().c_str());

still getting the same output, nothing extra. I am using TextureRectangle as 
well so might be the same issue. Any further hints?

Thanks a bunch!

Nick

On Thu, Oct 23, 2014 at 1:08 PM, Cary, Karl A.  wrote:


Robert had a suggestion in the past that helped me track down a similar 
issue in the past. From an earlier post from him:

One way of pinpointing the error better is to enable fine grained error 
checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on 
my Linux system this is:


   export OSG_GL_ERROR_CHECKING=ON

In my case this pointed me to a Texture2DRectangle that I was 
improperly declaring a min filter on. Hope this helps.


-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On 
Behalf Of Trajce Nikolov NICK
Sent: Thursday, October 23, 2014 6:57 AM
To: OpenSceneGraph Users
Subject: [osg-users] invalid enumerant error

Hi community,

This is question for those who has debug OpenGL apps. I am getting the 
following message:

"Warning: detected OpenGL error 'invalid enumerant' after applying 
GLMode 0x40b3"

Any hints how to resolve it or at least get some more info?

Thanks a lot,

Nick


--
trajce nikolov nick



___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






-- 
trajce nikolov nick



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] invalid enumerant error

2014-10-23 Thread Cary, Karl A.
Robert had a suggestion in the past that helped me track down a similar issue 
in the past. From an earlier post from him:

One way of pinpointing the error better is to enable fine grained error 
checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on 
my Linux system this is:


   export OSG_GL_ERROR_CHECKING=ON

In my case this pointed me to a Texture2DRectangle that I was improperly 
declaring a min filter on. Hope this helps.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Trajce Nikolov NICK
Sent: Thursday, October 23, 2014 6:57 AM
To: OpenSceneGraph Users
Subject: [osg-users] invalid enumerant error

Hi community,

This is question for those who has debug OpenGL apps. I am getting the 
following message:

"Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 
0x40b3"

Any hints how to resolve it or at least get some more info?

Thanks a lot,

Nick


-- 
trajce nikolov nick



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] First time render hiccup

2014-09-02 Thread Cary, Karl A.
I'll check it out. Thanks.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Glenn Waldron
Sent: Tuesday, September 02, 2014 8:21 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] First time render hiccup

Per,
If you don't want to pre-compile your GL objects, the 
IncrementalCompileOperation might help too. But you might need a newer version 
of OSG. 

Glenn Waldron / @glennwaldron


On Tue, Sep 2, 2014 at 7:27 AM, Per Nordqvist  wrote:


Hi all,


Another open-ended question I'm afraid, but maybe someone
has seen this before:


I sometimes see hiccups (rendering pauses) in my driving simulation,

I noticed it only happens with some vehicles, and only when they
appear in the frustum for the first time. I wonder how to minimize this 
effect.

Clues:
-Once the model has been displayed there is no more hiccup.
-Differerent models produce different hiccup delays (consistently)
-Hiccup problem does not scale with .ive size or nr of polygons
-In bad cases I can see the osgstats cull part go to zero for about 1 
sec.
-Using ProxyNode makes no difference.


Suggestions? Some caching options I can try?
Anything nasty to look for in the .ive models?


(Most are 3DS format made by 3rd party, converted with osgconv,
sorry I can't share them)


I'm using OSG 3.01, compositeviewer, linux, Nvidia (different cards, 
same problem.)


Thanks!



/Per



___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] First time render hiccup

2014-09-02 Thread Cary, Karl A.
We used to do this back when our application was in Performer, but we only had 
about 100 models then. Now we have thousands of possible models so it's 
unfortunately not an option.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Trajce Nikolov NICK
Sent: Tuesday, September 02, 2014 8:07 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] First time render hiccup

Hi Per,

this is a trick from the old days from scenegraph managers like Quantum3D 
OpenGVS. What they did to avoid this they preloaded the models at the very 
beginning to let OpenGL compile objects and then used in the scene. Maybe you 
can do the same way

Nick


On Tue, Sep 2, 2014 at 2:03 PM, Cary, Karl A.  wrote:


We have been having the same issue and haven't found a solution yet 
either, though it hasn't been our main priority yet. I will be following any 
responses closely and will contribute if I can.


-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On 
Behalf Of Robert Osfield
Sent: Tuesday, September 02, 2014 8:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] First time render hiccup

Hi Per,


Stalls like you describe are typically when the graphics driver has to 
compile new OpenGL objects.  There are range of things that can cause 
compilation to be slow, I haven't to head off line right now so will have to 
leave you with that hint...

Robert.



On 2 September 2014 12:27, Per Nordqvist  wrote:


Hi all,


Another open-ended question I'm afraid, but maybe someone
has seen this before:


I sometimes see hiccups (rendering pauses) in my driving 
simulation,

I noticed it only happens with some vehicles, and only when they
appear in the frustum for the first time. I wonder how to 
minimize this effect.

Clues:
-Once the model has been displayed there is no more hiccup.
-Differerent models produce different hiccup delays 
(consistently)
-Hiccup problem does not scale with .ive size or nr of polygons
-In bad cases I can see the osgstats cull part go to zero for 
about 1 sec.
-Using ProxyNode makes no difference.


Suggestions? Some caching options I can try?
Anything nasty to look for in the .ive models?


(Most are 3DS format made by 3rd party, converted with osgconv,
sorry I can't share them)


I'm using OSG 3.01, compositeviewer, linux, Nvidia (different 
cards, same problem.)


Thanks!



/Per



___
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






-- 
trajce nikolov nick



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] First time render hiccup

2014-09-02 Thread Cary, Karl A.
We have been having the same issue and haven't found a solution yet either, 
though it hasn't been our main priority yet. I will be following any responses 
closely and will contribute if I can.

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Robert Osfield
Sent: Tuesday, September 02, 2014 8:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] First time render hiccup

Hi Per,


Stalls like you describe are typically when the graphics driver has to compile 
new OpenGL objects.  There are range of things that can cause compilation to be 
slow, I haven't to head off line right now so will have to leave you with that 
hint...

Robert.



On 2 September 2014 12:27, Per Nordqvist  wrote:


Hi all,


Another open-ended question I'm afraid, but maybe someone
has seen this before:


I sometimes see hiccups (rendering pauses) in my driving simulation,

I noticed it only happens with some vehicles, and only when they
appear in the frustum for the first time. I wonder how to minimize this 
effect.

Clues:
-Once the model has been displayed there is no more hiccup.
-Differerent models produce different hiccup delays (consistently)
-Hiccup problem does not scale with .ive size or nr of polygons
-In bad cases I can see the osgstats cull part go to zero for about 1 
sec.
-Using ProxyNode makes no difference.


Suggestions? Some caching options I can try?
Anything nasty to look for in the .ive models?


(Most are 3DS format made by 3rd party, converted with osgconv,
sorry I can't share them)


I'm using OSG 3.01, compositeviewer, linux, Nvidia (different cards, 
same problem.)


Thanks!



/Per



___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Building OSG 3.2 With GDAL Support

2014-05-16 Thread Cary, Karl A.
This actually clued me in, the issue was that I had installed gdal-libs but not 
gdal-libs-devel!

From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of Mike Krus
Sent: Friday, May 16, 2014 11:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Building OSG 3.2 With GDAL Support

Hi

you should be able to specify it explicitly like this:
cmake -DGDAL_INCLUDE_DIR:PATH=\"/path/to/gdal/include\" 
-DGDAL_LIBRARY:PATH=\"/path/to/gdal/lib/libgdal.a\" 

So be able to specify .so if you're using the dynamic library

This is how I do it when cross compiling for iOS.



Mike

On 16 May 2014, at 15:03, "Cary, Karl A." 
mailto:karl.a.c...@leidos.com>> wrote:
We are finally attempting to test out OSG 3.2, but we are having some issues 
with building with GDAL. This is for CentoS 6 x86_64 with gdal 1.9.2-4, 
however, we are building 32 bit as we have some external libraries in 32 bit 
only. For 3.0, we got gdal fully installed and cmake automatically found the 
gdal headers and libraries. For some reason, with 3.2 it is not seeing them. 
Should everything be ok if we just set the paths manually, or is this pointing 
to a different issue we may have?


--
Mike Krus - Principle Software Engineer
m...@mve.com<mailto:m...@mve.com>
Midland Valley Exploration Ltd.
2 West Regent Street
Glasgow G2 1RW - UK
Tel: +44 141 332 2681

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


[osg-users] Building OSG 3.2 With GDAL Support

2014-05-16 Thread Cary, Karl A.
We are finally attempting to test out OSG 3.2, but we are having some issues 
with building with GDAL. This is for CentoS 6 x86_64 with gdal 1.9.2-4, 
however, we are building 32 bit as we have some external libraries in 32 bit 
only. For 3.0, we got gdal fully installed and cmake automatically found the 
gdal headers and libraries. For some reason, with 3.2 it is not seeing them. 
Should everything be ok if we just set the paths manually, or is this pointing 
to a different issue we may have?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Running example code to calculate terrain height

2014-05-06 Thread Cary, Karl A.
The first error line appears to be that the code is simply not correct, you are 
missing a (. It should be:

shrubQuad->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet:: QUADS,0,4));

As for the other error, Nick covered that.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov 
NICK
Sent: Tuesday, May 06, 2014 6:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running example code to calculate terrain height

Hi,

if the sample code is using osgProducer I think it is very out of date - 
osgProducer is depricated for years and was replaced by osgViewer.

There is an example of picking, osgpick I think is the example in the current 
trunk, where you will find current use of intersection classes and methods - 
have a look

Nick

On Tue, May 6, 2014 at 12:21 PM, Srikanth K P 
mailto:srika...@nal.res.in>> wrote:
Hi,

Hi,
I found a sample code in osg site which explains how to use / calculate terrain 
height. When I used the code and complied, I get too many errors. The code is 
from the site mentioned below :

http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/Intersections

A few errors are

For the code line
shrubQuad->addPrimitiveSet(new osg::DrawArrays osg::PrimitiveSet:: QUADS,0,4);

The error is : syntax error : missing ')' before 'QUADS'

For the code line
osgProducer::Viewer viewer;

Error : osgProducer' : is not a class or namespace name

>From the forum I found that osgProducer has been replaced with osgViewer. Is 
>it just enough if I replace viewer in the code ?
I request some help. I am using OSG 2.8 version

Cheers,
Srikanth

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





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



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


Re: [osg-users] Scale Flattening and LODs

2014-04-17 Thread Cary, Karl A.
Looking at the code for FlattenStaticTransformsDuplicatingSharedSubgraphs, as 
that is what appears to be running, the apply(LOD) function adjusts the center 
with a setCenter call, but there is no adjustment done to the radius. Since the 
setCenter call will enable the USER_DEFINED_CENTER mode, if radius is > 0 then 
it will need to be adjusted. Also it does not modify the ranges either, even 
though if you were not to flatten the transform then those ranges would be 
effected by the scale. For my purposes the range part does not matter, but it 
might to others.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, April 17, 2014 4:48 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Scale Flattening and LODs

HI Karl,

I'm trying to guess what is going on front the details you've provided.  Are 
you saying that the osgUtil::FlattenStaticTransforms is not handling LOD's 
correctly?  Have you looked at the source code to see what it's doing/not doing?

Robert.

On 14 April 2014 20:03, Cary, Karl A.  wrote:
> To at least partially answer my own question, everything seems fine if 
> I manually apply the scale to the radius. So essentially, if you have 
> a scale transform, it will affect the radius, center point, ranges, 
> and vertex positions during the cull and draw. However if you flatten 
> the scale, it seems to only affect the vertex positions and center. 
> You have to manually adjust ranges and radius.
>
>
>
> Is this not supposed to be true? Is there anything else that I need to 
> be double checking on? This is with 3.0.1.
>
>
>
> From: osg-users-boun...@lists.openscenegraph.org
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, 
> Karl A.
> Sent: Monday, April 14, 2014 12:51 PM
> To: OpenSceneGraph Users
> Subject: [osg-users] Scale Flattening and LODs
>
>
>
> I have run across an issue related to scaled flattening over an LOD. I 
> have a Matrix transform with a static scale in it over an LOD node. 
> For the LOD, I have exact ranges that I want it to change at, regardless of 
> scale, i.e.
> always switch LOD at 1000ft, 2000ft etc. If I leave the matrix 
> transform in place then I have to divide the ranges by the scale value 
> as they get that scalar applied to them as well apparently. This is 
> what we have been using for quite some time and works fine. I am 
> trying now to flatten the scale transform out. When I do it though, 
> the ranges don't get touched so I don't need to adjust them, but for 
> some reason the raidus is also being left alone and now suddenly there 
> is a center value that did not exist prior. In order to see this, I am 
> spitting out the scenegraph to a .osg file.
>
>
>
> Is there something extra I need to do to an LOD to flatten the 
> transform out? I am using the osg::Optimizer to do it.
>
>
> ___
> 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] Understanding Node Clone Options

2014-04-16 Thread Cary, Karl A.
Would you, or anyone else, have any idea how I would go about making a custom 
cloner/copier? The reason is because I have found that I have something that 
gets added say 1000 times to our scenegraph. Each instances contains 4 groups, 
where only one of them needs to be cloned. The other 3 can just be shallow 
copied. I tried this with another model that doesn't require the 4th object 
being cloned and saw a significant improvement by not doing so and I would like 
to see the improvement here as well.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sebastian 
Messerschmidt
Sent: Wednesday, April 16, 2014 10:41 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Understanding Node Clone Options

Hi Cary
That makes sense. And I understand it for switches and transforms. Would I need 
to do deep_copy_nodes if it only contained geometry under LODs?
I think the nodes make sense, since it is everything forming the structure 
(i.e. without the geodes containing the drawables)


As for the arrays, we ran some tests and determined it better to flatten 
transforms out and do that for positioning some objects and then just put them 
under a single transform to move them around as a group. It was on the order of 
1000+ objects. I am going to modify that code to allow me to switch methods so 
we can retest it.

From: 
osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sebastian 
Messerschmidt
Sent: Wednesday, April 16, 2014 9:43 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Understanding Node Clone Options

Hi Cary,

I usually use

the combination DEEP_COPY_NODES | DEEP_COPY_CALLBACKS.
It works in my use case, where I need to instance dynamic objects (such as 
cars) which need to keep their individual DoF, Switches and Animations.
I intentionally left out the flatten-static transform optimizations, but It 
might work if you visit your models transforms before optimizing and tag them 
as Dynamic. As far as I remember, nodes tagged DYNAMIC wont be touched by the 
Optimizer.

Regarding the vertices: With the options above the arrays will be shared I 
guess, which is exactly what I want, since I only want to duplicate the 
"structure" but not the geometry. If you clone the arrays each instance will 
have its own geometry, which might have a big impact on performance.

cheers
Sebastian
As our simulation runs we can add and remove models and many times the same 
model repeatedly. We only load the physical model once and then clone it for 
each instance we need. Each model can contain matrix transforms, switches, 
LODs, and update callbacks that all need to be unique. I am trying to limit how 
much we are actually cloning now since we don't necessarily have all of these 
things in every model. For example if we have a light pole that is use 100 
times, we don't even need to clone, we can just add the child directly to the 
scene under different matrix transforms. The problem is in understanding when I 
actually need to clone and what type of options I need.

I know I need to use the DEEP_COPY_ARRAYS when I need the actual vertices to be 
different, which does happen sometimes when I add a matrix that gets flattened 
on to the model. However, for switches, dynamic matrixTransforms, LODS, and 
callbacks, when do I use the different options? So far I have only gotten 
everything to work for those when I do a DEEP_COPY_NODES. Do I really need 
this, or would some subset of other options work?

I guess my main question is when are each of the various DEEP_COPY_ options 
needed?





___

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] Understanding Node Clone Options

2014-04-16 Thread Cary, Karl A.
That makes sense. And I understand it for switches and transforms. Would I need 
to do deep_copy_nodes if it only contained geometry under LODs?

As for the arrays, we ran some tests and determined it better to flatten 
transforms out and do that for positioning some objects and then just put them 
under a single transform to move them around as a group. It was on the order of 
1000+ objects. I am going to modify that code to allow me to switch methods so 
we can retest it.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sebastian 
Messerschmidt
Sent: Wednesday, April 16, 2014 9:43 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Understanding Node Clone Options

Hi Cary,

I usually use

the combination DEEP_COPY_NODES | DEEP_COPY_CALLBACKS.
It works in my use case, where I need to instance dynamic objects (such as 
cars) which need to keep their individual DoF, Switches and Animations.
I intentionally left out the flatten-static transform optimizations, but It 
might work if you visit your models transforms before optimizing and tag them 
as Dynamic. As far as I remember, nodes tagged DYNAMIC wont be touched by the 
Optimizer.

Regarding the vertices: With the options above the arrays will be shared I 
guess, which is exactly what I want, since I only want to duplicate the 
"structure" but not the geometry. If you clone the arrays each instance will 
have its own geometry, which might have a big impact on performance.

cheers
Sebastian
As our simulation runs we can add and remove models and many times the same 
model repeatedly. We only load the physical model once and then clone it for 
each instance we need. Each model can contain matrix transforms, switches, 
LODs, and update callbacks that all need to be unique. I am trying to limit how 
much we are actually cloning now since we don't necessarily have all of these 
things in every model. For example if we have a light pole that is use 100 
times, we don't even need to clone, we can just add the child directly to the 
scene under different matrix transforms. The problem is in understanding when I 
actually need to clone and what type of options I need.

I know I need to use the DEEP_COPY_ARRAYS when I need the actual vertices to be 
different, which does happen sometimes when I add a matrix that gets flattened 
on to the model. However, for switches, dynamic matrixTransforms, LODS, and 
callbacks, when do I use the different options? So far I have only gotten 
everything to work for those when I do a DEEP_COPY_NODES. Do I really need 
this, or would some subset of other options work?

I guess my main question is when are each of the various DEEP_COPY_ options 
needed?




___

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] Understanding Node Clone Options

2014-04-16 Thread Cary, Karl A.
As our simulation runs we can add and remove models and many times the same 
model repeatedly. We only load the physical model once and then clone it for 
each instance we need. Each model can contain matrix transforms, switches, 
LODs, and update callbacks that all need to be unique. I am trying to limit how 
much we are actually cloning now since we don't necessarily have all of these 
things in every model. For example if we have a light pole that is use 100 
times, we don't even need to clone, we can just add the child directly to the 
scene under different matrix transforms. The problem is in understanding when I 
actually need to clone and what type of options I need.

I know I need to use the DEEP_COPY_ARRAYS when I need the actual vertices to be 
different, which does happen sometimes when I add a matrix that gets flattened 
on to the model. However, for switches, dynamic matrixTransforms, LODS, and 
callbacks, when do I use the different options? So far I have only gotten 
everything to work for those when I do a DEEP_COPY_NODES. Do I really need 
this, or would some subset of other options work?

I guess my main question is when are each of the various DEEP_COPY_ options 
needed?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scale Flattening and LODs

2014-04-14 Thread Cary, Karl A.
To at least partially answer my own question, everything seems fine if I 
manually apply the scale to the radius. So essentially, if you have a scale 
transform, it will affect the radius, center point, ranges, and vertex 
positions during the cull and draw. However if you flatten the scale, it seems 
to only affect the vertex positions and center. You have to manually adjust 
ranges and radius.

Is this not supposed to be true? Is there anything else that I need to be 
double checking on? This is with 3.0.1.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, April 14, 2014 12:51 PM
To: OpenSceneGraph Users
Subject: [osg-users] Scale Flattening and LODs

I have run across an issue related to scaled flattening over an LOD. I have a 
Matrix transform with a static scale in it over an LOD node. For the LOD, I 
have exact ranges that I want it to change at, regardless of scale, i.e. always 
switch LOD at 1000ft, 2000ft etc. If I leave the matrix transform in place then 
I have to divide the ranges by the scale value as they get that scalar applied 
to them as well apparently. This is what we have been using for quite some time 
and works fine. I am trying now to flatten the scale transform out. When I do 
it though, the ranges don't get touched so I don't need to adjust them, but for 
some reason the raidus is also being left alone and now suddenly there is a 
center value that did not exist prior. In order to see this, I am spitting out 
the scenegraph to a .osg file.

Is there something extra I need to do to an LOD to flatten the transform out? I 
am using the osg::Optimizer to do it.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Scale Flattening and LODs

2014-04-14 Thread Cary, Karl A.
I have run across an issue related to scaled flattening over an LOD. I have a 
Matrix transform with a static scale in it over an LOD node. For the LOD, I 
have exact ranges that I want it to change at, regardless of scale, i.e. always 
switch LOD at 1000ft, 2000ft etc. If I leave the matrix transform in place then 
I have to divide the ranges by the scale value as they get that scalar applied 
to them as well apparently. This is what we have been using for quite some time 
and works fine. I am trying now to flatten the scale transform out. When I do 
it though, the ranges don't get touched so I don't need to adjust them, but for 
some reason the raidus is also being left alone and now suddenly there is a 
center value that did not exist prior. In order to see this, I am spitting out 
the scenegraph to a .osg file.

Is there something extra I need to do to an LOD to flatten the transform out? I 
am using the osg::Optimizer to do it.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Must I call setDataVariance(DYNAMIC) to a group node?

2014-03-06 Thread Cary, Karl A.
I think my final question about then is, what about MatrixTransforms? If I have 
a Matrix Transform with an updateCallback that sets it's matrix every frame, 
would it matter if it was static or dynamic?

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, March 06, 2014 8:22 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Must I call setDataVariance(DYNAMIC) to a group node?

HI Karl,

On 6 March 2014 12:00, Cary, Karl A. 
mailto:karl.a.c...@leidos.com>> wrote:
This is actually something I have been curious about for exactly how it is done 
as well. What about if you have a Geode who you are going to add or remove 
drawables to. Do you make those drawables DYNAMIC?

It's only the contents of StateSet and Drawables that your need to mark as 
DYNAMIC if their contents are changing.  If only  their ownership is changing 
they you'd don't need to set them to DYNAMIC, even if you remove the StateSet 
or Drawable from the scene graph it's still safe as the rendering back end 
takes a reference to StateSet and Drawables that it's about to render.

Robert.


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


Re: [osg-users] Must I call setDataVariance(DYNAMIC) to a group node?

2014-03-06 Thread Cary, Karl A.
This is actually something I have been curious about for exactly how it is done 
as well. What about if you have a Geode who you are going to add or remove 
drawables to. Do you make those drawables DYNAMIC?

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, March 06, 2014 6:44 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Must I call setDataVariance(DYNAMIC) to a group node?

HI Wu,

You only need to set the Node DataVariance as a hint to the osgUtil::Optimizer 
that is typically only used after loading a new model, the Node DataVariance is 
not used during the update, event, cull or draw traversals.

However, when using DrawThreadPerContext or 
CullThreadPerCameraDrawThreadPerContext threading models the StateSet and 
Drawable DataVariance is used to prevent dynamic leaves of the scene graph 
being updated and rendered at the same time - the draw traversal holds back the 
main thread till all the dynamic objects have been dispatched.

Robert.

On 6 March 2014 03:35, ttaw mailto:wattha...@qq.com>> wrote:
There's a saying on internet that setDataVariance(DYNAMIC) must be called to a 
group node which is to be changed while updating. But in my opinion, it's 
unnecessary because the child drawable pointers and stateset pointers are saved 
in ReaderLeaf as a ref_ptr if OSGUTIL_RENDERBACKEND_USE_REF_PTR is defined. In 
fact, this macro is defined in the begining of the file "RenderLeaf".Even if 
one or more child nodes were removed while updating, the drawables wouldn't be 
deleted and no crash would happen. We must set a node dynamic only when its 
stateset is to be changed or its drawables are to be changed. But I'm not sure 
of this and want to know if I'm right.Could anybody tell me the truth?Thanks.
--
Failure is the mother of success.
Wu Zhicheng


___
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] INDEX_MESH Optimization Question

2014-02-14 Thread Cary, Karl A.
According to the UserGuide, setting up INDEX_MESH | VERTEX_PRETRANSFORM 
|VERTEX_POSTTRANSFORM should replace all tristrips with indexed triangles. For 
some reason, I am still being left with some trstrips. Not all, but some. What 
is strange to me is that I will have a geode with 4 primitive sets, one 
triangles, and then 3 tristrips that only contain 3 triangles each. Any idea 
why this would be happening?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Saving a Named Group in Optimize

2014-02-12 Thread Cary, Karl A.
Nevermind, I found the easiest way is I can just remove the MERGE_GEODES option 
and just make my own MergeGeodesVisitor. I just copied the code from 
Optimizer.cpp, removed the check on isPermissible and then added an extra check 
when it is going through the geodes. If it find that geode is marked to be 
saved via whatever means I tell it, it just adds it back to the group without 
combining. One line change and it works just fine.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Wednesday, February 12, 2014 8:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Saving a Named Group in Optimize

So this seems to work just fine for groups, but how would I keep geodes from 
combining? For example, I have a group that I mark as dynamic that contains 4 
geodes. These 4 geodes need to be kept separate. In most other groups, even 
groups I need to save, the geodes could be combined together. Setting the 
geodes to dynamic or changing node mask or setting comments, none of it stops 
the geodes from being combined. This is when I set the MERGE_GEODES 
optimization option, which I really do need to do.

From: 
osg-users-boun...@lists.openscenegraph.org<mailto:osg-users-boun...@lists.openscenegraph.org>
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce 
Nikolov NICK
Sent: Wednesday, February 05, 2014 12:20 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Saving a Named Group in Optimize

also if you put comment attributes it will not be removed on optimize

Nick

On Wed, Feb 5, 2014 at 12:54 AM, Farshid Lashkari 
mailto:fla...@gmail.com>> wrote:
Hi Karl,

Setting the data variance of a node to DYNAMIC should prevent the optimizer 
from removing it:

group->setDataVariance(osg::Object::DYNAMIC);

Cheers,
Farshid

On Tue, Feb 4, 2014 at 1:49 PM, Cary, Karl A. 
mailto:karl.a.c...@leidos.com>> wrote:
Is there a way to save a named group from being optimized away by setting 
either some type of option or flag before running the optimizer? I can always 
write a custom optimize visitor to handle it, but it just seemed like it might 
be a common case that is handled and I haven't known about. Thanks.

Karl


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


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



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


Re: [osg-users] Saving a Named Group in Optimize

2014-02-12 Thread Cary, Karl A.
So this seems to work just fine for groups, but how would I keep geodes from 
combining? For example, I have a group that I mark as dynamic that contains 4 
geodes. These 4 geodes need to be kept separate. In most other groups, even 
groups I need to save, the geodes could be combined together. Setting the 
geodes to dynamic or changing node mask or setting comments, none of it stops 
the geodes from being combined. This is when I set the MERGE_GEODES 
optimization option, which I really do need to do.

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov 
NICK
Sent: Wednesday, February 05, 2014 12:20 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Saving a Named Group in Optimize

also if you put comment attributes it will not be removed on optimize

Nick

On Wed, Feb 5, 2014 at 12:54 AM, Farshid Lashkari 
mailto:fla...@gmail.com>> wrote:
Hi Karl,

Setting the data variance of a node to DYNAMIC should prevent the optimizer 
from removing it:

group->setDataVariance(osg::Object::DYNAMIC);

Cheers,
Farshid

On Tue, Feb 4, 2014 at 1:49 PM, Cary, Karl A. 
mailto:karl.a.c...@leidos.com>> wrote:
Is there a way to save a named group from being optimized away by setting 
either some type of option or flag before running the optimizer? I can always 
write a custom optimize visitor to handle it, but it just seemed like it might 
be a common case that is handled and I haven't known about. Thanks.

Karl


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


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



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


[osg-users] Tristrip Building Question

2014-02-06 Thread Cary, Karl A.
In the beginning our application, Performer was used. During that time, someone 
customized the obj loader to handle some specific stuff. When we went to OSG, 
we simply then converted our pfb files in to ive files so as not to lose this 
customization. I am attempting to get rid of the middle step of going through 
Performer, but I have run in to a situation where Performer is generating 
better performing models. The modifications to the obj loader were simply for 
ordering some groups that needed to not be optimized away. The building of the 
geometry is all standard Performer. The big issue is that Performer would build 
everything in to a single tristrip when possible. I don't see where anything 
inside OSG can allow us to do this without trying to figure it out with a 
custom optimizer. For a simple example I created a 16 sided cylinder. The 
performer method resulted in a single tri-strip of 160 tris. The OSG method 
created 13 tri-strips of varying size. The performer method draw
 s 30% faster. This performance increase scales up with the complexity of our 
models. Is there some known method to allow for combining all of these 
tri-strips together?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Tristrip Building Question

2014-02-06 Thread Cary, Karl A.
In the beginning our application, Performer was used. During that time, someone 
customized the obj loader to handle some specific stuff. When we went to OSG, 
we simply then converted our pfb files in to ive files so as not to lose this 
customization. I am attempting to get rid of the middle step of going through 
Performer, but I have run in to a situation where Performer is generating 
better performing models. The modifications to the obj loader were simply for 
ordering some groups that needed to not be optimized away. The building of the 
geometry is all standard Performer. The big issue is that Performer would build 
everything in to a single tristrip when possible. I don't see where anything 
inside OSG can allow us to do this without trying to figure it out with a 
custom optimizer. For a simple example I created a 16 sided cylinder. The 
performer method resulted in a single tri-strip of 160 tris. The OSG method 
created 13 tri-strips of varying size. The performer method draw
 s 30% faster. This performance increase scales up with the complexity of our 
models. Is there some known method to allow for combining all of these 
tri-strips together?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Saving a Named Group in Optimize

2014-02-04 Thread Cary, Karl A.
Is there a way to save a named group from being optimized away by setting 
either some type of option or flag before running the optimizer? I can always 
write a custom optimize visitor to handle it, but it just seemed like it might 
be a common case that is handled and I haven't known about. Thanks.

Karl

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


Re: [osg-users] detected OpenGL error 'out of memory' at AfterRenderer::compile

2013-09-12 Thread Cary, Karl A.
We have had this issue as well and simply converting our textures to dds
fixed everything. We can now load 100x what we could before in terms of
number of models. I would look at that type of option first.

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Thursday, September 12, 2013 11:04 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] detected OpenGL error 'out of memory' at
AfterRenderer::compile

 

Hi Andrew,

 

If you have too much data for OpenGL to handle it will report an error.
What you have to do is work out how to work with small models or create
the models in such a way that they don't have such a large OpenGL
footprint.

 

You say nothing about what your models contain, or what type of
application behavior you want when managing these models, given this
there really isn't much we can advice, it's simply too open ended.

 

Robert.

 

On 5 September 2013 13:59, Andrew Nie  wrote:

Hi,
   I load several model files and encountered the following warning:
"detected OpenGL error 'out of memory' at After Renderer::compile". Here
is my code:

   int main()
{

osg::ref_ptr viewer = new
osgViewer::Viewer();

osg::ref_ptr root = new osg::Group();

osg::ref_ptr node1 =
osgDB::readNodeFile("E:\\Scene\\Background.ive");
osg::ref_ptr node2 =
osgDB::readNodeFile("E:\\Scene\\N_0.ive");//
osg::ref_ptr node3 =
osgDB::readNodeFile("E:\\Scene\\Q_0.ive");//
osg::ref_ptr node4 =
osgDB::readNodeFile("E:\\Scene\\TH_0.ive");//


osg::ref_ptr mt = new
osg::MatrixTransform();

 
mt->setMatrix(osg::Matrix::rotate(osg::PI_2,osg::Vec3d(1.0,0.0,0.0)));
mt->addChild(node1);
mt->addChild(node2);
mt->addChild(node3);
mt->addChild(node4);


//
root->addChild(mt);

//
osgUtil::Optimizer optimizer ;
optimizer.optimize(root.get()) ;

osg::ref_ptr tb = new
osgGA::TrackballManipulator();
tb->setTrackballSize(0.9);
viewer->setCameraManipulator(tb);
viewer->setSceneData(root.get());

viewer->realize();

viewer->run();

return 0 ;
}

The four ive files (Background.ive,N_0.ive,Q_0.ive,TH_0.ive) are
400M,260M,211M,410M
respectively. I found that,if I only load the first two files, the
warning did't appear, but if load one more file of the other two, the
warning show up.
Has anyone encountered such a problem?Any advice and suggestion will be
appreciated...


...

Thank you!

Cheers,
Andrew

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





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

 

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


Re: [osg-users] Removing ancient plugins, please read if you want to protect the plugins you need.

2013-06-18 Thread Cary, Karl A.
We currently are still forced to use some old pfb models. And we are
being told that we also have to use the latest version of OSG for
"security" reasons. Puts us in a tough spot if it won't exist any more.
If it has to be, then I am sure we can find a way around it, but just
thought I would speak up.

Funny how having Performer installed is ok from a security perspective,
but not a few month old version of OSG!

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Tuesday, June 18, 2013 12:08 PM
To: OpenSceneGraph Users
Subject: [osg-users] Removing ancient plugins, please read if you want
to protect the plugins you need.

Hi All,

I am currently looking through the OSG plugins and there a couple of
plugins that might now be safe to remove.  The ones I'm thinking of
are:

pfb - Performer plugin that loads Performer models using Performer
itself.
Performer has been support for a while now, I guess there is
chance that some users
might have a copy installed on an old system, but chances that
they'd still us to import
models into the OSG are slim.   This code is just sitting
around unused, I can't compile
it so can't support it, so I think it's time to remove it.

dw - designer workshop.  Does anybody use this type of file anymore?

ac  - AC3D modeller format. Does anybody use this type of file anymore?

All of these plugins are for ancient modellers/middleware that is long
been unsupported. The later too are small and don't have any external
requirements so I can still compile them, but I haven't any models to
test.

So... if you have any reason to want any of these plugins please speak
up, otherwise I'll remove them from svn and make all our builds and
install just a little faster and smaller :-)

Thanks in advance for you feedback,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
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 textures to a model in openscenegraph?

2013-05-24 Thread Cary, Karl A.
If you have a need to actually change the flt file itself to change it
to use dds textures, you can write something using the openFLT API. I
actually just very recently did this myself. We had several hundred
models we were converting to use dds instead of rgb files. The samples
given with the API and the documentation should be good enough if you go
that route. Look at the egwalk example to figure out how to drill down
the structure. To actually change the name you will need to use the
mgGetFirstTexture, mgGetTextureSaveName, and mgGetNextTexture. That took
me a while to figure out..

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Lokesh
kumar
Sent: Thursday, May 23, 2013 6:02 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] How to apply textures to a model in
openscenegraph?

Robert Osfield  writes:

> 
> Hi Lokesh,
> 
> The easist thing to do would be to use osgconv to convert the files to

> native OSG binary format .osgb and have osgconv do the compression for

> you.  Use osgconv --help for the options.  The other alternative to to

> write your own osgDB::Registry::ReadFile callback that intercepts the 
> readImage calls and changes the filename to the .dds equivalent.
> 
> Robert.
> 


Thank you Robert!!

I'm interested in your 2nd alternative :- 

using osgDB::Registry::ReadFile  


but, i'm Newbie in openscenegraph.
can you give a short example.

Regards
-Lokesh 



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


[osg-users] MipMap Question

2013-05-03 Thread Cary, Karl A.
We recently took some flt files that were using rgb files as textures
and converted them to dds textures with mipmaps built in to them. I
noticed while checking up on our scenegraph that
useHardwareMipMapGeneration was set to true for all of these textures.
Since the dds textures already have them created, do I need to disable
this, or does it simply not do anything since the mipmaps already exist?
Thanks for the info.

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


[osg-users] Compiling Stateset for Node Move

2013-02-01 Thread Cary, Karl A.
I need to move some nodes around in my structure that inherit various
parts of their statesets from it's parent nodes. Is there an easy way to
compile it's stateset for moving it around? I will give a very dumbed
down example of what I am trying to do:

 

 

  Grp 1

/   \

  /   \

 Grp 2 Grp 3

 |

 |

Grp 4

 

So each group has it's own stateset, but inherit some aspect of it's
state from it's parent. I want to move Grp 4 over to be under Grp 3. So
I would need to compile the full stateset of Grp 4 before I move it
over.

 

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


[osg-users] Method for Converting FLT files to use DDS Textures

2013-01-25 Thread Cary, Karl A.
This isn't a direct OSG question, but one I was hoping people on this
list might be able to help out with. We have several thousand FLT files
that use rgbs as textures. Unfortunately we can't convert these to ive
or osgb files as they are shared with another application that is not
made in OSG and only supports FLT files. However, both can support FLT
files using DDS textures to allow for texture compression. Through
testing we have shown a large improvement by doing this, so we want to
go that route.

 

The issue is how to convert all of these FLT files over. We can easily
batch convert all of the textures, that is not a problem. The issue is
updating the FLT files themselves to tell them to point to the dds
texture instead of the rgb texture. Having someone manually open up each
file and edit the texture names is VERY time consuming. Does anyone know
of an easy way we could do this through scripting or a custom converter
or something else? The files will stay named the same except for the
.rgb will become .dds.

 

Thanks in advance.

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


Re: [osg-users] how to buildethe debug version of osg under Linux?

2013-01-18 Thread Cary, Karl A.
Yes. You can change it, but by default it appends the 'd' to the name.

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jan
Ciger
Sent: Friday, January 18, 2013 8:50 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] how to buildethe debug version of osg under
Linux?

 

 

On Fri, Jan 18, 2013 at 1:01 PM, Cary, Karl A. 
wrote:

Remember that by default OSG will append a 'd' to the library name so
make sure your build system for your application handles that when
building in debug mode, otherwise it will continue to link to the normal
libraries. To make myself clearer, for example, you would normally use
libosg.so, but the debug library will be libosgd.so.  If you have it set
up to handle this already great, but if not, like I had to, you will
need to account for it.

 

Does it actually do that in Linux? I don't think it does, but I may be
wrong - I haven't rebuilt mine in a while. This is necessary in Windows
because you must not mix debug and release builds, but in Linux it is no
problem. 

Jan

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


Re: [osg-users] how to buildethe debug version of osg under Linux?

2013-01-18 Thread Cary, Karl A.
Remember that by default OSG will append a 'd' to the library name so
make sure your build system for your application handles that when
building in debug mode, otherwise it will continue to link to the normal
libraries. To make myself clearer, for example, you would normally use
libosg.so, but the debug library will be libosgd.so.  If you have it set
up to handle this already great, but if not, like I had to, you will
need to account for it.

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jan
Ciger
Sent: Friday, January 18, 2013 4:31 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] how to buildethe debug version of osg under
Linux?

 

 

On Fri, Jan 18, 2013 at 5:24 AM, Lv Qing  wrote:

Hi,

 When I cmake the osg source under Linux,it seems to bulid the
release version by default.Just want to know how to bulid the debug
version :)


Run ccmake or cmake-gui and change build type variable to Debug. You can
also do it using regular cmake using a command line argument/define, but
I don't recall the syntax from memory. However, I believe that, unless
OSG sets this explicitly, the CMake default is a debug build if nothing
is specified explicitly.

Regards,

Jan

 

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


Re: [osg-users] [forum] Throttling OSG

2012-12-10 Thread Cary, Karl A.
I am confused by your post. You set the scheme to on demand, then change
it right back to continuous, essentially doing nothing. But then you
call setRunMaxFrameRate, which I do not even see as being an osgViewer
function.

We do the traversals manually to control our frame rate.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Kenn
Sebesta
Sent: Sunday, December 09, 2012 12:04 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [forum] Throttling OSG


zonk wrote:
> you could change the frame scheme from CONTINUOUS to ON_DEMAND.
> Or look into viewers run() function and perform the different
traversal calls per frame manually.
> 


Yes, that was exactly it:

viewer->setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); 
viewer->setRunFrameScheme(osgViewer::ViewerBase::CONTINUOUS); 
viewer->setRunMaxFrameRate(double fps);

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





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


Re: [osg-users] From Maya to OSH

2012-12-06 Thread Cary, Karl A.
You can look at the maya2osg project at
http://sourceforge.net/projects/maya2osg/. The problem is that it hasn't
been maintained recently. We are having the same issue and in the past
we exported or models to obj format, then converted to pfb with a custom
performer library to handle some special cases (used to use Performer
before OSG), then osgconv the pfb to an ive. I am currently taking the
code from maya2osg to hopefully go straight. I have to add in our custom
changes first though. With Maya 2011, I was able to successfully convert
some of our basic models over to ive directly as an export from Maya.
Haven't tried other versions or more complicated models yet.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ferran
Altarriba Bertran
Sent: Friday, November 30, 2012 12:33 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] From Maya to OSH

Hi,

I'm very very new to OSG, so maybe my doubts will seem quite easy to
solve for you...

the point is that I have a 3D model done in Autodesk Maya (including
materials, image textures, videotextures and animation) and I need to
export it to OSG.

I haven't found the way to do it directly from Maya (does this way
exist?), so I tried to export from Maya to OBJ+MTL and then from this to
OSG. The problem is that I can only convert the OBJ file to OSG, I don't
know how to add the MTL too.

Have u know how can I solve this? 

Thanks a million! :)

Cheers,
Ferran

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





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


Re: [osg-users] osgText::readFontFile fails to find font file

2012-11-05 Thread Cary, Karl A.
Double check and make sure permissions are not an issue. I had that
problem once with my fonts. But as Robert suggested, make sure it is
just that the fonts file isn't readable.

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Monday, November 05, 2012 12:10 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgText::readFontFile fails to find font file

 

Hi Mike,

It's a while since I've seen reports of problems finding fonts, so I
guess there must be something unusual going on with your setup/usage.

W.r.t finding fonts, or any files, trying using set the env
OSG_NOTIFY_LEVEL to DEBUG and then look for entries relating to
FindFileInPath, these should tell you where the OSG is looking for the
fonts.

Another avenue you could look at is to try the fonts provided in the
OpenSceneGraph-Data distribution, as perhaps the fonts you are
attempting to read can't be loaded by freetype.

Robert.

On 5 November 2012 15:26, Mike Krus  wrote:

Hi,

 

I'm having some issues getting OSG to find my font file in Red Hat
Enterprise Linux 5.8.

 

>From the documentation I can see that osgText::readFontFile should be
looking in /usr/share/fonts/ttf to find my fonts, but this path does not
exist in RHEL.

 

I have added /usr/share/fonts to my OSG_FILE_PATH environment variable
and called
osgText::readFontFile("liberation/LiberationSans-Regular.ttf") or
osgText::readFontFile("/usr/share/fonts/liberation/LiberationSans-Regula
r.ttf") but my font is still not found
(/usr/share/fonts/liberation/LiberationSans-Regular.ttf exists).

 

The error message I receive is: "Warning: Could not find plugin to read
objects from file "..."."

 

I don't receive any other messages relating to the failure to load
plugins, and OSG happily loads Arial in Windows.

 

Any advice you could provide would be really useful.

 

 

 


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.or
g

 

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


[osg-users] Memory Clean Up Question

2012-10-15 Thread Cary, Karl A.
I am tracking down some memory leaks in our program and have come across
a couple situations where I am currently not sure if it is/can cause a
memory leak. There are many instances in our code where we do something
similar:

 

osg::ref_ptr geo  = new osg::Geometry;

geo->getOrCreateStateSet()->addUniform(new osg::Uniform("blah",
someVal));

geo->getOrCreateStateSet()->addUniform(new osg::Uniform("blah2",
someVal2));

 

What I am wondering is, will osg now clean up those 2 new uniforms? Or
do I need that be created externally as ref_ptrs so when my object
deletes they will be deleted? I personally want to change it to
ref_ptrs, but given the number of places this change needs to be made, I
at least want to know if the work is truly needed or not.

 

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


Re: [osg-users] Using glDrawElements causes crash with osg::Stats

2012-09-13 Thread Cary, Karl A.
While this did not directly solve the problem, it pointed me to it. By
calling state.disableAllVertexArrays() before doing the state.set*
calls, it now works. I am going through to find out if there is one
specific array that was causing the issue and also to see if I can
recreate the same thing using raw gl calls as well. I will post what I
find so if anyone else ever has this problem the answer will be
available. Thanks Robert!

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Thursday, September 13, 2012 9:18 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using glDrawElements causes crash with
osg::Stats

Hi Karl,

On 13 September 2012 12:30, Cary, Karl A.  wrote:
> It is crashing in the glDrawElements call, which I can't step in to. 
> All the data passed in looks valid in the debugger.

This suggest to me that one of the vertex attribute arrays has been left
enabled and the OpenGL driver is attempting to read from it past the end
of the data that had previous set up for that array.  For instance,
perhaps the colour array is left on.  Have a look at the
osg::Geometry::drawImplementation(osg::RenderInfo&) method, it has a
code block where it does:

state.lazyDisablingOfVertexAttributes();

// then does all the state.setVertexPointer(..) that are required

state.applyDisablingOfVertexAttributes();

// dispatch primitive data

Perhaps something like this would work for your app.

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


Re: [osg-users] Using glDrawElements causes crash with osg::Stats

2012-09-13 Thread Cary, Karl A.
It is crashing in the glDrawElements call, which I can't step in to. All
the data passed in looks valid in the debugger.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich
Hertlein
Sent: Thursday, September 13, 2012 1:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using glDrawElements causes crash with
osg::Stats

Hi Karl,

On 12/09/12 22:28, Cary, Karl A. wrote:
> Alright so I adjusted my code to do everything through the osg::State,

> including trying the osg::State's glDrawElementsInstanced instead of 
> the normal GL glDrawElements, and I am still having the same issue. It

> still works normally but crashes when I enable stats. Is there a call 
> I need to make that I am missing? Here is the adjusted code:

Debugger?  Having a stack trace saves a lot of guesswork and makes up
for a lot of missing information.

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


Re: [osg-users] Using glDrawElements causes crash with osg::Stats

2012-09-12 Thread Cary, Karl A.
Alright so I adjusted my code to do everything through the osg::State,
including trying the osg::State's glDrawElementsInstanced instead of the
normal GL glDrawElements, and I am still having the same issue. It still
works normally but crashes when I enable stats. Is there a call I need
to make that I am missing? Here is the adjusted code:

Void MyDrawable::drawImplementation(osg::RenderInfo& ri)
{
//get the current active buffer
VertBuffer buffer = getCurBuffer();

//get osg State and apply vertex and normal pointers
osg::State &state = *ri.getState();
state.setVertexPointer(3, GL_FLOAT, 0, (GLvoid*)pmCoords);
state.setNormalPointer(GL_FLOAT, 0, (GLvoid*)pmNormals);

//draw
if (buffer.vertexList.size() > 0)
{
state.glDrawElementsInstanced(GL_TRIANGLES,
buffer.vertexList.size(), GL_UNSIGNED_INT, &(buffer.vertexList)[0], 1);
}

//disable vertex and normal pointers
state.disableNormalPointer();
state.disableVertexPointer();
}

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Wednesday, September 12, 2012 4:15 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using glDrawElements causes crash with
osg::Stats

Hi Karl,

The OSG uses lazy state updating to aovid calling OpenGL when it's not
needed but when you do your own OpenGL calls outside this lazy state
update mechanism the OSG doesn't know the OpenGL state is now different
than when the OSG last applied something so ends up not applying state
when it should.

The way to fix it is to stop the state leakage from your own custom cost
vis the glPush*()/glPop*() or to tell the OSG that you've changed the
state via the osg::State::haveApplied*() calls or simply to use the
osg::State class itself for applying the state you want to change.
 There are a whole series of methods for doing vertex array set up that
you can use so have a look at these.

Robert.

On 11 September 2012 18:40, Cary, Karl A.  wrote:
> I have a situation that is requiring me to use raw gl commands in the 
> drawImplementation of an osg::Drawable. I have a double buffer that is

> not updated fully until draw time as opposed to update time and I am 
> not at liberty to change this. Currently in the drawImplementation, I 
> get the current buffer, then perform glVertex and glNormal commands on

> the list of vertices in the buffer. This works just fine and there are

> no problems other than it can slow down the scene do to the number of 
> verts. I was attempting to convert this to a glDrawElements call as a 
> quick improvement and saw a noticeable performance increase. 
> Everything is drawing just fine and I haven't found any slow downs or 
> stability issues, with one exception. If I enable osg::Stats, it 
> crashes immediately and I have no idea why. I was hoping someone might

> have some insight for me. Here is the drawImplementation code:
>
>
>
> {
>
> //get the current active buffer
>
> VertBuffer buffer = getCurBuffer();
>
>
>
> //set up the client state
>
> glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); //crashes immediately 
> without this
>
> glEnableClientState(GL_VERTEX_ARRAY);
>
> glEnableClientState(GL_NORMAL_ARRAY);
>
>
>
> //set up arrays
>
> glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)pmCoords);
>
> glNormalPointer(GL_FLOAT, 0, (GLvoid*)pmNormals);
>
>
>
> //draw
>
> if (buffer.vertexList.size() > 0)
>
> {
>
> glDrawElements(GL_TRIANGLES, 
> buffer.vertexList.size(), GL_UNSIGNED_INT, &(buffer.vertexList)[0]);
>
> }
>
>
>
> //disable client state
>
> glDisableClientState(GL_VERTEX_ARRAY);
>
> glDisableClientState(GL_NORMAL_ARRAY);
>
> glPopClientAttrib();
>
> }
>
>
>
> In this, VertBuffer, is just a structure that holds a 
> std::vector int> of the vertices to draw (vertexList), and some other info that is

> int> not
> used during the draw. pmCoords and pmNormals are lists of all 
> available coordinates and their normals. The vertexList is just a list

> of indices in these coordinates to draw at this time.
>
>
>
> As I said, everything works fine if the draw is as follows instead:
>
>
>
> glBegin(GL_TRIANGLES);
>
> for (int ii = 0; ii < buffer.vertexList.size(); ii+= 
> 3)
>
> {
>
>
> glNormal3fv(pmNormals[buffer.vertexList[ii]];
>
> 
> glVertex3fv(pmCoords[buffer.vertexList[ii]];
>
> glNormal3fv(pmNormals[buffer.vertexList[ii+1]];
>
> glVertex3fv(pmCoords[buffer.vertexList[ii+1]];
>
> glNormal3fv(p

[osg-users] Using glDrawElements causes crash with osg::Stats

2012-09-11 Thread Cary, Karl A.
I have a situation that is requiring me to use raw gl commands in the
drawImplementation of an osg::Drawable. I have a double buffer that is
not updated fully until draw time as opposed to update time and I am not
at liberty to change this. Currently in the drawImplementation, I get
the current buffer, then perform glVertex and glNormal commands on the
list of vertices in the buffer. This works just fine and there are no
problems other than it can slow down the scene do to the number of
verts. I was attempting to convert this to a glDrawElements call as a
quick improvement and saw a noticeable performance increase. Everything
is drawing just fine and I haven't found any slow downs or stability
issues, with one exception. If I enable osg::Stats, it crashes
immediately and I have no idea why. I was hoping someone might have some
insight for me. Here is the drawImplementation code:

 

{

//get the current active buffer

VertBuffer buffer = getCurBuffer();

 

//set up the client state

glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); //crashes immediately
without this

glEnableClientState(GL_VERTEX_ARRAY);

glEnableClientState(GL_NORMAL_ARRAY);

 

//set up arrays

glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)pmCoords);

glNormalPointer(GL_FLOAT, 0, (GLvoid*)pmNormals);

 

//draw

if (buffer.vertexList.size() > 0)

{

glDrawElements(GL_TRIANGLES,
buffer.vertexList.size(), GL_UNSIGNED_INT, &(buffer.vertexList)[0]);

}

 

//disable client state

glDisableClientState(GL_VERTEX_ARRAY);

glDisableClientState(GL_NORMAL_ARRAY);

glPopClientAttrib();

}

 

In this, VertBuffer, is just a structure that holds a
std::vector of the vertices to draw (vertexList), and some
other info that is not used during the draw. pmCoords and pmNormals are
lists of all available coordinates and their normals. The vertexList is
just a list of indices in these coordinates to draw at this time.

 

As I said, everything works fine if the draw is as follows instead:

 

glBegin(GL_TRIANGLES);

for (int ii = 0; ii < buffer.vertexList.size(); ii+= 3)

{

 
glNormal3fv(pmNormals[buffer.vertexList[ii]];

 
glVertex3fv(pmCoords[buffer.vertexList[ii]];

glNormal3fv(pmNormals[buffer.vertexList[ii+1]];

glVertex3fv(pmCoords[buffer.vertexList[ii+1]];

glNormal3fv(pmNormals[buffer.vertexList[ii+2]];

glVertex3fv(pmCoords[buffer.vertexList[ii+2]];

}

glEnd();

 

I've tried copying the data locally from the buffer and that did nothing
different. I even tried to create a small array locally that contained
the same data. If I only drew 1 triangle it was fine, but if I tried to
draw more, it would sometimes work and sometimes crash.

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


Re: [osg-users] Texture Questions

2012-08-27 Thread Cary, Karl A.
Alright to add what I have found thus far. We went back and reconverted the 
images using an option when we saved to flip the images vertically. By doing 
this I don't have to do anything in the code. The only difference between 
loading jpgs and ddss now is the extension at the end of the filename. I ran my 
code 100 times with jpgs and it always worked fine. When I ran it 100 times 
with ddss, it averaged to every other run one of the textures would be screwed 
up. The other runs all of them were fine.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 9:44 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

Alright, so I am calling flipVertical() and setOrigin(osg::Image::TOP_LEFT) on 
the image before setting it in the Texture2D. In my current example I am 
loading 4 textures. As jpgs they always work fine. As dds, sometimes all 4 show 
up, and sometimes a different one will not show up. And it is a different one 
each time. Any clues?

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 9:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

Ok, think I found the problem. DDS, being designed for DirectX, defines (0,0) 
as top left whereas OpenGL defines it as bottom left. So all I should need to 
do is flip it. On to do that

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 8:39 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I have my code loading dds now, but the mapping is all screwed up as a result. 
All I did was change the extension on the filename from jpg to dds and left 
everything else alone.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Monday, August 27, 2012 7:55 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I believe osg dds plugin uses stored ones, if there any. At least there are 
some code that takes care of mipmaps in dds plugin.

27.08.2012, 14:32, "Cary, Karl A." :
> Will I need to do anything in osg to make sure it uses the pre-generated 
> mipmaps stored in the DDS file and not recreate new ones? Working on saving 
> the textures out as dds now.
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
> Sergey Polischuk
> Sent: Monday, August 27, 2012 2:23 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Texture Questions
>
> Hi
>
> You can use compressed textures in dds format, as they support dxtc texture 
> compression. You can create those with ati compressonator tool, nvidia 
> texture tools, or in photoshop using nvidia plugin. For rgb images you'll get 
> 6x compression ratio. Also, you can save textures in dds format with 
> pre-generated mipmaps, if you need those.
>
> Cheers.
>
> 24.08.2012, 21:13, "Cary, Karl A." :
>
>>  I do have the ability to pre-process. The question is, what file
>>  formats support openGL compression and how do I take them from jpeg 
>> to
>>  these formats? As for mipmapping, you mentioned that it can be done CPU 
>> side.
>>  How do I initiate this? Since the texture load is happening in a
>>  separate thread, I can afford CPU time to do this rather than 
>> pushing
>>  more on to the GPU. I can test out to see if it is worthwhile.
>>
>>  -Original Message-
>>  From: osg-users-boun...@lists.openscenegraph.org
>>  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
>>  Robert Osfield
>>  Sent: Friday, August 24, 2012 11:40 AM
>>  To: OpenSceneGraph Users
>>  Subject: Re: [osg-users] Texture Questions
>>
>>  Hi Karl,
>>
>>  On 24 August 2012 14:40, Cary, Karl A.  wrote:
>>>   I have an application that loads several 2048x2048 textures in a
>>>   separate thread before passing off to the main to be applied to 
>>> the
>>>   geometry. I am trying to do anything and everything I can to 
>>> improve
>>>   performance on them as the number of textures will increase from
>>>   several to quite a lot. So I am looking at every option I can and
>>>  have
>>>   run in to several questions that I was hoping to get some advice on.
>>>  I
>>>   am creating osg::Texture2D and loading them with an osg::Im

Re: [osg-users] Texture Questions

2012-08-27 Thread Cary, Karl A.
Alright, so I am calling flipVertical() and setOrigin(osg::Image::TOP_LEFT) on 
the image before setting it in the Texture2D. In my current example I am 
loading 4 textures. As jpgs they always work fine. As dds, sometimes all 4 show 
up, and sometimes a different one will not show up. And it is a different one 
each time. Any clues?

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 9:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

Ok, think I found the problem. DDS, being designed for DirectX, defines (0,0) 
as top left whereas OpenGL defines it as bottom left. So all I should need to 
do is flip it. On to do that

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 8:39 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I have my code loading dds now, but the mapping is all screwed up as a result. 
All I did was change the extension on the filename from jpg to dds and left 
everything else alone.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Monday, August 27, 2012 7:55 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I believe osg dds plugin uses stored ones, if there any. At least there are 
some code that takes care of mipmaps in dds plugin.

27.08.2012, 14:32, "Cary, Karl A." :
> Will I need to do anything in osg to make sure it uses the pre-generated 
> mipmaps stored in the DDS file and not recreate new ones? Working on saving 
> the textures out as dds now.
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
> Sergey Polischuk
> Sent: Monday, August 27, 2012 2:23 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Texture Questions
>
> Hi
>
> You can use compressed textures in dds format, as they support dxtc texture 
> compression. You can create those with ati compressonator tool, nvidia 
> texture tools, or in photoshop using nvidia plugin. For rgb images you'll get 
> 6x compression ratio. Also, you can save textures in dds format with 
> pre-generated mipmaps, if you need those.
>
> Cheers.
>
> 24.08.2012, 21:13, "Cary, Karl A." :
>
>>  I do have the ability to pre-process. The question is, what file
>>  formats support openGL compression and how do I take them from jpeg 
>> to
>>  these formats? As for mipmapping, you mentioned that it can be done CPU 
>> side.
>>  How do I initiate this? Since the texture load is happening in a
>>  separate thread, I can afford CPU time to do this rather than 
>> pushing
>>  more on to the GPU. I can test out to see if it is worthwhile.
>>
>>  -Original Message-
>>  From: osg-users-boun...@lists.openscenegraph.org
>>  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
>>  Robert Osfield
>>  Sent: Friday, August 24, 2012 11:40 AM
>>  To: OpenSceneGraph Users
>>  Subject: Re: [osg-users] Texture Questions
>>
>>  Hi Karl,
>>
>>  On 24 August 2012 14:40, Cary, Karl A.  wrote:
>>>   I have an application that loads several 2048x2048 textures in a
>>>   separate thread before passing off to the main to be applied to 
>>> the
>>>   geometry. I am trying to do anything and everything I can to 
>>> improve
>>>   performance on them as the number of textures will increase from
>>>   several to quite a lot. So I am looking at every option I can and
>>>  have
>>>   run in to several questions that I was hoping to get some advice on.
>>>  I
>>>   am creating osg::Texture2D and loading them with an osg::Image 
>>> read
>>>  in
>>  from a jpg file.
>>
>>  Excatly how many textures are you talking about?
>>
>>  Will of the texture reside in memory and be rendered at the same time?
>>
>>  Do you have an flexibility w.r.t pre-processing the image data into
>>  other file formats?
>>
>>  What pixel format do the textures have?  RGB?
>>>   1)  Is mipmapping enabled by default? Or do I need to call
>>>   allocateMipmapLevels?
>>  By default the osg::Texture* will use trilinear mipmapping, if the
>>  osg::Image doesn't contain the mipmaps then it'll either generate 
>> them
>>  on demand in the rendering thread either done by the GL driver or 
>

Re: [osg-users] Texture Questions

2012-08-27 Thread Cary, Karl A.
Ok, think I found the problem. DDS, being designed for DirectX, defines (0,0) 
as top left whereas OpenGL defines it as bottom left. So all I should need to 
do is flip it. On to do that

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Monday, August 27, 2012 8:39 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I have my code loading dds now, but the mapping is all screwed up as a result. 
All I did was change the extension on the filename from jpg to dds and left 
everything else alone.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Monday, August 27, 2012 7:55 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I believe osg dds plugin uses stored ones, if there any. At least there are 
some code that takes care of mipmaps in dds plugin.

27.08.2012, 14:32, "Cary, Karl A." :
> Will I need to do anything in osg to make sure it uses the pre-generated 
> mipmaps stored in the DDS file and not recreate new ones? Working on saving 
> the textures out as dds now.
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org 
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
> Sergey Polischuk
> Sent: Monday, August 27, 2012 2:23 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Texture Questions
>
> Hi
>
> You can use compressed textures in dds format, as they support dxtc texture 
> compression. You can create those with ati compressonator tool, nvidia 
> texture tools, or in photoshop using nvidia plugin. For rgb images you'll get 
> 6x compression ratio. Also, you can save textures in dds format with 
> pre-generated mipmaps, if you need those.
>
> Cheers.
>
> 24.08.2012, 21:13, "Cary, Karl A." :
>
>>  I do have the ability to pre-process. The question is, what file
>>  formats support openGL compression and how do I take them from jpeg 
>> to
>>  these formats? As for mipmapping, you mentioned that it can be done CPU 
>> side.
>>  How do I initiate this? Since the texture load is happening in a
>>  separate thread, I can afford CPU time to do this rather than 
>> pushing
>>  more on to the GPU. I can test out to see if it is worthwhile.
>>
>>  -Original Message-
>>  From: osg-users-boun...@lists.openscenegraph.org
>>  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
>>  Robert Osfield
>>  Sent: Friday, August 24, 2012 11:40 AM
>>  To: OpenSceneGraph Users
>>  Subject: Re: [osg-users] Texture Questions
>>
>>  Hi Karl,
>>
>>  On 24 August 2012 14:40, Cary, Karl A.  wrote:
>>>   I have an application that loads several 2048x2048 textures in a
>>>   separate thread before passing off to the main to be applied to 
>>> the
>>>   geometry. I am trying to do anything and everything I can to 
>>> improve
>>>   performance on them as the number of textures will increase from
>>>   several to quite a lot. So I am looking at every option I can and
>>>  have
>>>   run in to several questions that I was hoping to get some advice on.
>>>  I
>>>   am creating osg::Texture2D and loading them with an osg::Image 
>>> read
>>>  in
>>  from a jpg file.
>>
>>  Excatly how many textures are you talking about?
>>
>>  Will of the texture reside in memory and be rendered at the same time?
>>
>>  Do you have an flexibility w.r.t pre-processing the image data into
>>  other file formats?
>>
>>  What pixel format do the textures have?  RGB?
>>>   1)  Is mipmapping enabled by default? Or do I need to call
>>>   allocateMipmapLevels?
>>  By default the osg::Texture* will use trilinear mipmapping, if the
>>  osg::Image doesn't contain the mipmaps then it'll either generate 
>> them
>>  on demand in the rendering thread either done by the GL driver or 
>> GPU
>>  using OpenGL extensions for generating mipmaps, or on the CPU using
>>  GLU functions when the driver doesn't support the generate mipmap
>>  extensions.
>>
>>  You can switch the mipmapping off by just setting the
>>  texture->setFilter(Texture::MIN_FILTER, Texture::LINEAR);
>>>   2)  If it is enabled, how many levels are created by default?
>>  osg::Texture* will automatically work out how many levels are 
>> required
>>  based on the dimensions of the texture.
>>>   3)  Would changing the in

Re: [osg-users] Texture Questions

2012-08-27 Thread Cary, Karl A.
I have my code loading dds now, but the mapping is all screwed up as a result. 
All I did was change the extension on the filename from jpg to dds and left 
everything else alone.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Monday, August 27, 2012 7:55 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

I believe osg dds plugin uses stored ones, if there any. At least there are 
some code that takes care of mipmaps in dds plugin.

27.08.2012, 14:32, "Cary, Karl A." :
> Will I need to do anything in osg to make sure it uses the pre-generated 
> mipmaps stored in the DDS file and not recreate new ones? Working on saving 
> the textures out as dds now.
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org 
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
> Sergey Polischuk
> Sent: Monday, August 27, 2012 2:23 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Texture Questions
>
> Hi
>
> You can use compressed textures in dds format, as they support dxtc texture 
> compression. You can create those with ati compressonator tool, nvidia 
> texture tools, or in photoshop using nvidia plugin. For rgb images you'll get 
> 6x compression ratio. Also, you can save textures in dds format with 
> pre-generated mipmaps, if you need those.
>
> Cheers.
>
> 24.08.2012, 21:13, "Cary, Karl A." :
>
>>  I do have the ability to pre-process. The question is, what file
>>  formats support openGL compression and how do I take them from jpeg 
>> to
>>  these formats? As for mipmapping, you mentioned that it can be done CPU 
>> side.
>>  How do I initiate this? Since the texture load is happening in a
>>  separate thread, I can afford CPU time to do this rather than 
>> pushing
>>  more on to the GPU. I can test out to see if it is worthwhile.
>>
>>  -Original Message-
>>  From: osg-users-boun...@lists.openscenegraph.org
>>  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
>>  Robert Osfield
>>  Sent: Friday, August 24, 2012 11:40 AM
>>  To: OpenSceneGraph Users
>>  Subject: Re: [osg-users] Texture Questions
>>
>>  Hi Karl,
>>
>>  On 24 August 2012 14:40, Cary, Karl A.  wrote:
>>>   I have an application that loads several 2048x2048 textures in a
>>>   separate thread before passing off to the main to be applied to 
>>> the
>>>   geometry. I am trying to do anything and everything I can to 
>>> improve
>>>   performance on them as the number of textures will increase from
>>>   several to quite a lot. So I am looking at every option I can and
>>>  have
>>>   run in to several questions that I was hoping to get some advice on.
>>>  I
>>>   am creating osg::Texture2D and loading them with an osg::Image 
>>> read
>>>  in
>>  from a jpg file.
>>
>>  Excatly how many textures are you talking about?
>>
>>  Will of the texture reside in memory and be rendered at the same time?
>>
>>  Do you have an flexibility w.r.t pre-processing the image data into
>>  other file formats?
>>
>>  What pixel format do the textures have?  RGB?
>>>   1)  Is mipmapping enabled by default? Or do I need to call
>>>   allocateMipmapLevels?
>>  By default the osg::Texture* will use trilinear mipmapping, if the
>>  osg::Image doesn't contain the mipmaps then it'll either generate 
>> them
>>  on demand in the rendering thread either done by the GL driver or 
>> GPU
>>  using OpenGL extensions for generating mipmaps, or on the CPU using
>>  GLU functions when the driver doesn't support the generate mipmap
>>  extensions.
>>
>>  You can switch the mipmapping off by just setting the
>>  texture->setFilter(Texture::MIN_FILTER, Texture::LINEAR);
>>>   2)  If it is enabled, how many levels are created by default?
>>  osg::Texture* will automatically work out how many levels are 
>> required
>>  based on the dimensions of the texture.
>>>   3)  Would changing the internal format mode to one of the
>>  compression
>>>   formats actually perform the compression or does that need to be
>>>  done
>>>   manually?
>>  If the source imagery is not in an OpenGL compressed format then the
>>  driver will do the compression for you, however this is an expensive
>>  operation so generally not one you'd during rendering, rather OpenGL
>>  compression is something 

Re: [osg-users] Texture Questions

2012-08-27 Thread Cary, Karl A.
Will I need to do anything in osg to make sure it uses the pre-generated 
mipmaps stored in the DDS file and not recreate new ones? Working on saving the 
textures out as dds now.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Monday, August 27, 2012 2:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

Hi

You can use compressed textures in dds format, as they support dxtc texture 
compression. You can create those with ati compressonator tool, nvidia texture 
tools, or in photoshop using nvidia plugin. For rgb images you'll get 6x 
compression ratio. Also, you can save textures in dds format with pre-generated 
mipmaps, if you need those.

Cheers.

24.08.2012, 21:13, "Cary, Karl A." :
> I do have the ability to pre-process. The question is, what file 
> formats support openGL compression and how do I take them from jpeg to 
> these formats? As for mipmapping, you mentioned that it can be done CPU side.
> How do I initiate this? Since the texture load is happening in a 
> separate thread, I can afford CPU time to do this rather than pushing 
> more on to the GPU. I can test out to see if it is worthwhile.
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
> Robert Osfield
> Sent: Friday, August 24, 2012 11:40 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Texture Questions
>
> Hi Karl,
>
> On 24 August 2012 14:40, Cary, Karl A.  wrote:
>
>>  I have an application that loads several 2048x2048 textures in a
>>  separate thread before passing off to the main to be applied to the
>>  geometry. I am trying to do anything and everything I can to improve
>>  performance on them as the number of textures will increase from
>>  several to quite a lot. So I am looking at every option I can and 
>> have
>>  run in to several questions that I was hoping to get some advice on. 
>> I
>>  am creating osg::Texture2D and loading them with an osg::Image read 
>> in
>
> from a jpg file.
>
> Excatly how many textures are you talking about?
>
> Will of the texture reside in memory and be rendered at the same time?
>
> Do you have an flexibility w.r.t pre-processing the image data into 
> other file formats?
>
> What pixel format do the textures have?  RGB?
>
>>  1)  Is mipmapping enabled by default? Or do I need to call
>>  allocateMipmapLevels?
>
> By default the osg::Texture* will use trilinear mipmapping, if the 
> osg::Image doesn't contain the mipmaps then it'll either generate them 
> on demand in the rendering thread either done by the GL driver or GPU 
> using OpenGL extensions for generating mipmaps, or on the CPU using 
> GLU functions when the driver doesn't support the generate mipmap 
> extensions.
>
> You can switch the mipmapping off by just setting the
> texture->setFilter(Texture::MIN_FILTER, Texture::LINEAR);
>
>>  2)  If it is enabled, how many levels are created by default?
>
> osg::Texture* will automatically work out how many levels are required 
> based on the dimensions of the texture.
>
>>  3)  Would changing the internal format mode to one of the
>
> compression
>
>>  formats actually perform the compression or does that need to be 
>> done
>>  manually?
>
> If the source imagery is not in an OpenGL compressed format then the 
> driver will do the compression for you, however this is an expensive 
> operation so generally not one you'd during rendering, rather OpenGL 
> compression is something you'd want to do in pre-processing step.
>
>>  4)  If I do need to do the compression, how can I do it without
>
> applying
>
>>  it to geometry in my separate thread? I have only seen it done via 
>> the
>>  CompressTexturesVisitor applied to a node (as in osgconv), would I
>>  have to make some empty node and apply the texture to it to do this?
>
> To compress in a background thread you can use the OSG's now support 
> for compressing textures using NVTT (there is plugin for this when you 
> compile the OSG when the NVTT SDK is available).  You'll need OSG-3.x 
> for this.
>
>>  5)  Is there any way to send a texture down to the graphics card
>
> prior
>
>>  to applying it to geometry?
>
> You can pre-compile objects using the IncrementalCompileOperator, 
> however, this is still done as part of the rendering thread so 
> depending upon your requirements might not make a difference.
>
>>  6)  Any other efficiency things 

Re: [osg-users] Texture Questions

2012-08-24 Thread Cary, Karl A.
I do have the ability to pre-process. The question is, what file formats
support openGL compression and how do I take them from jpeg to these
formats? As for mipmapping, you mentioned that it can be done CPU side.
How do I initiate this? Since the texture load is happening in a
separate thread, I can afford CPU time to do this rather than pushing
more on to the GPU. I can test out to see if it is worthwhile.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, August 24, 2012 11:40 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Questions

Hi Karl,

On 24 August 2012 14:40, Cary, Karl A.  wrote:
> I have an application that loads several 2048x2048 textures in a 
> separate thread before passing off to the main to be applied to the 
> geometry. I am trying to do anything and everything I can to improve 
> performance on them as the number of textures will increase from 
> several to quite a lot. So I am looking at every option I can and have

> run in to several questions that I was hoping to get some advice on. I

> am creating osg::Texture2D and loading them with an osg::Image read in
from a jpg file.

Excatly how many textures are you talking about?

Will of the texture reside in memory and be rendered at the same time?

Do you have an flexibility w.r.t pre-processing the image data into
other file formats?

What pixel format do the textures have?  RGB?

> 1)  Is mipmapping enabled by default? Or do I need to call
> allocateMipmapLevels?

By default the osg::Texture* will use trilinear mipmapping, if the
osg::Image doesn't contain the mipmaps then it'll either generate them
on demand in the rendering thread either done by the GL driver or GPU
using OpenGL extensions for generating mipmaps, or on the CPU using GLU
functions when the driver doesn't support the generate mipmap
extensions.

You can switch the mipmapping off by just setting the
texture->setFilter(Texture::MIN_FILTER, Texture::LINEAR);

> 2)  If it is enabled, how many levels are created by default?

osg::Texture* will automatically work out how many levels are required
based on the dimensions of the texture.

> 3)  Would changing the internal format mode to one of the
compression
> formats actually perform the compression or does that need to be done 
> manually?

If the source imagery is not in an OpenGL compressed format then the
driver will do the compression for you, however this is an expensive
operation so generally not one you'd during rendering, rather OpenGL
compression is something you'd want to do in pre-processing step.

>
> 4)  If I do need to do the compression, how can I do it without
applying
> it to geometry in my separate thread? I have only seen it done via the

> CompressTexturesVisitor applied to a node (as in osgconv), would I 
> have to make some empty node and apply the texture to it to do this?

To compress in a background thread you can use the OSG's now support for
compressing textures using NVTT (there is plugin for this when you
compile the OSG when the NVTT SDK is available).  You'll need OSG-3.x
for this.

> 5)  Is there any way to send a texture down to the graphics card
prior
> to applying it to geometry?

You can pre-compile objects using the IncrementalCompileOperator,
however, this is still done as part of the rendering thread so depending
upon your requirements might not make a difference.

> 6)  Any other efficiency things I should be looking at?

Pre-processing data so that it's pre-mipmapped and using OpenGL
compressed texture is the best way if you want to maximize performance
throughput of textures as this reduces how much work the CPU and GPU
need to do to download and use the data.  OpenGL compression is less
aggressive than compression supported by conventional image formats so
the files on disk will be bigger.

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


[osg-users] Texture Questions

2012-08-24 Thread Cary, Karl A.
I have an application that loads several 2048x2048 textures in a
separate thread before passing off to the main to be applied to the
geometry. I am trying to do anything and everything I can to improve
performance on them as the number of textures will increase from several
to quite a lot. So I am looking at every option I can and have run in to
several questions that I was hoping to get some advice on. I am creating
osg::Texture2D and loading them with an osg::Image read in from a jpg
file.

 

1)  Is mipmapping enabled by default? Or do I need to call
allocateMipmapLevels?

2)  If it is enabled, how many levels are created by default?

3)  Would changing the internal format mode to one of the
compression formats actually perform the compression or does that need
to be done manually?

4)  If I do need to do the compression, how can I do it without
applying it to geometry in my separate thread? I have only seen it done
via the CompressTexturesVisitor applied to a node (as in osgconv), would
I have to make some empty node and apply the texture to it to do this?

5)  Is there any way to send a texture down to the graphics card
prior to applying it to geometry?

6)  Any other efficiency things I should be looking at?

 

Karl Cary

SAIC

Software Developer

301-227-5656

 

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


Re: [osg-users] How to prevent resize of viewer window (WindowsandLinux)

2012-02-28 Thread Cary, Karl A.
I would be very interested in this as well. I have been having this
issue for a long time. Our development systems all have one widescreen
monitor at 1920x1080 and then one SD monitor at 1280x1024. If we want to
run a 1280x1024 window on the widescreen as the left monitor, all is
fine. However if you want it to run on the 1280x1024 monitor and it is
the left most monitor, only 75% of the time it's fine. The other 25% go
between showing up on the wrong screen and running at 1280x1024 inside
of a 1920x1080 full screen window.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason
Daly
Sent: Friday, February 24, 2012 12:05 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] How to prevent resize of viewer window
(WindowsandLinux)

On 02/24/2012 04:13 AM, Robert Osfield wrote:
> You should be able to do the cross platform route, but if there is a 
> bug on the OSG side on one particular platform we as a community just 
> need to fix it.  I just have access to Linux, and have very little 
> Windows experience so can't help out with debugging the Windows side, 
> so have to rely on Windows dev to get things working perfectly under 
> Windows - this normally works out pretty well.
>
> To resolve the issue the best route would be to create a small example

> that illustrates the problem so that others can reproduce, confirm the

> problem and then work to fix it.  Modifying an existing osg example 
> would probably be a good place to start.

I found a little program I can test with.  It looks like the MWM
property for resizing is being set correctly, just the window manager
(Metacity, in my case) is ignoring it.  I'm putting together a
submission that uses the ICCCM hints instead.

--"J"

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


[osg-users] Not Loading External References

2012-02-28 Thread Cary, Karl A.
I am using osgDB::readNodeFile to load in some .flt files. What I am
wondering is if there is some type of option that can have it not load
the external references in the files. Right now I just send a
NodeVisitor through to round up a list of all the ProxyNodes and then I
run through that list and remove them from their parents. While this
works, it is not ideal as I have to go through and actually load in of
the references. I do not need the references themselves. Unfortunately
editing the actual .flt files is not an option. If this is the best
solution, so be it.  Thanks.

 

Karl

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


Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

2011-09-02 Thread Cary, Karl A.
It points to what I expect. The system it is to go on can either be
CentOS 5.4 or 5.6. So we tried 5.4 and the same issue. Did a fresh
install of 5.5 and it works. I am truly boggled. I tried converting the
tiffs into jpegs just to see if I could use that info. Well it didn't
fail, but it didn't read anything in either, my Image was NULL.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason
Daly
Sent: Friday, September 02, 2011 6:08 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

On 09/02/2011 04:30 PM, Cary, Karl A. wrote:
> I just confirmed that it happens with all tiffs, not just geotiffs. I
created something in gimp and used that. Worked in 5.5, not in 5.6. I
honestly have no idea what to do other than to roll my own custom tiff
loader, which I don't have time to do as it has to be done today.

What do you see if you run ldd on osgdb_tiff.so?  Does it point to the 
libraries that you expect?

 From your description, I doubt this will be the issue, but it's all I 
can think of at the moment.

--"J"

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


Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

2011-09-02 Thread Cary, Karl A.
I just confirmed that it happens with all tiffs, not just geotiffs. I created 
something in gimp and used that. Worked in 5.5, not in 5.6. I honestly have no 
idea what to do other than to roll my own custom tiff loader, which I don't 
have time to do as it has to be done today.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Friday, September 02, 2011 1:45 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

More specifically I am seeing "TIFF loader: error opening file", sorry I did 
not see that part before. Then it says "Warning: could not find plugin to read 
objects from ..." The file is the same on both systems, it is actually a 
geotiff file. I am able to use various libtiff utilities such as tiff2rgba etc 
just fine.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jeremy Moles
Sent: Friday, September 02, 2011 1:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

On Fri, 2011-09-02 at 13:17 -0400, Cary, Karl A. wrote:
> I developed something that uses tiffs as textures and developed it in
> CentoS 5.5 and everything works just fine. The installation of OSG on
> the system was actually built on a CentOS 5.6 machine and then rpm’d
> and installed on the 5.5 system. When I try to run the code on 5.6, I
> get that it cannot load the tiff plugin. We are able to use other
> plugins just fine though. Does anyone have any idea where to begin
> looking? I am extremely rushed as this has to be working today and I
> head out tonight for a week long vacation.

You're probably just missing the libtiff RPM on the new machine, or some
similar library.

Run your program like:

OSG_NOTIFY_LEVEL=DEBUG ./my_binary

...and see if you can track it down.

> ___
> 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
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

2011-09-02 Thread Cary, Karl A.
More specifically I am seeing "TIFF loader: error opening file", sorry I did 
not see that part before. Then it says "Warning: could not find plugin to read 
objects from ..." The file is the same on both systems, it is actually a 
geotiff file. I am able to use various libtiff utilities such as tiff2rgba etc 
just fine.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jeremy Moles
Sent: Friday, September 02, 2011 1:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

On Fri, 2011-09-02 at 13:17 -0400, Cary, Karl A. wrote:
> I developed something that uses tiffs as textures and developed it in
> CentoS 5.5 and everything works just fine. The installation of OSG on
> the system was actually built on a CentOS 5.6 machine and then rpm’d
> and installed on the 5.5 system. When I try to run the code on 5.6, I
> get that it cannot load the tiff plugin. We are able to use other
> plugins just fine though. Does anyone have any idea where to begin
> looking? I am extremely rushed as this has to be working today and I
> head out tonight for a week long vacation.

You're probably just missing the libtiff RPM on the new machine, or some
similar library.

Run your program like:

OSG_NOTIFY_LEVEL=DEBUG ./my_binary

...and see if you can track it down.

> ___
> 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] Unable to load osgdb_tiff plugin on CentOS 5.6

2011-09-02 Thread Cary, Karl A.
I will try the notify level. The libtiff rpm is installed. The version is the 
same, but the revision is different, for el5_6.7 instead of el5_5.5. The system 
the osg rpm was made on used the el5_6.7 as well. I actually also tried it on a 
5.5 system that worked and then did a yum update on it to get to 5.6 and it now 
no longer works either. Something in using the new libtiff causes the problem.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jeremy Moles
Sent: Friday, September 02, 2011 1:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

On Fri, 2011-09-02 at 13:17 -0400, Cary, Karl A. wrote:
> I developed something that uses tiffs as textures and developed it in
> CentoS 5.5 and everything works just fine. The installation of OSG on
> the system was actually built on a CentOS 5.6 machine and then rpm’d
> and installed on the 5.5 system. When I try to run the code on 5.6, I
> get that it cannot load the tiff plugin. We are able to use other
> plugins just fine though. Does anyone have any idea where to begin
> looking? I am extremely rushed as this has to be working today and I
> head out tonight for a week long vacation.

You're probably just missing the libtiff RPM on the new machine, or some
similar library.

Run your program like:

OSG_NOTIFY_LEVEL=DEBUG ./my_binary

...and see if you can track it down.

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


[osg-users] Unable to load osgdb_tiff plugin on CentOS 5.6

2011-09-02 Thread Cary, Karl A.
I developed something that uses tiffs as textures and developed it in
CentoS 5.5 and everything works just fine. The installation of OSG on
the system was actually built on a CentOS 5.6 machine and then rpm'd and
installed on the 5.5 system. When I try to run the code on 5.6, I get
that it cannot load the tiff plugin. We are able to use other plugins
just fine though. Does anyone have any idea where to begin looking? I am
extremely rushed as this has to be working today and I head out tonight
for a week long vacation.

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


Re: [osg-users] Loading different texture in child drawable thaninparent geode

2011-08-06 Thread Cary, Karl A.
I apologize to all, like I said last night, I was bleary eyed. I had my texture 
load and shader initialization in 2 calls in the constructor of the Drawable, 
setupTexture() and initShader(). I was calling them in the wrong order. Thank 
you to anyone who looked at it.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Saturday, August 06, 2011 11:35 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable 
thaninparent geode

I went a step further and added a second texture to the geode in texture unit 
1. I now have a blue texture in unit 0 and a green texture in unit 1. If I add 
a uniform texSampler = new osg::Uniform("texture", 1) to the Drawable, then it 
changes the texture unit being used to 1 and now the green texture is used. So 
the state is being read in correctly. It just appears as if the texture itself 
never gets loaded into the texture unit. I also tried not loading a texture at 
all in the Geode and then I just get all black.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Saturday, August 06, 2011 11:22 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable than 
inparent geode

I added that as well and it did nothing. I tried adding another uniform that I 
set to 0 in the geode in 1 in the drawable. The drawable is overriding the 
value. So it appears to be just an issue with the texture actually loading into 
the texture unit.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein
Sent: Saturday, August 06, 2011 7:56 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable than in 
parent geode

Hi Karl,

On 6/08/11 3:53 , Cary, Karl A. wrote:
> I have a geode that loads a shader. It loads up a texture that is meant to be 
> a default
> texture. That geode then has many children drawables under it. The plan is 
> that each child
> will have a different texture associated with it, but will otherwise be using 
> the same
> shader and StateSet as the parent geode. If the child does not have a texture 
> associated
> with it, it should use the one from the parent geode. If I put the shader in 
> the geode,
> all geometry is drawn correctly. But if I try to load a different texture in 
> the child
> drawable, the geode’s texture is used instead. Please help me figure out what 
> I am
> missing. I’m starting to go bleary eyed!
> 
> Here is the code that sets up the texture and shader in the geode (and this 
> works, the
> texture loaded here shows up):
> 
> stateSet = new osg::StateSet
> texSampler = new osg::Uniform(“texture”, 0);
> stateSet->addUniform(texSampler);
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
> 
>...
> stateSet->setAttribute(program);
> stateSet->setAttributesAndModes(program.get(), osg::StateAttribute::ON);
> this->setStateSet(stateSet);
> 
> I then attempt to load a different texture in the drawable that is attached 
> to the above
> geode. Here is the code I am attempting to use:
> 
> stateSet = new osg::StateSet;
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON |
> osg::StateAttribute::PROTECTED);
> 
> this->setStateSet(stateSet);

From the code and your description I would expect this to work as well.

Did you try to duplicate the Uniform in the Drawable StateSet?  Maybe this 
makes a difference?

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
___
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] Loading different texture in child drawable than inparent geode

2011-08-06 Thread Cary, Karl A.
I went a step further and added a second texture to the geode in texture unit 
1. I now have a blue texture in unit 0 and a green texture in unit 1. If I add 
a uniform texSampler = new osg::Uniform("texture", 1) to the Drawable, then it 
changes the texture unit being used to 1 and now the green texture is used. So 
the state is being read in correctly. It just appears as if the texture itself 
never gets loaded into the texture unit. I also tried not loading a texture at 
all in the Geode and then I just get all black.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary, Karl A.
Sent: Saturday, August 06, 2011 11:22 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable than 
inparent geode

I added that as well and it did nothing. I tried adding another uniform that I 
set to 0 in the geode in 1 in the drawable. The drawable is overriding the 
value. So it appears to be just an issue with the texture actually loading into 
the texture unit.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein
Sent: Saturday, August 06, 2011 7:56 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable than in 
parent geode

Hi Karl,

On 6/08/11 3:53 , Cary, Karl A. wrote:
> I have a geode that loads a shader. It loads up a texture that is meant to be 
> a default
> texture. That geode then has many children drawables under it. The plan is 
> that each child
> will have a different texture associated with it, but will otherwise be using 
> the same
> shader and StateSet as the parent geode. If the child does not have a texture 
> associated
> with it, it should use the one from the parent geode. If I put the shader in 
> the geode,
> all geometry is drawn correctly. But if I try to load a different texture in 
> the child
> drawable, the geode’s texture is used instead. Please help me figure out what 
> I am
> missing. I’m starting to go bleary eyed!
> 
> Here is the code that sets up the texture and shader in the geode (and this 
> works, the
> texture loaded here shows up):
> 
> stateSet = new osg::StateSet
> texSampler = new osg::Uniform(“texture”, 0);
> stateSet->addUniform(texSampler);
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
> 
>...
> stateSet->setAttribute(program);
> stateSet->setAttributesAndModes(program.get(), osg::StateAttribute::ON);
> this->setStateSet(stateSet);
> 
> I then attempt to load a different texture in the drawable that is attached 
> to the above
> geode. Here is the code I am attempting to use:
> 
> stateSet = new osg::StateSet;
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON |
> osg::StateAttribute::PROTECTED);
> 
> this->setStateSet(stateSet);

From the code and your description I would expect this to work as well.

Did you try to duplicate the Uniform in the Drawable StateSet?  Maybe this 
makes a difference?

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
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Loading different texture in child drawable than in parent geode

2011-08-06 Thread Cary, Karl A.
I added that as well and it did nothing. I tried adding another uniform that I 
set to 0 in the geode in 1 in the drawable. The drawable is overriding the 
value. So it appears to be just an issue with the texture actually loading into 
the texture unit.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein
Sent: Saturday, August 06, 2011 7:56 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Loading different texture in child drawable than in 
parent geode

Hi Karl,

On 6/08/11 3:53 , Cary, Karl A. wrote:
> I have a geode that loads a shader. It loads up a texture that is meant to be 
> a default
> texture. That geode then has many children drawables under it. The plan is 
> that each child
> will have a different texture associated with it, but will otherwise be using 
> the same
> shader and StateSet as the parent geode. If the child does not have a texture 
> associated
> with it, it should use the one from the parent geode. If I put the shader in 
> the geode,
> all geometry is drawn correctly. But if I try to load a different texture in 
> the child
> drawable, the geode’s texture is used instead. Please help me figure out what 
> I am
> missing. I’m starting to go bleary eyed!
> 
> Here is the code that sets up the texture and shader in the geode (and this 
> works, the
> texture loaded here shows up):
> 
> stateSet = new osg::StateSet
> texSampler = new osg::Uniform(“texture”, 0);
> stateSet->addUniform(texSampler);
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
> 
>...
> stateSet->setAttribute(program);
> stateSet->setAttributesAndModes(program.get(), osg::StateAttribute::ON);
> this->setStateSet(stateSet);
> 
> I then attempt to load a different texture in the drawable that is attached 
> to the above
> geode. Here is the code I am attempting to use:
> 
> stateSet = new osg::StateSet;
> stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON |
> osg::StateAttribute::PROTECTED);
> 
> this->setStateSet(stateSet);

From the code and your description I would expect this to work as well.

Did you try to duplicate the Uniform in the Drawable StateSet?  Maybe this 
makes a difference?

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


[osg-users] Loading different texture in child drawable than in parent geode

2011-08-05 Thread Cary, Karl A.
I have a geode that loads a shader. It loads up a texture that is meant
to be a default texture. That geode then has many children drawables
under it. The plan is that each child will have a different texture
associated with it, but will otherwise be using the same shader and
StateSet as the parent geode. If the child does not have a texture
associated with it, it should use the one from the parent geode. If I
put the shader in the geode, all geometry is drawn correctly. But if I
try to load a different texture in the child drawable, the geode's
texture is used instead. Please help me figure out what I am missing.
I'm starting to go bleary eyed!

 

Here is the code that sets up the texture and shader in the geode (and
this works, the texture loaded here shows up):

 

stateSet = new osg::StateSet

texSampler = new osg::Uniform("texture", 0);

stateSet->addUniform(texSampler);

stateSet->setTextureAttributeAndModes(0, texture,
osg::StateAttribute::ON);

 

osg::ref_ptr program = new osg::Program;

 

osg::ref_ptr vertShader = new
osg::Shader(osg::Shader::VERTEX);

vertShader->loadShaderSourceFromFile("shaders/testVert.glsl");

program->addShader(vertShader);

osg::ref_ptr fragShader = new
osg::Shader(osg::Shader::FRAGMENT);

fragShader->loadShaderSourceFromFile("shaders/testFrag.glsl");

program->addShader(fragShader);

 

stateSet->setAttribute(program);

stateSet->setAttributesAndModes(program.get(), osg::StateAttribute::ON);

 

this->setStateSet(stateSet);

 

I then attempt to load a different texture in the drawable that is
attached to the above geode. Here is the code I am attempting to use:

 

stateSet = new osg::StateSet;

stateSet->setTextureAttributeAndModes(0, texture,
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED);

this->setStateSet(stateSet);

 

I am obviously missing something. I tried switching which texture was on
the geode and the drawable just to make sure it wasn't a problem with
the texture itself. There was no issue in switching it.

 

Thank you  for looking at this.

 

Karl

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


[osg-users] Reading in geotiff for Texture

2011-08-02 Thread Cary, Karl A.
I need to be able to read in a geotiff and use it as an osg::Texture. I
made sure I had libgdal built and installed and then rebuilt OSG against
it. I am then making a call to osgDB::readImageFile(pathToGeotiff). But
it always returns NULL. What am I missing here? Shouldn't I be able to
do this?

 

Karl

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


[osg-users] Getting Uniform Value in drawImplementation

2011-03-09 Thread Cary, Karl A.
I am trying to debug an application where apparently a common uniform
value passed to 2 shaders is ending up differently. In order to both
confirm my suspicions and figure out where to go next, I thought I would
check to see what value the uniform is set to during the actual
drawImplementation of each object. I know you can use getUniformLocation
on the state you can extract from the RenderInfo, but I haven't figured
out how to actually get at the value itself. From what I can see in the
osg::State object is that there is a UniformStack, but I haven't been
able to find any info about what is actually in it. If anyone has any
ideas, it would be much appreciated. Thank you.

 

Karl

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


Re: [osg-users] Screen Resolution Being Overriden in Twinview

2011-01-21 Thread Cary, Karl A.
Ok this has created a new problem. If I give focus to something other
than my application, I cannot gain focus again. And I notice that there
is no associated window via Alt+Tab or toolbar.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cary,
Karl A.
Sent: Friday, January 21, 2011 7:07 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Screen Resolution Being Overriden in Twinview

Thank you, thank you, thank you. That worked perfectly.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, January 21, 2011 3:58 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Screen Resolution Being Overriden in Twinview

Hi Karl,

The issue you are seeing is mostly like the window manager redirecting
the request for a full sized window to produce a window that fits one
screen.  To tell X11 to override the window manage redirect you'll
need to set the Traits::overrideRedirect flag to true.

Robert.

On Thu, Jan 20, 2011 at 10:08 PM, Cary, Karl A. 
wrote:
> I am having an issue with screen resolution in Twinview. If I am in
clone
> mode or non twinview, everything is fine. But when I am in twinview
> otherwise, the screen resolution changes even though I am not telling
it to.
> It is essentially adding an invisible window decoration as that is the
size
> it is changing by.
>
>
>
> My setup: I have 2 monitors, one is 1280x1024, the other is 1920x1200.
I
> would like my application to show up on the 1280x1024 monitor and it
does,
> just not at 1280x1024. When I create my graphics context, I do the
> following:
>
>
>
> osg::ref_ptr traits = new
> osg::GraphicsContext::Traits;
>
> traits->x = 0;
>
> traits->y = 0;
>
> traits->width = 1280;
>
> traits->height = 1024;
>
> traits->windowDecoration = false;
>
> traits->windowName = "myApp";
>
> traits->doubleBuffer = true;
>
> traits->sharedContext = 0;
>
>
>
> osg::DisplaySettings* ds = osg::DisplaySettings::instance();
>
> traits->sampleBuffers = ds->getMultiSamples;
>
> traits->samples = ds->getNumMultiSamples();
>
>
>
> osg::ref_ptr gc =
> osg::GraphicsContext::createGraphicsContext(traits.get());
>
>
>
> At this point if I pause my program, the resolution is already wrong.
It is
> starting at 0,0, but it is missing the far right and bottom, about the
size
> of the window decoration border. If I then go through and get the
window out
> of the osgViewer and do a window->setWindowRectangle(0,0,1280,1024),
the
> screen goes full screen again. However any time I do anything at all
to the
> viewer or wsi or window, or sets back to the other size. For example
if I do
> a window->useCursor(true) call it resets.
>
>
>
> What am I doing wrong? I know it is not a driver issue as this was
formerly
> a Performer app and it works just fine in there with the same system
so it
> has to either be an issue in OSG (I doubt) or an error in how I am
setting
> up the window. Thank you.
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Screen Resolution Being Overriden in Twinview

2011-01-21 Thread Cary, Karl A.
Thank you, thank you, thank you. That worked perfectly.

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, January 21, 2011 3:58 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Screen Resolution Being Overriden in Twinview

Hi Karl,

The issue you are seeing is mostly like the window manager redirecting
the request for a full sized window to produce a window that fits one
screen.  To tell X11 to override the window manage redirect you'll
need to set the Traits::overrideRedirect flag to true.

Robert.

On Thu, Jan 20, 2011 at 10:08 PM, Cary, Karl A. 
wrote:
> I am having an issue with screen resolution in Twinview. If I am in
clone
> mode or non twinview, everything is fine. But when I am in twinview
> otherwise, the screen resolution changes even though I am not telling
it to.
> It is essentially adding an invisible window decoration as that is the
size
> it is changing by.
>
>
>
> My setup: I have 2 monitors, one is 1280x1024, the other is 1920x1200.
I
> would like my application to show up on the 1280x1024 monitor and it
does,
> just not at 1280x1024. When I create my graphics context, I do the
> following:
>
>
>
> osg::ref_ptr traits = new
> osg::GraphicsContext::Traits;
>
> traits->x = 0;
>
> traits->y = 0;
>
> traits->width = 1280;
>
> traits->height = 1024;
>
> traits->windowDecoration = false;
>
> traits->windowName = "myApp";
>
> traits->doubleBuffer = true;
>
> traits->sharedContext = 0;
>
>
>
> osg::DisplaySettings* ds = osg::DisplaySettings::instance();
>
> traits->sampleBuffers = ds->getMultiSamples;
>
> traits->samples = ds->getNumMultiSamples();
>
>
>
> osg::ref_ptr gc =
> osg::GraphicsContext::createGraphicsContext(traits.get());
>
>
>
> At this point if I pause my program, the resolution is already wrong.
It is
> starting at 0,0, but it is missing the far right and bottom, about the
size
> of the window decoration border. If I then go through and get the
window out
> of the osgViewer and do a window->setWindowRectangle(0,0,1280,1024),
the
> screen goes full screen again. However any time I do anything at all
to the
> viewer or wsi or window, or sets back to the other size. For example
if I do
> a window->useCursor(true) call it resets.
>
>
>
> What am I doing wrong? I know it is not a driver issue as this was
formerly
> a Performer app and it works just fine in there with the same system
so it
> has to either be an issue in OSG (I doubt) or an error in how I am
setting
> up the window. Thank you.
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Screen Resolution Being Overriden in Twinview

2011-01-20 Thread Cary, Karl A.
I am having an issue with screen resolution in Twinview. If I am in
clone mode or non twinview, everything is fine. But when I am in
twinview otherwise, the screen resolution changes even though I am not
telling it to. It is essentially adding an invisible window decoration
as that is the size it is changing by.

 

My setup: I have 2 monitors, one is 1280x1024, the other is 1920x1200. I
would like my application to show up on the 1280x1024 monitor and it
does, just not at 1280x1024. When I create my graphics context, I do the
following:

 

osg::ref_ptr traits = new
osg::GraphicsContext::Traits;

traits->x = 0;

traits->y = 0;

traits->width = 1280;

traits->height = 1024;

traits->windowDecoration = false;

traits->windowName = "myApp";

traits->doubleBuffer = true;

traits->sharedContext = 0;

 

osg::DisplaySettings* ds = osg::DisplaySettings::instance();

traits->sampleBuffers = ds->getMultiSamples;

traits->samples = ds->getNumMultiSamples();

 

osg::ref_ptr gc =
osg::GraphicsContext::createGraphicsContext(traits.get());

 

At this point if I pause my program, the resolution is already wrong. It
is starting at 0,0, but it is missing the far right and bottom, about
the size of the window decoration border. If I then go through and get
the window out of the osgViewer and do a
window->setWindowRectangle(0,0,1280,1024), the screen goes full screen
again. However any time I do anything at all to the viewer or wsi or
window, or sets back to the other size. For example if I do a
window->useCursor(true) call it resets.

 

What am I doing wrong? I know it is not a driver issue as this was
formerly a Performer app and it works just fine in there with the same
system so it has to either be an issue in OSG (I doubt) or an error in
how I am setting up the window. Thank you.

 

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