Re: [osg-users] [ANN] osgRecipes: Integrate OSG with almost everything :-)

2012-06-19 Thread webmaster
 

Great works!!!


在2012-06-18,Wang Rui wangra...@gmail.com 写道:

-原始邮件-
发件人: Wang Rui wangra...@gmail.com
发送时间: 2012年6月18日 星期一
收件人: OpenSceneGraph Users osg-users@lists.openscenegraph.org
主题: [osg-users] [ANN] osgRecipes: Integrate OSG with almost everything :-)

Hi all,


I'm glad to announce a new project I'm working on in the scope of osgRecipes 
(also the repo of the book OpenSceneGraph 3 Cookbook):
https://github.com/xarray/osgRecipes/tree/master/integrations


Its main and only goal is to integrate as more as possible third-party 
libraries/SDKs with OSG to make use of both features. It is in public domain, 
so feel free to make use of everything here. :-)


All example code here will show how to integrate OSG with different kinds of 
libraries and SDKs in a simple enough and extendible way, that means, there 
will be few lines of code for each recipe to make them understandable. Such 
external libraries can quickly add extra functionalities like special effects, 
visual components and interaction methods to your OSG scenes and greatly 
improve the performance of the applications.


Current third-party libraries that are embedded within OSG are listed here:
* AntTweakBar (a light and intuitive GUI framework): 
http://www.antisphere.com/Wiki/tools:anttweakbar
* AssImp (a library to import various well-known 3D model formats): 
http://assimp.sourceforge.net/
* Awesomium (a web-browser framework for in-app browsing and HTML UIs): 
http://awesomium.com/
* FreeImage (a library supporting popular image formats): 
http://freeimage.sourceforge.net/
* Microsoft Kinect SDK: 
http://www.microsoft.com/en-us/kinectforwindows/develop/developer-downloads.aspx
* NVIDIA PhysX (a well-rounded physics engine, version 3.2): 
http://developer.nvidia.com/physx-downloads
* Spark (a crossplatform particle engine): http://spark.developpez.com/
* TUIO (a common API for tangible multitouch surfaces): already included in the 
source code
* VLC (a cross-platform multimedia player and framework): 
http://www.videolan.org/vlc/


And these are on my TODO list. Anybody is welcomed to add more here, or just 
contribute your own works:
Animata, Microsoft DirectWrite, GUIChan, libGimzo, MyGUI, openNURBS, Sundog 
Triton, Woody3D...


All the libraries must be free for downloading and for non-commercial purpose 
of use to be added into the project. Also as far as I know, there are also some 
good integrations like OSG+libRocket, and OSG+libRVO2, I would like to merge 
them, too, or just have a link in my project, if allowed.


I'm also very glad to see some of the examples merged into the core OSG trunk, 
if Robert think it possible. :-)


Any attentions, feedbacks, and contributions are always appreciated. And it is 
often existing to see more and more cool stuffs works in OSG.


Cheers,


Wang Rui

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


Re: [osg-users] Error reported when using RGB_16F cubemap as FBO

2012-06-19 Thread Sergey Polischuk
Hi, Brad

Add this lines and you should be ok:

texture-setSourceType(GL_HALF_FLOAT);
texture-setSourceFormat(GL_RGB);

Cheers,
Sergey.

19.06.2012, 05:01, Brad Colbert bcolb...@rscusa.com:
 Hi,

 I'm getting an error when I try to use a floating point texture as a cube map 
 for an FBO.  I'm able to repeat the error using the prerendercubemap example 
 where I changed line 223 to:

 texture-setInternalFormat(GL_RGB16F_ARB);

 The error I get is:

 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6

 My hardware and driver versions are:

 HW: NVidia GT 540M
 Driver: 268.30

 I have not dug yet to see if this is something in OSG that may be incorrectly 
 setting up the FBO or if it's a fundamental problem.

 Any quick ideas?

 ...

 Thank you!

 Cheers,
 Brad
 ___
 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] iPad3 Retina Display Support

2012-06-19 Thread Joerke, Robin
Hi,
The Deployment target is 5.1.
I tried to force the ScaleFactor using your code. This lead to the problem
that I have to double the viewport size or everything except the top left
quarter of the screen is black.
This seems a bit strange to me...

Further work must be deferred to next week.
Then I will check the visual result and report back.

Best regards,
Robin Jörke

Am 18.06.12 17:59 schrieb Stephan Maximilian Huber unter
ratzf...@digitalmind.de:

Hi,

Your code looks correct to me. What is the ios deployment target for
the osg-project? It should be = 4.0

You can try to force the scale via

osg::ref_ptrosg::Referenced windata = new
 osgViewer::GraphicsWindowIOS::WindowData(self.view,
 osgViewer::GraphicsWindowIOS::WindowData::ALL_ORIENTATIONS, [[UIScreen
mainScreen] scale]);

(haven't tested this personally)

Stephan

Am 18.06.12 16:25, schrieb Joerke, Robin:
 Thanks for your reply.
 I am using iOS SDK 5.1.
 This is the initialization code inside of a UIViewController:
 
 osg::ref_ptrosg::GraphicsContext::Traits traits = new
 osg::GraphicsContext::Traits;
  CGRect lFrame = [self.view bounds];
  unsigned int w = lFrame.size.width;
 
  unsigned int h = lFrame.size.height;
  
  osg::ref_ptrosg::Referenced windata = new
 osgViewer::GraphicsWindowIOS::WindowData(self.view,
 osgViewer::GraphicsWindowIOS::WindowData::ALL_ORIENTATIONS);
 std::cout  the screen Scale is:   [[UIScreen mainScreen]
scale]
  std::endl;
  // Setup the traits parameters
  traits-x = 0;
  traits-y = 0;
  traits-width = w;
  traits-height = h;
  traits-depth = 16; //keep memory down, default is currently 24
  //traits-alpha = 8;
  //traits-stencil = 8;
  traits-windowDecoration = false;
  traits-doubleBuffer = true;
  traits-sharedContext = 0;
  traits-setInheritedWindowPixelFormat = true;
  
  traits-inheritedWindowData = windata;
 
  // Create the Graphics Context
  osg::ref_ptrosg::GraphicsContext graphicsContext =
 osg::GraphicsContext::createGraphicsContext(traits.get());
  
 _viewer = new osgViewer::Viewer();
  
  if(graphicsContext)
  {
  _viewer-getCamera()-setGraphicsContext(graphicsContext);
  _viewer-getCamera()-setViewport(new osg::Viewport(0, 0,
traits-width,
 traits-height));
  }
 
 Best regards,
 Robin Jörke
 
 
 
 Am 18.06.12 14:36 schrieb Stephan Maximilian Huber unter
 ratzf...@digitalmind.de:
 
 Am 18.06.12 12:23, schrieb Joerke, Robin:

 I have developed an iPad-App using osgViewer::GraphicsWindowIOS.
 When deploying to an iPad 3 with iOS 5.1, I noticed that iOS
 automatically
 upscales the graphics context by factor 2, for filling the Retina
 Display.
 However, osg still renders in a low resolution (1024x768), leading to
 aliasing artifacts.

 I tried to increase the rendering resolution to 2048x1536, but I could
 not
 find out how to disable the iOS upscale. This leads to the problem
that
 only a quarter of the rendered image is visible. Even changing the
 contentScaleFactor property of the UIView did not help.

 I read about osg already supporting Retina Displays. What am I
missing?

 Support for Retina-display is only available when compiling osg against
 a SDK = 4.0

 It should work out of the box, so when you request a graphicscontext
for
 1024x768 you'll get a view sized 1024x768 and a graphics-context with
 2048 x 1536.

 Hoy do you set up your GraphicsWindowIOS?

 cheers,
 Stephan

 ___
 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 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] Error reported when using RGB_16F cubemap as FBO

2012-06-19 Thread Brad Colbert
Sergey,

That fixed it, thank you!

-B


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sergey 
Polischuk
Sent: Tuesday, June 19, 2012 1:59 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Error reported when using RGB_16F cubemap as FBO

Hi, Brad

Add this lines and you should be ok:

texture-setSourceType(GL_HALF_FLOAT);
texture-setSourceFormat(GL_RGB);

Cheers,
Sergey.

19.06.2012, 05:01, Brad Colbert bcolb...@rscusa.com:
 Hi,

 I'm getting an error when I try to use a floating point texture as a cube map 
 for an FBO.  I'm able to repeat the error using the prerendercubemap example 
 where I changed line 223 to:

 texture-setInternalFormat(GL_RGB16F_ARB);

 The error I get is:

 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6

 My hardware and driver versions are:

 HW: NVidia GT 540M
 Driver: 268.30

 I have not dug yet to see if this is something in OSG that may be incorrectly 
 setting up the FBO or if it's a fundamental problem.

 Any quick ideas?

 ...

 Thank you!

 Cheers,
 Brad
 ___
 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] Bug in osgGA::EventQueue?

2012-06-19 Thread I-Nixon, Anthony D
Hi Everyone:

I'm seeing behavior in my application whereby an osg Window will come up, but 
won't respond to any events for a few (sometimes 10 or more seconds).  
Rendering is happening during this time, but no event processing.

I tracked it down to the following:


1.  The event queue is constructed and initializes _startTick

2.  Some events are pushed onto the queue (not explicitly, could be mouse 
move, etc)

3.  Some time passes (generally related to model loading - we are using 
osgEarth)

4.  Rendering starts and calls setStartTick() on the event queue with a new 
time.

5.  takeEvents() is called during event traversal, but because the 
startTick has been reset, the top event is in the future and takeEvents() 
returns nothing.

6.  Eventually enough time passes so that the event is no longer in the 
future and event processing starts happening.

The time that the stall lasts for is clearly related to how long step 3 takes - 
which can be lengthy when osgEarth is fetching stuff off the network.

I fixed it by clearing out the events when setStartTick is called, viz:


void EventQueue::setStartTick(osg::Timer_t tick)
{
 OpenThreads::ScopedLockOpenThreads::Mutex lock(_eventQueueMutex);
 // Since setting the start tick effectively invalidates the time
// of any events already in the queue, clear it out
 _eventQueue.clear();
 _startTick = tick;
}

I haven't got a sample that reproduces the behavior, but it seems to make sense 
that if the startTick is reset, all the existing events are toast?  I'm not 
sure why no one else has seen this - maybe our usage pattern is different from 
the norm?

Cheers

Anthony

Anthony Nixon
Modelling  Simulation Architect
Systems Analysis Laboratory (SAL)
Strategic Development  Experimentation - International
Boeing Defence Australia Ltd


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