Re: [osg-users] [vpb] VPB build error?

2011-01-27 Thread Robert Osfield
Hi Shayne,

I vaguely VPB having inbuilt support for keeping a lid on the number
of open file handles.  I don't recall the specifics though, it's a
couple of years since I wrote this part of VPB, perhaps we need to
update the mechanism to query how many open files are supported and
adjust it so it's osgdem task has a portion of this total so that when
multiple osgdem's run they don't end up eating up all the file handles
between them.

Robert.

On Thu, Jan 27, 2011 at 12:24 AM, Shayne Tueller
shayne.tuel...@hill.af.mil wrote:
 Just a follow up to my previous post, I found the problem...and it has 
 nothing to do with VPB so I apologize for the alarm.

 On Linux (in my case Fedora core 13), the number of files a process can have 
 open is default to 1024. You can query this info by the command:

 ulimit -n

 To increase the number of files (by 4000 for example), you can do:

 ulimit -n 4000

 Once I did this, vpbmaster was able to process all 3600 tif files in my 
 /imagery directory where they are stored.

 Hopefully this will be of benefit to anyone else who may run into this 
 problem when trying to build a VPB database from a large number of source 
 content files...

 -Shayne

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





 ___
 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] Can I do somthing between two render passes?

2011-01-27 Thread Martin Großer
Hello,

Is it possible to do something between two render passes? I render an image 
into a texture and then I would like execute functions and after this I wanna 
render the final image on the screen.

I use the osg::Camera with PRE_RENDER and the FRAME_BUFFER_OBJECT. And this 
camera is in my scenegraph. What can I do if I want to work on the texture 
after the first render step?

Cheers

Martin
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG 2.9.10 on iOS

2011-01-27 Thread Stephan Maximilian Huber
Am 26.01.11 23:41, schrieb Alessandro Terenzi:
 I finally managed to build for iOS starting from the OSGIPhone xcode project 
 available from the git repository. I wanted to also use the IVE plugin but I 
 couldn't manage to build any app using it. 
 
 As far as I understand I have to modify osgPlugins.h in order to execute:
 
 
 Code:
 USE_OSGPLUGIN(ive)

I updated the xcode-project on the git-repository, it should resolve
your issue with the ive-plugin.

 One more note/question: in osgPlugins.h I see lots of instructions like the 
 following 
 
 
 Code:
 USE_DOTOSGWRAPPER(AlphaFunc)
 ...

these are only necessary for the osg-plugin, as the plugin is extendable
via dynamic-linking. All other plugins do not need this.

One question: why are you donÄt use the xcode-projects build by cmake
for IOS? Did you have any problems?

I do not update the git-repository that often, as all changes we made
for IOS are now part of the official osg-source.

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


[osg-users] How to get the contents of a QPixmap into an OSG texture?

2011-01-27 Thread Christian Buchner
Hi,

here's a very special case of Qt integration for OpenSceneGraph for
which I am searching for a solution: We're using Qt to draw into a
QPixmap (updating a map of measured radio conditions during a
simulation in realtime). We optionally support a 3D display, which is
typically a line by line polarized display. Simply opening a Qt window
displaying the pixmap produces bad artifacting. When we open a window
on the 3D display (on top of the OSG rendered output), it gets torn
because every second line is visible only to each eye.

So the only chance to display it right, would be to render the map as
a HUD in OpenScenegraph so it gets rendered through the stencil buffer
so it shows up nicely for both eyes. Now here's the question:

How to transfer the contents of the QPixmap into a texture for
OpenSceneGraph efficiently? A lot of texture updates using the CPU
would likely slow down the entire application - if possible we would
like to avoid slow updates and take a faster route. But which one
could that be?

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


Re: [osg-users] Can I do somthing between two render passes?

2011-01-27 Thread Robert Osfield
Hi Martin,

All you need to do is attach a post draw callback to the pre rendering camera.

Robert.

2011/1/27 Martin Großer grosser.mar...@gmx.de:
 Hello,

 Is it possible to do something between two render passes? I render an image 
 into a texture and then I would like execute functions and after this I wanna 
 render the final image on the screen.

 I use the osg::Camera with PRE_RENDER and the FRAME_BUFFER_OBJECT. And this 
 camera is in my scenegraph. What can I do if I want to work on the texture 
 after the first render step?

 Cheers

 Martin
 --
 Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
 belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
 ___
 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] Problems with osg:: sharedObjects

2011-01-27 Thread Werner Modenbach

Ah ...
It's so obvious! Decades of programming is no guarantee for error free 
code.


Thanks!!!

On Wed, 26 Jan 2011 13:39:55 -0500, Jean-Sébastien Guay wrote:

Hello Werner, D.J.,


I would recommend that you either: 1)
use ref_ptr as your return type, or 2) wait to use ref_ptr outside 
of

createObject.


Or return obj1.release() instead of obj1.get().

This tells the ref_ptr to decrease its ref count, but not delete the
object if it gets to 0 (contrary to get()). Which is what will happen
in your case (check with a debugger).

Incidentally, using a debugger would also have told you why it
crashes... checking the pointer after the call to your function would
have shown you that it had been deleted.

J-S


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


Re: [osg-users] OSG 2.9.10 on iOS

2011-01-27 Thread Alessandro Terenzi
Thank you Stephan,

One question: why are you donÄt use the xcode-projects build by cmake
 for IOS? Did you have any problems?



Yes, I made a quick try with it, but the project that has been generated
seems to miss the viewer  targeted for iOS, maybe I missed some settings in
CMake?

Anyway, I'm just going to start from scratch and let you know (by the way,
I'm referring to the instructions contained at the end of the README.txt
file in the OSG's sources directory, I mean the notes by Thomas Hoghart, are
them up to date?).

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


Re: [osg-users] OSG 2.9.10 on iOS

2011-01-27 Thread Alessandro Terenzi
I tried again with the latest OSG source from svn but I still have problems.
I followed the instructions in the README.txt and also:

 1) removed  -mmacosx-version-min=10.5 from CMAKE_CXX_FLAGS
 2) tried with either OSG_GLES1_AVAILABLE or OSG_GLES2_AVAILABLE
 3) tried with either OSG_GL_DISPLAYLISTS_AVAILABLE on or off
 4) tried to set the base SDK as the 4.1
 5) set to use armv6;armv7 architectures because I want to build for the
device

but:

 a) after configuring, CMAKE complains with the OPENGLES_LIBRARY_NOTFOUND
message

 b) after generating the project, I still see that the base SDK is 3.2 (so I
manually change it to 4.1)

 c) if I build in Xcode, everything is fine with OpenThreads, but as soon as
I build osg, I get lots of errors regarding OpenGL

 d) moreover, beyond osgversion and present3D, no other applications'
targets are in the project

What am I missing?
Thanks.
Alessandro


On Thu, Jan 27, 2011 at 12:16 PM, Alessandro Terenzi a.tere...@gmail.comwrote:

 Thank you Stephan,

 One question: why are you donÄt use the xcode-projects build by cmake
 for IOS? Did you have any problems?



 Yes, I made a quick try with it, but the project that has been generated
 seems to miss the viewer  targeted for iOS, maybe I missed some settings in
 CMake?

 Anyway, I'm just going to start from scratch and let you know (by the way,
 I'm referring to the instructions contained at the end of the README.txt
 file in the OSG's sources directory, I mean the notes by Thomas Hoghart, are
 them up to date?).

 Thanks.
 Alessandro

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


Re: [osg-users] Weird text problem

2011-01-27 Thread Robert Osfield
Hi Serge,

Most peculiar artifact.  What happens when you run the osgtext and
osgtext3D examples?  Is freetype-dev installed and the OSG built
against it?

Robert.

On Thu, Jan 27, 2011 at 2:24 PM, Serge Lages serge.la...@gmail.com wrote:
 Hi all,
 I just made a fresh Ubuntu 10.10 install, with latest Nvidia drivers from
 their website, a checkout from OSG this morning and a full build (I've
 followed these instructions :
 (http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Debian-Dependencies),
 and when I open osgviewer with a model, the stats are not readable... I've
 attached a screenshot to show the problem.
 Any idea where it comes from ?
 Cheers,
 --
 Serge Lages
 http://www.tharsis-software.com

 ___
 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] Jitter problem - OSG Nvidia Physx

2011-01-27 Thread Arif Yetkin Sarı
Hi again
I got what you meant hybr. As i said, When my fps is the same with physx freq, 
it all works well. However,
The thing is my slowest fps is like 20 - 25 on simulation, so i cannot cap OSG 
to always work at that slow rates. 

So, i implemented an interpolation mechanism to get a generated frame for a 
requested timestamp. I thought, in this way:
whatever freq physics and OSG run at, OSG will get a correct frame with 
interpolation. But somehow, when
interpolation is active, it causes additional jittering! I think interpolation 
between frames takes more time
than i think, and delays the frame() call.

Additionally,

I implemented a test bed. In my test bed, i just read a physx log file, and 
created 
the same scene of our driving simulation with OSG. Then I updated the cars' pos 
and 
ori at each frame with regards to physx data. There is still jitter if fps 
changes. 
But, there is almost no jitter when both physx and osg works in perfectly 60Hz. 

In the test bed, before the rendering starts, each frame on the physx log is 
placed 
in a queue. *What i mean by frame: it is a snapshot of physics world (all 
entities) 
at every 16.6 ms (60Hz) timestamps. And since my osg works with 60 fps in my 
test bed, 
and since after every time viewer-frame() function is called OSG dequeued 
another 
frame and updated the entity matrices, there is no jittering. However if the 
fps drops 
somehow, there is a slow down in motions, it is completely comprehensable 
because it consumes a 
60Hz physics output in a slower Hz, when fps drops. 

In our simulation I implemented the same queue to store the incoming frames, 
and consume them 
when the frame() ends. My strategy is, if the queue is empty, i simply do not 
update the scene. 
If the queue is filled more than 4 frames, i delete some of the old frames and 
shrink the queue so that 
we dont get a delay. However, this poses some little teleportations due to 
frame drops when 
OSG cannot consume the data, as expected. Thus i cannot use this method either.

After your comments and my experiments, I think, there are two problems why i 
get lots 
of jitter in our simulation. First of all, simulation fps fluctuates more than 
the test bed, 
that is between 25 - 60. This converts the occasional slow down of car motion 
into a jitter. 
Second problem, sometimes our queue contains no frames and this means a freeze, 
on the contrary sometimes our queue is filled with too many frames, which means 
we teleport in time and dequeue some of them to prevent delay.

In summary only perfect smoothness i get during my experiments is: 
when the queue is filled with tooo many 60Hz generated frames beforehand and my 
test bed runs at 60 fps,
it consumes the already generated(read from file) physics frames at the correct 
time stamp. And everything is smooth.

Still, anything I assume may prove wrong, so I am waiting for your feedback 
guys.

By the way, is the way I update my scenegraph ok ? (after each frame(), i call 
matrixtransform-setmatrix(matrix) for all
entities.). These calls are out of the frame(), so i thought i would be safe. 
Do you suggest me to use nodeupdatecallbacks ?
Does it make any difference ?

Thanks.


http://www.youtube.com/watch?v=naX3hOkDx8w

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





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


Re: [osg-users] Weird text problem

2011-01-27 Thread Serge Lages
Hi Robert,

Thanks for your reply, I tried osgtext and osgtext3D and I figured that the
problem was related to fonts not found. I installed the fonts and now it
works without problem !

But it's still weird because I remember than last time I had this problem
(not having the fonts installed on the system), OSG managed to render the
fonts in a basic mode, and it was still readable, not like this time.

Cheers,

On Thu, Jan 27, 2011 at 3:43 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Serge,

 Most peculiar artifact.  What happens when you run the osgtext and
 osgtext3D examples?  Is freetype-dev installed and the OSG built
 against it?

 Robert.

 On Thu, Jan 27, 2011 at 2:24 PM, Serge Lages serge.la...@gmail.com
 wrote:
  Hi all,
  I just made a fresh Ubuntu 10.10 install, with latest Nvidia drivers from
  their website, a checkout from OSG this morning and a full build (I've
  followed these instructions :
  (
 http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Debian-Dependencies
 ),
  and when I open osgviewer with a model, the stats are not readable...
 I've
  attached a screenshot to show the problem.
  Any idea where it comes from ?
  Cheers,
  --
  Serge Lages
  http://www.tharsis-software.com
 
  ___
  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




-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Weird text problem

2011-01-27 Thread Robert Osfield
Hi Serge,

Good to hear that obtaining the fonts has fixed things.  In theory you
should have been able to fix up the fonts from OpenSceneGraph-Data,
and since you had cow.osg I assumed that you had everything you
needed.

Not having fonts available should make osgText fallback to the inbuilt
fixed sized fonts, these not nice to read but normally they are still
readable.  Perhaps the recent changes to osgText to unify the way that
glyphs are sized and positioned between Text and Text3D has led to
regression in handling the fallback font.

I'll see if I can recreate the problems at this end.

Robert.

On Thu, Jan 27, 2011 at 3:00 PM, Serge Lages serge.la...@gmail.com wrote:
 Hi Robert,
 Thanks for your reply, I tried osgtext and osgtext3D and I figured that the
 problem was related to fonts not found. I installed the fonts and now it
 works without problem !
 But it's still weird because I remember than last time I had this problem
 (not having the fonts installed on the system), OSG managed to render the
 fonts in a basic mode, and it was still readable, not like this time.
 Cheers,

 On Thu, Jan 27, 2011 at 3:43 PM, Robert Osfield robert.osfi...@gmail.com
 wrote:

 Hi Serge,

 Most peculiar artifact.  What happens when you run the osgtext and
 osgtext3D examples?  Is freetype-dev installed and the OSG built
 against it?

 Robert.

 On Thu, Jan 27, 2011 at 2:24 PM, Serge Lages serge.la...@gmail.com
 wrote:
  Hi all,
  I just made a fresh Ubuntu 10.10 install, with latest Nvidia drivers
  from
  their website, a checkout from OSG this morning and a full build (I've
  followed these instructions :
 
  (http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Debian-Dependencies),
  and when I open osgviewer with a model, the stats are not readable...
  I've
  attached a screenshot to show the problem.
  Any idea where it comes from ?
  Cheers,
  --
  Serge Lages
  http://www.tharsis-software.com
 
  ___
  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



 --
 Serge Lages
 http://www.tharsis-software.com

 ___
 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] Jitter problem - OSG Nvidia Physx

2011-01-27 Thread Sergey Polischuk
Hi,

To clarify my last message, my point is that you get correct frame with 
interpolation, but by the time frame rendered your simulation results outdated.
Follow this basic example:
we render scene where box moving with 10 m\s
1st frame: box in initial position, frame rendered in 0.1 sec
2nd frame: box traveled 1m (simulation time 0.1 sec from start), frame rendered 
in 0.05 sec
3rd frame: box traveled 0.5m more (simulation time 0.05 from last frame), frame 
rendered in 0.15 sec
etc...
Now think about how do we see results of this render on display:
there are delay of 0.05 sec between 1 and 2 frames as we see them, and box path 
is 1m, so as we see it on screen box speed seems to be 20m/s
there are delay of 0.15 sec between 2 and 3 frames as we see them, and box path 
is 0.5m, so as we see it on screen box speed seems to be 6.6m/s
Thats what i was talking about.
If you have one frame delayed for some time, that will look like box almost 
stopped and then jumped forward.
You dont actually need to cap framerate, you need smooth framerate, when frame 
time changes slowly then this problem almost unnoticable.


27.01.2011, 17:47, Arif Yetkin Sarı arifyet...@gmail.com:
 Hi again
 I got what you meant hybr. As i said, When my fps is the same with physx 
 freq, it all works well. However,
 The thing is my slowest fps is like 20 - 25 on simulation, so i cannot cap 
 OSG to always work at that slow rates.

 So, i implemented an interpolation mechanism to get a generated frame for a 
 requested timestamp. I thought, in this way:
 whatever freq physics and OSG run at, OSG will get a correct frame with 
 interpolation. But somehow, when
 interpolation is active, it causes additional jittering! I think 
 interpolation between frames takes more time
 than i think, and delays the frame() call.

 Additionally,

 I implemented a test bed. In my test bed, i just read a physx log file, and 
 created
 the same scene of our driving simulation with OSG. Then I updated the cars' 
 pos and
 ori at each frame with regards to physx data. There is still jitter if fps 
 changes.
 But, there is almost no jitter when both physx and osg works in perfectly 
 60Hz.

 In the test bed, before the rendering starts, each frame on the physx log is 
 placed
 in a queue. *What i mean by frame: it is a snapshot of physics world (all 
 entities)
 at every 16.6 ms (60Hz) timestamps. And since my osg works with 60 fps in my 
 test bed,
 and since after every time viewer-frame() function is called OSG dequeued 
 another
 frame and updated the entity matrices, there is no jittering. However if the 
 fps drops
 somehow, there is a slow down in motions, it is completely comprehensable 
 because it consumes a
 60Hz physics output in a slower Hz, when fps drops.

 In our simulation I implemented the same queue to store the incoming frames, 
 and consume them
 when the frame() ends. My strategy is, if the queue is empty, i simply do not 
 update the scene.
 If the queue is filled more than 4 frames, i delete some of the old frames 
 and shrink the queue so that
 we dont get a delay. However, this poses some little teleportations due to 
 frame drops when
 OSG cannot consume the data, as expected. Thus i cannot use this method 
 either.

 After your comments and my experiments, I think, there are two problems why i 
 get lots
 of jitter in our simulation. First of all, simulation fps fluctuates more 
 than the test bed,
 that is between 25 - 60. This converts the occasional slow down of car 
 motion into a jitter.
 Second problem, sometimes our queue contains no frames and this means a 
 freeze,
 on the contrary sometimes our queue is filled with too many frames, which 
 means
 we teleport in time and dequeue some of them to prevent delay.

 In summary only perfect smoothness i get during my experiments is:
 when the queue is filled with tooo many 60Hz generated frames beforehand and 
 my test bed runs at 60 fps,
 it consumes the already generated(read from file) physics frames at the 
 correct time stamp. And everything is smooth.

 Still, anything I assume may prove wrong, so I am waiting for your feedback 
 guys.

 By the way, is the way I update my scenegraph ok ? (after each frame(), i 
 call matrixtransform-setmatrix(matrix) for all
 entities.). These calls are out of the frame(), so i thought i would be safe. 
 Do you suggest me to use nodeupdatecallbacks ?
 Does it make any difference ?

 Thanks.

 
 http://www.youtube.com/watch?v=naX3hOkDx8w

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

 ___
 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] QT and fullscreen OSG

2011-01-27 Thread Chuck Shaw
Hi,

First, make sure that your popup windows have the mainwindow as their parent.

Second, this happens a lot when you do full screen applications.  One thing you 
may try is calling QWidget::raise() on your dialogs.  The raise slot brings the 
widget to the top and will visually be in front of any overlapping sibling 
widgets.

Thank you!

Cheers,
Chuck

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





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


Re: [osg-users] How to get the contents of a QPixmap into an OSG texture?

2011-01-27 Thread Chuck Shaw
Hi,

This is an example of how i convert QImage to osg::texture:

NOTE: (lt) is less than, for some reason the forum as eating everything after 
that symbol.


Code:

QImage i(/path/to/image.png);

QImage img = QGLWidget::convertToGLFormat(i);

unsigned char* data = new unsigned char[img.byteCount()];
for(int i=0; i(lt)img.byteCount(); i++)
{
data[i] = img.bits()[i];
}

osg::Image* sym = new osg::Image();
sym-setImage(img.width(), img.height(), 1, 4, GL_RGBA, GL_UNSIGNED_BYTE, data, 
osg::Image::USE_NEW_DELETE, 1);

osg::Texture2D* texture = new osg::Texture2D(sym);





Thank you!

Cheers,
Chuck

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





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


[osg-users] Calling OSX Dev's, Cocoa/Carbon support required for new osgGA feature

2011-01-27 Thread Robert Osfield
Hi OSX dev's,

This afternoon I merged a submission from Alexander Sinditskiy, that
addressed a limitation in osgGA::GUIEventAdapter where the getKey()
method would return only the modified variation of the keycode that
was pressed - so this would be Ctrl-C, 'C' or 'c', and if your you
didn't want to worry about the modified key status you'd have to
handle each of these cases in your event code.

The way that Alexander addressed this was to add a new UnmodifiedKey
property to GUIEventAdapter, with support added to the
osgGA::EventQueue as well as the X11 and Win32 implementations found
in GraphicsWindowX11.cpp and GraphicsWindowWin32.cpp.  Alexander and
his colleagues don't have access to OSX so couldn't add the required
support into GraphicsWindowCocoa/Carbon so for now you'll just get a 0
for the UnmofidiedKey.

Now this won't affect most apps as they won't yet be using the
UnmodifiedKey property, but osgkeyboard has now been modified to use
the UnmodifiedKey property as this illustrates it's usage and also
simplifies the example as it no longer needs to doing multiple
mappings to handle upper and lower case letters.  However, osgkeyboard
will now just get a 0 for UnmodifiedKey so the keys on screen won't
toggle on/off correctly.  At least this is what I'm expecting - I
don't have on OSX box in front of me so I can't test this.

Could OSX users try out OSG in svn/trunk and run osgkeyboard and see
how things behave and then have a look into the possibility of
providing the UmodifiedKey property as GraphicsWindowWin32.cpp and
GraphicsWindowX11.cpp now do.  The unmodified keys now map the 'A' and
'a' to be 'a', X11 is already uses this convention while Win32 have
'A' as the unmodified state, but Alexander's revision addresses this
so both produce an GUIEventAdapter::KEY_A which is mapped to 'a'.  OSX
will need to use the same convention.

Thanks in advance with any help you can provide in adding this
functionality to OSX.

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


Re: [osg-users] How to get the contents of a QPixmap into an OSG texture?

2011-01-27 Thread Robert Osfield
Hi Christian,

In svn/trunk version of the OSG (and 2.9.10) there is the osgQt
library, and osgQtBrowser and osgQtWidget examples that provide the
ability to take the contents of Qt widgets and render them in 3D
objects as textures.

There is also a mechanism for passing OSG events back to Qt so the
widgets can also be interactive.

There is a but though... I just test osgQtBrowser and osgQtWidget on
my Kubuntu 10.10 32bit system and I'm getting a crash after a little
bit of interactivity.   I haven't yet had a chance to find the cause
of this, the last time I tested I was on a different version of Linux
+ Qt libraries.  Perhaps others with more Qt experience than myself
will be able to help pinpoint these issues.

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


Re: [osg-users] Android Development Plans

2011-01-27 Thread Chuck Shaw
Hi,

Just as an FYI, it seems the new NDK r5 really targets graphical applications.  
Specifically games, and allows you to build the entire app without any java.  

From the Android Developers blog:


 
 In addition to fully native applications, the latest NDK lets you play sound 
 from native code (via the OpenSL ES API, an open standard managed by Khronos, 
 which also oversees OpenGL ES), handle common application events (life cycle, 
 touch and key events, as well as sensors), control windows directly 
 (including direct access to the window’s pixel buffer), manage EGL contexts, 
 and read assets directly out of APK files. The latest NDK also comes with a 
 prebuilt version of STLport, making it easier to bring STL-reliant 
 applications to Android. Finally, r5 adds backwards-compatible support for 
 RTTI, C++ exceptions, wchar_t, and includes improved debugging tools. 
 Clearly, this release represents a large positive ∆awesome.
 
 We worked hard to increase the utility of the NDK for this release because 
 you guys, the developers who are actually out there making the awesome 
 applications, told us you needed it. This release is specifically designed to 
 help game developers continue to rock; with Gingerbread and the NDK r5, it 
 should now be very easy to bring games written entirely in C and C++ to 
 Android with minimal modification. We expect the APIs exposed by r5 to also 
 benefit a wide range of media applications; access to a native sound buffer 
 and the ability to write directly to window surfaces makes it much easier for 
 applications implementing their own audio and video codecs to achieve maximum 
 performance. In short, this release addresses many of the requests we’ve 
 received over the last year since the first version of the NDK was announced.
 


Thank you!

Cheers,
Chuck[/quote]

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





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


[osg-users] Mixing GLSL shaders and ARBv1.0 shaders

2011-01-27 Thread Steven Powers
I'm working with some legacy code that uses ARBv1.0 shader code for some of the 
leaf nodes.

The ARB shaders work just fine but they are never envoked when I place a GLSL 
shader (simple shadowing shader) on the root node.

I've tried setting the mask of the ARB shader to ON | OVERRIDE | PROTECTED and 
I made sure the mask of the GLSL shader is ON | OVERRIDE.

If I swap the ARB shader on the leaf node with a stand-in GLSL shader it works 
fine.

Some differences:

ARB shaders are loaded as osg::VertexProgram and osg::FragmentProgram

GLSL shaders are loaded as osg::Program with osg::Shader attached.

Both implementations share the same Node with identical state sets.

Any clues are appreciated.

Thank you!

Cheers,
Steven

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





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


Re: [osg-users] Calling OSX Dev's, Cocoa/Carbon support required for new osgGA feature

2011-01-27 Thread Alessandro Terenzi
Hi Robert,
I've just tried osgkeyboard on Mac OS X 10.6.5: whatever key I press I see
that it is correctly written in yellow in the row just below the keyboard,
but it is NOT highlighted on the keyboard itself. I'm talking about not only
the modifiable-keys but also about keys (such as backspace, space, ...) that
cannot have a modified status (at least I guess).

One note not related to this topic: I noticed that plugins are not built
into the osgPlugins-2.9.11 folder but just at the same level of the dylibs.

Hope this helps.
Cheers.
Alessandro

On Thu, Jan 27, 2011 at 5:40 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi OSX dev's,

 This afternoon I merged a submission from Alexander Sinditskiy, that
 addressed a limitation in osgGA::GUIEventAdapter where the getKey()
 method would return only the modified variation of the keycode that
 was pressed - so this would be Ctrl-C, 'C' or 'c', and if your you
 didn't want to worry about the modified key status you'd have to
 handle each of these cases in your event code.

 The way that Alexander addressed this was to add a new UnmodifiedKey
 property to GUIEventAdapter, with support added to the
 osgGA::EventQueue as well as the X11 and Win32 implementations found
 in GraphicsWindowX11.cpp and GraphicsWindowWin32.cpp.  Alexander and
 his colleagues don't have access to OSX so couldn't add the required
 support into GraphicsWindowCocoa/Carbon so for now you'll just get a 0
 for the UnmofidiedKey.

 Now this won't affect most apps as they won't yet be using the
 UnmodifiedKey property, but osgkeyboard has now been modified to use
 the UnmodifiedKey property as this illustrates it's usage and also
 simplifies the example as it no longer needs to doing multiple
 mappings to handle upper and lower case letters.  However, osgkeyboard
 will now just get a 0 for UnmodifiedKey so the keys on screen won't
 toggle on/off correctly.  At least this is what I'm expecting - I
 don't have on OSX box in front of me so I can't test this.

 Could OSX users try out OSG in svn/trunk and run osgkeyboard and see
 how things behave and then have a look into the possibility of
 providing the UmodifiedKey property as GraphicsWindowWin32.cpp and
 GraphicsWindowX11.cpp now do.  The unmodified keys now map the 'A' and
 'a' to be 'a', X11 is already uses this convention while Win32 have
 'A' as the unmodified state, but Alexander's revision addresses this
 so both produce an GUIEventAdapter::KEY_A which is mapped to 'a'.  OSX
 will need to use the same convention.

 Thanks in advance with any help you can provide in adding this
 functionality to OSX.

 Cheers,
 Robert.
 ___
 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] Simultanious use of TrackballDragger and TranslateAxisDragger

2011-01-27 Thread David Cofer
Ok. Looks like I was wrong. The CompositeDragger does exist in the older code, 
there is just not a separate cpp file for it. However, this still does not 
address my problem. I tried building my own composite dragger that combines the 
TranslateAxisDragger and the TrackballDragger, but the trackballdragger always 
has precedence and will never let the translation work. I can find no good 
documentation on how to do something like this. Is there some documentation or 
examples that I have missed that someone could point me to?

Any help would be appreciated,
Thanks,
David

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





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


Re: [osg-users] Please test svn/trunk in prep for 2.9.11 dev release

2011-01-27 Thread Robert Osfield
Hi All,

I'm going to have another attempt at making 2.9.11 tomorrow, as I'm
now back up to date with submissions and bug fixes.

Could users test svn/trunk and let me know how you get on across platfroms?

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


Re: [osg-users] Calling OSX Dev's, Cocoa/Carbon support required for new osgGA feature

2011-01-27 Thread Chuck Seberino
Robert,

I also gave osgkeyboard a whirl on my OSX-10.6.5 system built from r12127.  
Here is what I see on my system:

KeyPress / Output
-
c / c
Shift-c / C
Ctrl-c / c
Alt-c / c
Command(Super)-c / c

So pretty much in every case it prints the lowercase version except when you 
use Shift-c.  Is this the desired behavior?

Allessandro - my build puts things in the correct location.  I am using the 
Makefile generator and not doing anything framework/bundle specific.

My screen keys do not get highlighted either.  Also there is no distinction 
between left and right (they are all left) for shift, alt and super.

Adding one more item to the strange behavior queue - The capslock modifier also 
seems to not be fully baked.  I seem to need to press it 4 times in order to 
sync the MODKEY_CAPS_LOCK bit with the physical keyboard.  If I press it once, 
it registers in osg: (8192) and the light shows up on my keyboard.  Pressing it 
again still sets the bit (8192), while the keyboard light turns off.  A third 
time turns off the bit (0), but enables the keyboard light.  The 4th time syncs 
everything once again with both the MODKEY_CAPS_LOCK bit set to 0 and the 
keyboard light being off.

Regards,
Chuck Seberino

On Jan 27, 2011, at 10:21 AM, Alessandro Terenzi wrote:

 Hi Robert,
 I've just tried osgkeyboard on Mac OS X 10.6.5: whatever key I press I see 
 that it is correctly written in yellow in the row just below the keyboard, 
 but it is NOT highlighted on the keyboard itself. I'm talking about not only 
 the modifiable-keys but also about keys (such as backspace, space, ...) that 
 cannot have a modified status (at least I guess).
 
 One note not related to this topic: I noticed that plugins are not built into 
 the osgPlugins-2.9.11 folder but just at the same level of the dylibs.
 
 Hope this helps.
 Cheers.
 Alessandro
 
 On Thu, Jan 27, 2011 at 5:40 PM, Robert Osfield robert.osfi...@gmail.com 
 wrote:
 Hi OSX dev's,
 
 This afternoon I merged a submission from Alexander Sinditskiy, that
 addressed a limitation in osgGA::GUIEventAdapter where the getKey()
 method would return only the modified variation of the keycode that
 was pressed - so this would be Ctrl-C, 'C' or 'c', and if your you
 didn't want to worry about the modified key status you'd have to
 handle each of these cases in your event code.
 
 The way that Alexander addressed this was to add a new UnmodifiedKey
 property to GUIEventAdapter, with support added to the
 osgGA::EventQueue as well as the X11 and Win32 implementations found
 in GraphicsWindowX11.cpp and GraphicsWindowWin32.cpp.  Alexander and
 his colleagues don't have access to OSX so couldn't add the required
 support into GraphicsWindowCocoa/Carbon so for now you'll just get a 0
 for the UnmofidiedKey.
 
 Now this won't affect most apps as they won't yet be using the
 UnmodifiedKey property, but osgkeyboard has now been modified to use
 the UnmodifiedKey property as this illustrates it's usage and also
 simplifies the example as it no longer needs to doing multiple
 mappings to handle upper and lower case letters.  However, osgkeyboard
 will now just get a 0 for UnmodifiedKey so the keys on screen won't
 toggle on/off correctly.  At least this is what I'm expecting - I
 don't have on OSX box in front of me so I can't test this.
 
 Could OSX users try out OSG in svn/trunk and run osgkeyboard and see
 how things behave and then have a look into the possibility of
 providing the UmodifiedKey property as GraphicsWindowWin32.cpp and
 GraphicsWindowX11.cpp now do.  The unmodified keys now map the 'A' and
 'a' to be 'a', X11 is already uses this convention while Win32 have
 'A' as the unmodified state, but Alexander's revision addresses this
 so both produce an GUIEventAdapter::KEY_A which is mapped to 'a'.  OSX
 will need to use the same convention.
 
 Thanks in advance with any help you can provide in adding this
 functionality to OSX.
 
 Cheers,
 Robert.
 ___
 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] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-27 Thread Jean-Sébastien Guay

Hello all,

(crossposting to osg-ephemeris as this is related to it)

In trying to optimize our scenes, I have found out that the osgEphemeris 
skydome is pretty inefficiently organized in terms of what we've been 
talking about in the other thread (see Optimizing scene structure and 
geometry on osg-users: 
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/64850 ).


The skydome is built with 4 geodes, each of which has 4 geometry 
objects, each of which has 9600 vertices drawn with 48 primitivesets 
(DrawArrays of TRIANGLE_STRIPs). The strips in each geometry start at 3 
triangles and go up to 97 in steps of 2. So that's pretty poor batching.


I can understand the 4 geodes, and perhaps even 16 geometry, as they'll 
make culling effective and will result in less geometry drawn when it's 
not visible. And I think 4 geodes and 16 geometry isn't too bad in the 
grand scheme of things. But these 768 small strips have to go. :-)


I'm guessing the geometry is organized in strips going from the top of 
the sphere to its equator, and this must be done in order to be able to 
color the sphere horizontally when the sun sets. However, there must be 
a more efficient way.


Other than doing the coloring with a texture, which might be the most 
efficient way but would mean too drastic code changes I think, would 
there be a way to convert the 48 primitive sets to a single DrawElements 
of TRIANGLES, without affecting the vertex array (or the others)? That 
way it would be better batched, but would retain the possibility to 
color the dome in the same way as it is now. I'll have a look at the 
INDEX_MESH optimizer to get some idea of how that would work, is that a 
good place to start?


If anyone has the time or interest to look at the code for osgEphemeris, 
it's available at http://www.andesengineering.com/Projects/OsgEphemeris/ 
. I'll be trying to make it more efficient, because it proves to be part 
of our problem.


Thanks in advance,

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


Re: [osg-users] Simultanious use of TrackballDragger and TranslateAxisDragger

2011-01-27 Thread Jean-Sébastien Guay

Hello David,


Ok. Looks like I was wrong. The CompositeDragger does exist in the older code, 
there is just not a separate cpp file for it. However, this still does not 
address my problem. I tried building my own composite dragger that combines the 
TranslateAxisDragger and the TrackballDragger, but the trackballdragger always 
has precedence and will never let the translation work. I can find no good 
documentation on how to do something like this. Is there some documentation or 
examples that I have missed that someone could point me to?


We do exactly the same thing in our own projects and it works fine, so 
you must be missing something.


Here is the code we use for our dragger. Note that it uses the 
subclassez OurTrackballDragger and OurTranslateAxisDragger which 
customize the behavior of the draggers themselves, but you can use the 
draggers directly from osgManipulator if they fit your purposes. For 
example, the customizations we did were that the normal TrackballDragger 
has a sphere in the middle, but then you can't pick the axes of the 
TranslateAxisDragger in the middle of the trackball. So we removed that. 
Also the TrackballDragger's cylinders are one polygon thick so we gave 
them thickness so you could pick them from the side. The normal 
TranslateAxisDragger's axes were too small for us, so we made them 
bigger so they're easier to pick.


Also note that we use an osg::AutoTransform so the dragger is always the 
same size on the screen. If you don't need that just remove it.


class TrackballAxisDragger : public osgManipulator::CompositeDragger
{
public:
TrackballAxisDragger()
{
_autoTransform = new osg::AutoTransform;
_autoTransform-setAutoScaleToScreen(true);
addChild(_autoTransform.get());

_sizeTransform = new osg::MatrixTransform;
// Screen coordinates because of AutoTransform parent
_sizeTransform-setMatrix(
osg::Matrix::scale(100, 100, 100));
_autoTransform-addChild(_sizeTransform.get());

_tbDragger = new OurTrackballDragger;
_tbDragger-setName(TrackballDragger);
_sizeTransform-addChild(_tbDragger.get());

_transDragger = new OurTranslateAxisDragger;
_transDragger-setName(TranslateAxisDragger);
_sizeTransform-addChild(_transDragger.get());

this-addDragger(_tbDragger.get());
this-addDragger(_transDragger.get());
this-getOrCreateStateSet()-setMode(
GL_RESCALE_NORMAL, osg::StateAttribute::ON);
this-setParentDragger(getParentDragger());
}

void setupDefaultGeometry()
{
_tbDragger-setupDefaultGeometry();

// Scale the translate dragger up a bit, otherwise the axes
// will be in the trackball dragger's sphere and we won't be
// able to pick them.
float axesScale = 1.5;
_transDragger-setMatrix(
osg::Matrix::scale(axesScale,axesScale,axesScale));
_transDragger-setupDefaultGeometry();
}

// ... Other methods omitted for brevity

I don't think we do anything else to make the CompositeDragger work... 
So if you're missing anything in the setup that we do above, that must 
be it.


If it still doesn't work for you, please post the code (preferably a 
short self-contained but complete example, perhaps using the 
osgmanipulator example from OSG as a starting point) and I can have a look.


Hope this helps,

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


[osg-users] OT: Nvidia make Parallel Insight for Visual Studio Free

2011-01-27 Thread Tomlinson, Gordon
NVidia are now making this interesting tool set free ( for Visual studio
user Only )

 

See http://www.nvidia.com/object/parallel-nsight.html

 

Massively Parallel Computing

NVIDIA(r) Parallel Nsight(tm), in combination with Visual Studio, allows
you to leverage the CPU for parallel tasks and the GPU for massively
parallel computing. Parallel Nsight Professional is now available to
all, free of charge.

 

Multiple Cores What could you do with your application running 5 - 50
times faster? Develop an innovative approach to cancer detection?
Analyze financial options in real-time? Discover hidden oil reserves?
Create award winning game physics? Process HD video to allow your
customers to meet deadlines? Our partners are doing all of the above,
and more.

 

The power of GPU Computing is already delivering game changing
performance increases to the Medical, Finance, Energy, Consumer and
Research fields. For over 1,000 customer stories, visit
www.nvidia.com/cuda.

 

GPU DEVELOPMENT

NVIDIA Parallel Nsight 1.5 for GPU Development

NVIDIA Parallel Nsight software is the industry's first development
environment for massively parallel computing integrated into Microsoft
Visual Studio, the world's most popular development environment.
Parallel Nsight is a powerful plug-in that allows programmers to develop
for both GPUs and CPUs within Microsoft Visual Studio.

 

*NEW* for Parallel Nsight 1.5

   - Microsoft Visual Studio 2010 Support

   - Tesla Compute Cluster (TCC) Support

   - Single System Compute Debugging

[snip]

 

 

 

Gordon Tomlinson

3D Technology

System Engineering Consultant

Overwatch(r)

An Operating Unit of Textron Systems

Office:   703-437-7651  x 2415

Fax:   703-437-0039

gtomlin...@overwatch.textron.com
mailto:gtomlin...@overwatch.textron.com 

www.overwatch.com http://www.overwatch.com/ 

__
WARNING: Documents that can be viewed, printed or retrieved from this
E-Mail may contain technical data whose export is restricted by the Arms
Export Control Act (Title 22, U.S.C., Sec 2751, et seq,) or the Export
Administration Act of 1979, as amended, Title 50, U.S.C., App. 2401 et
seq. and which may not be exported, released or disclosed to non-U.S.
persons (i.e. persons who are not U.S. citizens or lawful permanent
residents [green card holders]) inside or outside the United States,
without first obtaining an export license.  Violations of these export
laws are subject to severe civil, criminal and administrative
penalties.

 

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


Re: [osg-users] Mixing GLSL shaders and ARBv1.0 shaders

2011-01-27 Thread Jason Daly

On 01/27/2011 12:58 PM, Steven Powers wrote:

I'm working with some legacy code that uses ARBv1.0 shader code for some of the 
leaf nodes.

The ARB shaders work just fine but they are never envoked when I place a GLSL 
shader (simple shadowing shader) on the root node.

I've tried setting the mask of the ARB shader to ON | OVERRIDE | PROTECTED and 
I made sure the mask of the GLSL shader is ON | OVERRIDE.

If I swap the ARB shader on the leaf node with a stand-in GLSL shader it works 
fine.

Some differences:

ARB shaders are loaded as osg::VertexProgram and osg::FragmentProgram

GLSL shaders are loaded as osg::Program with osg::Shader attached.

Both implementations share the same Node with identical state sets.

Any clues are appreciated.


ARB and GLSL are two different StateAttributes.   OSG will treat them as 
orthogonal, but the hardware obviously won't.  Or, to put it another 
way, you can't have both GLSL and ARB programs running, but OSG probably 
doesn't know that.


You probably need to explicitly turn off the osg::Program at the same 
time as you enable the osg::VertexProgram on the nodes in question.  
Something like this:


stateSet = node-getOrCreateStateSet();
osg::Program * program = new osg::Program();
stateSet-setAttributeAndModes(program, osg::StateAttribute::OFF | 
osg::StateAttribute::PROTECTED);


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


Re: [osg-users] Mixing GLSL shaders and ARBv1.0 shaders

2011-01-27 Thread Steven Powers
Brilliant!

That did the trick. Luckily the code to apply an ARB shader is consolidated to 
a single function. Otherwise I'd have to add these lines everywhere and ARB 
shader was added.



Thank you!

Cheers,
Steven

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





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


[osg-users] Linker error during execution

2011-01-27 Thread Mukund Keshav
Hello everyone,

i tried executing the very first tutorial provided in the OSG website(basic 
geometry.cpp). Well i got this error:(a link error)

 error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in 
function public: __thiscall std::_Vector_const_iteratorclass osg::Vec3f,class 
std::allocatorclass osg::Vec3f ::_Vector_const_iteratorclass 
osg::Vec3f,class std::allocatorclass osg::Vec3f (class osg::Vec3f *,class 
std::_Container_base_secure const *) 
(??0?$_Vector_const_iterator@VVec3f@osg@@V?$allocator@VVec3f@osg@@@std@@@std@@QAE@PAVVec3f@osg@@PBV_Container_base_secure@1@@Z)


The error looks pretty scary. im not sure what is wrong. i ran few other 
programs, and it was fine. im not sure what this one meant though.

i have linked the following libraries:

osgd.lib
osgDBd.lib
osgViewerd.lib
osgTextd.lib
osgUtild.lib
OpenThreadsd.lib


Can anyone please provide some suggestions?

Thanks,
Mukund

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





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


Re: [osg-users] Mixing GLSL shaders and ARBv1.0 shaders

2011-01-27 Thread Jason Daly

On 01/27/2011 03:54 PM, Steven Powers wrote:

Brilliant!

That did the trick. Luckily the code to apply an ARB shader is consolidated to 
a single function. Otherwise I'd have to add these lines everywhere and ARB 
shader was added.


It was mostly a guess  :-)   Glad it worked for you.

--J

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


Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-27 Thread Jean-Sébastien Guay

Hi again,

Well, I've been able to change the 48 small triangle strips per geometry 
to a single DrawElements call, with naive code that just puts indices to 
replicate what the strip is doing, i.e. 0 1 2 1 2 3 2 3 4 etc.


The result is a small but noticeable decrease in draw time. It's smaller 
than I would have thought. Perhaps there would be an even better way 
than the naive approach I'm using?


I'm attaching the code, see the part starting at #define 
USE_TRIANGLE_STRIPS (which needs to be commented to use my changes).


Thanks,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
/*
 ---
 | osgEphemeris - Copyright (C) 2007  Don Burns|
 | |
 | This library is free software; you can redistribute it and/or modify|
 | it under the terms of the GNU Lesser General Public License as published|
 | by the Free Software Foundation; either version 3 of the License, or|
 | (at your option) any later version. |
 | |
 | This library is distributed in the hope that it will be useful, but |
 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY  |
 | or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public |
 | License for more details.   |
 | |
 | You should have received a copy of the GNU Lesser General Public License|
 | along with this software; if not, write to the Free Software Foundation,|
 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.   |
 | |
 ---
 */

#include osg/Geometry
#include osgEphemeris/Sphere.h

using namespace osgEphemeris;

const double Sphere::_defaultRadius = 3476000.0 * 0.5; // diameter of moon 
* 0.5 = radius of moon

Sphere::Sphere( double radius,
Sphere::TesselationResolution tr,
Sphere::Orientation orientation,
Sphere::Hemisphere whichHemisphere,
bool stc
  )
{
_skyTexCoords = stc;

unsigned int nsectors = 4;
double latStep  = 
( tr == TessHigh ) ?  1.875 :
( tr == TessLow ) ?   15 : 7.5;


osg::ref_ptrosg::Vec3Array v = new osg::Vec3Array;
int R = 0;
for( unsigned int sector = 0; sector  nsectors; sector++ )
{
double off = double(sector) * 360.0/(double)(nsectors);
int div = 1;

v-push_back( osg::Vec3(0,0,radius));
for( double lat = latStep; lat = 91.0; lat += latStep )
{
double dd = (360.0/double(nsectors))/(double)(div);
for( int i = 0; i = div; i++ ) 
{
double lon = off + double(i) * dd;

double x = radius * cos(osg::DegreesToRadians(lon)) *  
sin(osg::DegreesToRadians(lat));
double y = radius * sin(osg::DegreesToRadians(lon)) *  
sin(osg::DegreesToRadians(lat));
double z = radius * cos(osg::DegreesToRadians(lat));

v-push_back( osg::Vec3(x,y,z));
}
div++;
if( sector == 0 )
R++;
}
}

for( int hemisphere = 0; hemisphere  2; hemisphere++ )
{
if( !((1hemisphere)  whichHemisphere) )
continue;

osg::Geode *geode = new osg::Geode;

int iii = 0;
osg::ref_ptrosg::Vec3Array coords = new osg::Vec3Array;
osg::ref_ptrosg::Vec3Array normals = new osg::Vec3Array;
osg::ref_ptrosg::Vec2Array tcoords = new osg::Vec2Array;

for( unsigned int sector = 0; sector  nsectors; sector++ )
{
int len = 3;
int ii[] = { 1, 0 };
int toggle = 0;

for( int j = 0; j  R; j++ )
{
osg::ref_ptrosg::Vec3Array tarray = new osg::Vec3Array;

for( int i = 0; i  len; i++ )
{
int index = iii + ii[toggle];
tarray-push_back( (*v)[index] );
ii[toggle]++;
toggle = 1 - toggle;
}

if( hemisphere == 0 )
{
if( orientation == InnerOrientation )
{
for( unsigned int n = 0; n  tarray-size(); n++ )
{
osg::Vec3 v = (*tarray)[n];

Re: [osg-users] Linker error during execution

2011-01-27 Thread Mourad Boufarguine
Hi Mukund,

Could you send your vcproj file ?

Mourad


On Thu, Jan 27, 2011 at 10:06 PM, Mukund Keshav osgfo...@tevs.eu wrote:

 Hello everyone,

 i tried executing the very first tutorial provided in the OSG website(basic
 geometry.cpp). Well i got this error:(a link error)

  error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced
 in function public: __thiscall std::_Vector_const_iteratorclass
 osg::Vec3f,class std::allocatorclass osg::Vec3f
 ::_Vector_const_iteratorclass osg::Vec3f,class std::allocatorclass
 osg::Vec3f (class osg::Vec3f *,class std::_Container_base_secure const *)
 (??0?$_Vector_const_iterator@VVec3f@osg@@V?$allocator@VVec3f@osg@@@std@
 @@std@@QAE@PAVVec3f@osg@@PBV_Container_base_secure@1@@Z)


 The error looks pretty scary. im not sure what is wrong. i ran few other
 programs, and it was fine. im not sure what this one meant though.

 i have linked the following libraries:

 osgd.lib
 osgDBd.lib
 osgViewerd.lib
 osgTextd.lib
 osgUtild.lib
 OpenThreadsd.lib


 Can anyone please provide some suggestions?

 Thanks,
 Mukund

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





 ___
 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] Simultanious use of TrackballDragger and TranslateAxisDragger

2011-01-27 Thread David Cofer
Thanks! It turns out that I had it almost right. It was adding the scaling to 
the translateaxis that made it work. I did not know that was necessary. 

Thanks for the help,
David

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





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


Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)

2011-01-27 Thread Tim Moore
If I understand correctly how the sky dome mesh is constructed, there was a
lot of duplication of vertices in the triangle strip arrays, and this has
been carried forward into your indexed mesh approach. The INDEX_MESH
optimizer would remove these duplicates. The order of the triangles in the
output of INDEX_MESH should be the same as the input order, but it might be
tricky to pick corresponding triangles out of the new mesh. Since this is
such a regular mesh, the vertex cache optimizers would make a small
difference; however, you would totally lose the order of the mesh.

What was the actual performance difference?

Tim

On Thu, Jan 27, 2011 at 10:28 PM, Jean-Sébastien Guay 
jean-sebastien.g...@cm-labs.com wrote:

 Hi again,

 Well, I've been able to change the 48 small triangle strips per geometry to
 a single DrawElements call, with naive code that just puts indices to
 replicate what the strip is doing, i.e. 0 1 2 1 2 3 2 3 4 etc.

 The result is a small but noticeable decrease in draw time. It's smaller
 than I would have thought. Perhaps there would be an even better way than
 the naive approach I'm using?

 I'm attaching the code, see the part starting at #define
 USE_TRIANGLE_STRIPS (which needs to be commented to use my changes).

 Thanks,


 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

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


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


Re: [osg-users] Linker error during execution

2011-01-27 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Just a quick comment...

Unless you're debugging into OSG code, I would not use the debug libraries.
Things will run SLOOOW.

Use osg.lib, osgDB.lib, etc...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Mukund
Keshav
Sent: Thursday, January 27, 2011 2:06 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Linker error during execution

Hello everyone,

i tried executing the very first tutorial provided in the OSG website(basic
geometry.cpp). Well i got this error:(a link error)

 error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced
in function public: __thiscall std::_Vector_const_iteratorclass
osg::Vec3f,class std::allocatorclass osg::Vec3f
::_Vector_const_iteratorclass osg::Vec3f,class std::allocatorclass
osg::Vec3f (class osg::Vec3f *,class std::_Container_base_secure const *)
(??0?$_Vector_const_iterator@VVec3f@osg@@V?$allocator@VVec3f@osg@@@std@@@std
@@QAE@PAVVec3f@osg@@PBV_Container_base_secure@1@@Z)


The error looks pretty scary. im not sure what is wrong. i ran few other
programs, and it was fine. im not sure what this one meant though.

i have linked the following libraries:

osgd.lib
osgDBd.lib
osgViewerd.lib
osgTextd.lib
osgUtild.lib
OpenThreadsd.lib


Can anyone please provide some suggestions?

Thanks,
Mukund

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





___
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] Android Development Plans

2011-01-27 Thread Jason Daly

On 01/27/2011 11:47 AM, Chuck Shaw wrote:

Hi,

Just as an FYI, it seems the new NDK r5 really targets graphical applications.  
Specifically games, and allows you to build the entire app without any java.


Yeah, I just downloaded and looked through it.  There's an example 
without a single Java class in it.  It just goes straight to EGL and 
GLES2 in the .c file.  Very cool!


--J

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


[osg-users] [ANN] OSG tutorial updated

2011-01-27 Thread Leandro Motta Barros
Hello OSGers,

The third chapter of my introductory guide to the OSG (A Short
Introduction to the Basic Principles of the Open Scene Graph) is
online, covering lights, textures and shaders. As in the previous
chapters, the focus is on concepts, not on details.

Check it out here: http://www.stackedboxes.org/~lmb/asittbpo-open-scene-graph

I hope you enjoy it.

Cheers,

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