[osg-users] I want to know the time of rendering.

2012-06-25 Thread J.YoungStone
Hi, nice to meet you all.

I'm beginner in OSG.

I'm reading OpenSceneGraph 3.0 Beginner's Guide and
practicing the example in this book.

Here are very simple example.

#include osgDB/ReadFile
#include osgViewer/Viewer


Code:
int main( int argc, char** argv )
{
osg::ref_ptrosg::Node root = osgDB::readNodeFile( cessna.osg );

osgViewer::Viewer viewer;
viewer.setSceneData( root.get() );

return viewer.run();
}



With this code,
I want to know the time of rendering. [Exclamation] 
Are there some methods for this in OSG itself?

If anyone knows please let me know.
... 

Thank you!

Cheers,
J.YoungStone

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





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


Re: [osg-users] [vpb] build VPB on VS 10

2012-06-25 Thread nguyen duy nam
Hi,
thanks for reply.
i tried redownload GDAL 1.7 , VPB least version on git server  and compile it 
then it run ok.
... 


Thank you!

Cheers,
nguyen

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





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


[osg-users] [3rdparty] ShadowedScene doesn't display HUD Camera

2012-06-25 Thread Alex Weber
Hi,

for some reason my Shadowed Scene won't display my HUD Camera, if I add the 
Camera without the ShadowMap it works ine, but adding it disables the HUD for 
no reason.

Help please!

Here is some reference:

Camera:

camera-setClearMask( GL_DEPTH_BUFFER_BIT );
camera-setRenderOrder( Camera::POST_RENDER );
camera-setReferenceFrame( Camera::ABSOLUTE_RF );
camera-setViewMatrixAsLookAt( Vec3(0.0f,0.0f, 1.0f), Vec3(), Vec3(0.0f, 
1.0f, 1.0f) );
osg::StateSet* stateset = camera-getOrCreateStateSet();
stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF);
stateset-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);

Shadowmap:
osg::ref_ptrosgShadow::ShadowMap sm = new osgShadow::ShadowMap;
sm-setLight( source.get() );
sm-setTextureSize( osg::Vec2s(1024, 1024) );
sm-setTextureUnit( 1 );

Thank you in advance!

Cheers,
Alex

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





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


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Robert Osfield
Hi Clement,

On 24 June 2012 18:14,  clement@csiro.au wrote:
   I got aliasing problem on volume rendering.  I tried to set parameter 
 samples to 8 in class osg::GraphicsContext::Traits, but I still can see 
 aliasing.  Does anyone have an solution to stop aliasing.  Thanks.

Volume rendering won't tend to be too sensitive/responsive to full
screen anti-aliasing, rather then the way to improve visual quality
with volume rendering is to increase the number of samples taken along
the ray path when sampling the 3d texture.

Could you post an example of the aliasing you are seeing, this will
probably point to the problem.

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


Re: [osg-users] I want to know the time of rendering.

2012-06-25 Thread Robert Osfield
Hi Jerome,

When you say you want to know the time of rendering, do you mean the
time in seconds since the start of the viewers frame loop?  Time of
day?

Also how do you want to use the time?  This is important to know as
depending upon what task you have there are different ways to get the
time in the more convenient way for that task - for instance update,
event, cull and draw callbacks, or in the main loop.

As a point of reference the OSG maintains an osg::FrameStamp object in
the Viewer that is update once each frame by viewer.advance() and this
FrameStamp is passed to all scene graph traversals.

Robert.

On 25 June 2012 05:29, J.YoungStone jer...@cybermed.co.kr wrote:
 Hi, nice to meet you all.

 I'm beginner in OSG.

 I'm reading OpenSceneGraph 3.0 Beginner's Guide and
 practicing the example in this book.

 Here are very simple example.

 #include osgDB/ReadFile
 #include osgViewer/Viewer


 Code:
 int main( int argc, char** argv )
 {
        osg::ref_ptrosg::Node root = osgDB::readNodeFile( cessna.osg );

        osgViewer::Viewer viewer;
        viewer.setSceneData( root.get() );

        return viewer.run();
 }



 With this code,
 I want to know the time of rendering. [Exclamation]
 Are there some methods for this in OSG itself?

 If anyone knows please let me know.
 ...

 Thank you!

 Cheers,
 J.YoungStone

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





 ___
 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] [3rdparty] ShadowedScene doesn't display HUD Camera

2012-06-25 Thread Robert Osfield
Hi Alex,

There isn't any away that a 3rd party will be able to guess your
mistake given the scant details provided.  The idea of mixing shadows
and HUD is rather odd, one wouldn't normally do this, rather one would
have a 3D scene graph with shadows representing your world and if one
needs a HUD have this attached to the viewer as a separate slave
Camera or View.  Please have look at the osghud example for the ranges
of ways doing a HUD.

Robert.

On 25 June 2012 08:08, Alex Weber alexwe...@gmx.de wrote:
 Hi,

 for some reason my Shadowed Scene won't display my HUD Camera, if I add the 
 Camera without the ShadowMap it works ine, but adding it disables the HUD for 
 no reason.

 Help please!

 Here is some reference:

 Camera:

    camera-setClearMask( GL_DEPTH_BUFFER_BIT );
    camera-setRenderOrder( Camera::POST_RENDER );
    camera-setReferenceFrame( Camera::ABSOLUTE_RF );
    camera-setViewMatrixAsLookAt( Vec3(0.0f,0.0f, 1.0f), Vec3(), Vec3(0.0f, 
 1.0f, 1.0f) );
    osg::StateSet* stateset = camera-getOrCreateStateSet();
    stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF);
    stateset-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);

 Shadowmap:
    osg::ref_ptrosgShadow::ShadowMap sm = new osgShadow::ShadowMap;
    sm-setLight( source.get() );
    sm-setTextureSize( osg::Vec2s(1024, 1024) );
    sm-setTextureUnit( 1 );

 Thank you in advance!

 Cheers,
 Alex

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





 ___
 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] [osgPlugins] Which model format to use? FBX vs. VRML

2012-06-25 Thread Praveena Sara
Hi,

My requirements:
Models should have keyframe animations in them
Have textures
Should be modeled and exported using 3Ds Max

I hope to use either FBX or VRML models. What are the pros and cons of each 
model? 

Thanks.

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





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


Re: [osg-users] Render to texture, display pre-rendered scene

2012-06-25 Thread Christian Rumpf
Hey again. As I posted before I managed to render to texture a scene and 
projected it onto a Geometry. But it is just an image of a scene and the RTT 
camera can't move around my object (cessna.osg).

Is there a way to move the camera freely around like you would do with viewer's 
camera?

lg Christian

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





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


Re: [osg-users] Render to texture, display pre-rendered scene

2012-06-25 Thread Robert Osfield
Hi Christian,

Have a look at the osgdistortion example.

Robert.

On 25 June 2012 11:20, Christian Rumpf ru...@student.tugraz.at wrote:
 Hey again. As I posted before I managed to render to texture a scene and 
 projected it onto a Geometry. But it is just an image of a scene and the RTT 
 camera can't move around my object (cessna.osg).

 Is there a way to move the camera freely around like you would do with 
 viewer's camera?

 lg Christian

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





 ___
 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] Render to texture, display pre-rendered scene

2012-06-25 Thread Christian Rumpf

robertosfield wrote:
 Hi Christian,
 
 thank you
 
 Have a look at the osgdistortion example.
 
 Robert.
 
 On 25 June 2012 11:20, Christian Rumpf  wrote:
 
  Hey again. As I posted before I managed to render to texture a scene and 
  projected it onto a Geometry. But it is just an image of a scene and the 
  RTT camera can't move around my object (cessna.osg).
  
  Is there a way to move the camera freely around like you would do with 
  viewer's camera?
  
  lg Christian
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=48474#48474
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 ___
 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=48476#48476





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


Re: [osg-users] [osgPlugins] Which model format to use? FBX vs. VRML

2012-06-25 Thread Jan Ciger
Hello,

On Mon, Jun 25, 2012 at 11:07 AM, Praveena Sara pravee...@gmail.com wrote:

 Hi,

 My requirements:
 Models should have keyframe animations in them
 Have textures
 Should be modeled and exported using 3Ds Max

 I hope to use either FBX or VRML models. What are the pros and cons of
 each model?


Stay away from VRML if you can - it is a long obsolete format, very verbose
and difficult to parse and it is not intended as a data exchange format,
rather it is everything and the kitchen sink system - meshes, scene layout
description, animation, interactive features, sound, what not. Furthermore,
OSG loader for VRML doesn't support full VRML, only a small subset useful
for loading geometry (e.g. animations are *not* supported). Also the VRML
exported by Max is of rather poor quality, not following the standard in
some ways.

FBX requires closed source, proprietary SDK if I remember correctly, but I
haven't tried using it.

If you are targetting an OSG application, you have a decent native OSG
format exporter available for Max. That is likely your best bet, IMO.

Regards,

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


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Clement.Chu
Thanks, Robert.

I attached two screen shots.  I found that aliasing would only appears on the 
side of the cube that has not been filled.  For example, the cube size is 100 x 
100 x 20.  If the cube is fully filled colour on all voxels, there is no 
aliasing on each surface.  Once there is a section of voxels has not been 
filled colour, you can see aliasing from this section.  I tried to increase the 
sample density, the colour becomes darker but the aliasing problem has not gone.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 25 June 2012 6:29 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Antialiasing in Volume rendering

Hi Clement,

On 24 June 2012 18:14,  clement@csiro.au wrote:
   I got aliasing problem on volume rendering.  I tried to set parameter 
 samples to 8 in class osg::GraphicsContext::Traits, but I still can see 
 aliasing.  Does anyone have an solution to stop aliasing.  Thanks.

Volume rendering won't tend to be too sensitive/responsive to full
screen anti-aliasing, rather then the way to improve visual quality
with volume rendering is to increase the number of samples taken along
the ray path when sampling the 3d texture.

Could you post an example of the aliasing you are seeing, this will
probably point to the problem.

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] Parallel Rendering Problems using NVidia GPU cards in Windows

2012-06-25 Thread Jason Daly

On 06/25/2012 12:59 AM, GeeKer Wang wrote:

Hi, all

I want to use two GTS 250 cards to do the parallel rendering job based 
on OpenSceneGraph。


In my experiment, a scene full of complex models is split to 2 parts 
according to viewport。

The 2 parts are rendered in seperated windows (actually two slaves).
I hope the LEFT part is rendered in the first screen and by the first 
GPU, and the RIGHT part in the second screen and by the second GPU。

The results are a little wierd and disappointing.




Hi, Bob,

The additional card will only help if your application is GPU-bound 
(that is, waiting on the GPU to finish rendering a frame before the next 
can start).  Another possibility is that it is CPU bound (the CPU is 
taking most of the time and the GPU is waiting on it), and another is 
that it is interconnect bound (the bus between the CPU or RAM and the 
GPU is the bottleneck).


Just adding another card will not help if you're CPU-bound or 
interconnect bound, and it can actually make things worse if your scene 
isn't set up in an optimal way.  You might end up trying to cram twice 
the amount of data down the bus in order to try and keep both GPUs fed, 
and this will kill performance even more than with a single card.


One quick fix you can try is to run the osgUtil::Optimizer on your scene 
with the option VERTEX_PRETRANSFORM | INDEX_MESH | 
VERTEX_POSTTRANSFORM.  This will optimize the vertex data for the 
vertex cache common on modern GPUs, and may help with bus bandwidth.  
The other key is to be sure that your scene is organized and subdivided 
spatially, so that when you're viewing the scene, you don't end up 
duplicating draw calls across the GPUs.


Hope this helps,

--J


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


[osg-users] 3D Modeler for OpenScenegraph

2012-06-25 Thread Andrea Martini
Hi,
so far, to display a 3D model with a hierarchy of nodes already included in the 
model (such as DOF, SWITCH, LOD, ...), I used Multigen Creator, with models in 
flt format. There is the possibility of having a 3D model (not Multigen 
creator) that contains this hierarchy? For example, if you want to model a 
mechanical arm with Multigen, you can put DOF nodes in place of the elbow and 
the wrist. Then, in OSG, you can read these nodes and move mecchanical arm and 
wrist. There is another 3D modeling software (no Multigen Creator) that allows 
me to read such information from the model,  without which software I should 
have to manually insert a DOF node in the tree scene?
Do you think Blender can do that?

Thank you!

Cheers,
Andrea

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





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


Re: [osg-users] 3D Modeler for OpenScenegraph

2012-06-25 Thread Andreas Ekstrand

Hi Andrea,

Have a look at Remo 3D - an OpenSceneGraph-based and cost-effective 
alternative to Creator:

http://www.remograph.com/

Regards,
Andreas


On 2012-06-25 16:54, Andrea Martini wrote:

Hi,
so far, to display a 3D model with a hierarchy of nodes already included in the 
model (such as DOF, SWITCH, LOD, ...), I used Multigen Creator, with models in 
flt format. There is the possibility of having a 3D model (not Multigen 
creator) that contains this hierarchy? For example, if you want to model a 
mechanical arm with Multigen, you can put DOF nodes in place of the elbow and 
the wrist. Then, in OSG, you can read these nodes and move mecchanical arm and 
wrist. There is another 3D modeling software (no Multigen Creator) that allows 
me to read such information from the model,  without which software I should 
have to manually insert a DOF node in the tree scene?
Do you think Blender can do that?

Thank you!

Cheers,
Andrea

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





___
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] 3D Modeler for OpenScenegraph

2012-06-25 Thread Andrea Martini
Hi Andreas,
thank you for your quick answer.
I'm looking about software like : Blender, Lightwave, Maya and/or particolar 
exporter (i.e. Collada)

Thank you!

Cheers,
Andrea

Thank you!

Cheers,
Andrea

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





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


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Robert Osfield
Hi Clement,

On 25 June 2012 13:29,  clement@csiro.au wrote:
 Sorry, I forget to attach the images.

 Top image:  there is no aliasing.
 Bottom image:  aliasing appears on the side that has not been filled colour.

As I suspected the aliasing is down to under sampling of the ray, so
up the sample ratio.

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


Re: [osg-users] Android: Problem with static intialization in osgViewer/Scene.cpp (from r13031)

2012-06-25 Thread Robert Osfield
Hi All,

Could you please try out the Scene.cpp attached, and also checked into
svn/trunk.  What I have done is introduce a SceneSingleton structure
that has both the Scene cache and the mutex protecting it, then placed
all the access methods into the SceneSingleton, then used a static
getSceneSingleton method and a proxy object to make sure that it's
constructed during global static initialization.

Hopefully this will cure the problems under Android, let me know of
how you get on,

Robert.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
 *
 * This library is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * 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
 * OpenSceneGraph Public License for more details.
*/

#include osgViewer/Scene
#include osgGA/EventVisitor

using namespace osgViewer;

#define OSG_INIT_SINGLETON_PROXY(ProxyName, Func) static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName;

namespace osgViewer
{


struct SceneSingleton
{
SceneSingleton() {}

inline void add(Scene* scene)
{
OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
_cache.push_back(scene);
}

inline void remove(Scene* scene)
{
OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
for(SceneCache::iterator itr = _cache.begin();
itr != _cache.end();
++itr)
{
if (scene==itr-get())
{
_cache.erase(itr);
break;
}
}
}

inline Scene* getScene(osg::Node* node)
{
OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
for(SceneCache::iterator itr = _cache.begin();
itr != _cache.end();
++itr)
{
Scene* scene = itr-get();
if (scene  scene-getSceneData()==node) return scene;
}
return 0;
}

typedef std::vector osg::observer_ptrScene   SceneCache;
SceneCache  _cache;
OpenThreads::Mutex  _mutex;
};

static SceneSingleton getSceneSingleton()
{
static SceneSingleton s_sceneSingleton;
return s_sceneSingleton;
}

// Use a proxy to force the initialization of the the SceneSingleton during static initialization
OSG_INIT_SINGLETON_PROXY(SceneSingletonProxy, getSceneSingleton())

}

Scene::Scene():
osg::Referenced(true)
{
setDatabasePager(osgDB::DatabasePager::create());
setImagePager(new osgDB::ImagePager);
getSceneSingleton().add(this);
}

Scene::~Scene()
{
getSceneSingleton().remove(this);
}

void Scene::setSceneData(osg::Node* node)
{
_sceneData = node;
}

osg::Node* Scene::getSceneData()
{
return _sceneData.get();
}

const osg::Node* Scene::getSceneData() const
{
return _sceneData.get();
}

void Scene::setDatabasePager(osgDB::DatabasePager* dp)
{
_databasePager = dp;
}

void Scene::setImagePager(osgDB::ImagePager* ip)
{
_imagePager = ip;
}

void Scene::updateSceneGraph(osg::NodeVisitor updateVisitor)
{
if (!_sceneData) return;

if (getDatabasePager())
{
// synchronize changes required by the DatabasePager thread to the scene graph
getDatabasePager()-updateSceneGraph((*updateVisitor.getFrameStamp()));
}

if (getImagePager())
{
// synchronize changes required by the DatabasePager thread to the scene graph
getImagePager()-updateSceneGraph(*(updateVisitor.getFrameStamp()));
}

if (getSceneData())
{
updateVisitor.setImageRequestHandler(getImagePager());
getSceneData()-accept(updateVisitor);
}
}


Scene* Scene::getScene(osg::Node* node)
{
return getSceneSingleton().getScene(node);
return 0;
}

Scene* Scene::getOrCreateScene(osg::Node* node)
{
if (!node) return 0;

osgViewer::Scene* scene = getScene(node);
if (!scene)
{
scene = new Scene;
scene-setSceneData(node);
}

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


[osg-users] osgexport - release 0.13.0

2012-06-25 Thread Cedric Pinson
Hi,

I released a new version of the osgexporter. You can find it here 
https://github.com/cedricpinson/osgexport/raw/master/blender-2.5/build/osgexport-0.13.0.zip

Keys features:
- supports now blender-2.63 with ngones
- export materials and light as user data using the new osgt file format
- fix crash on models with armature

https://github.com/cedricpinson/osgexport

Regards,

Cedric Pinson
Provide OpenGL, WebGL services
+33 659 598 614 - 
http://cedricpinson.com - http://osgjs.org - http://sketchfab.com

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


[osg-users] [osgPPU] osgPPU with GL3

2012-06-25 Thread Joshua No
I've tried compiling osgPPU with ~ OpenGL 3.1  osg build but I'm having 
trouble.  Seems osgPPU is not ready for the current OpenGL release?  Any plans? 
 Or am I doing it wrong?

I really need to do blurs and other effects in our OSG based application. 

Thanks

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





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


[osg-users] OSG OpenCL

2012-06-25 Thread Joshua No
So I'm relatively new to OSG and I'm having trouble getting up to speed with 
all the site outages, and I'm trying to suss out the proper way to use OpenCL 
with OSG.

I see there's been some work with CUDA, but of course that doesn't help.  Seems 
like there are some straightforward ways to do OpenCL as alluded to with this 
post:

compileGLObjects problem (http://forum.openscenegraph.org/viewtopic.php?t=9868)

Although this leaves implementation details to the reader. So is this the 
recommended path to do shared memory OpenCL integration? Any other examples 
that anyone can point me too?  

There's surprising little OpenCL discussion on this form, so any help would be 
much appreciated.

Thank you very much any guidance.[/url]

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





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


Re: [osg-users] Metaflight pager code

2012-06-25 Thread Terry Welsh
Attached is the MetaFlight pager code that I wrote a while back.  Once
people who are interested in it get familiar with it,  we can discuss
whether or not it should be rolled into OSG.
--
Terry Welsh
www.reallyslick.com


metaflight.tar.gz
Description: GNU Zip compressed data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Robert Osfield
Hi Clement,

The datasets you are working of will always challenge a ray traced
sampler as there is sudden cutoff to a flat face so that any small
change in adjacent pixels can result in a enough of different sampling
as to result in a visible step.  Increasing sample density will
usually reduce the step and make it less obvious but unless you go sub
pixel it will likely remain visible.

Another route one could go is to use a different shader that samples
at texel centers rather than just a measured distance along the ray as
is done with the present shaders.

Also I think you'll find that this aliasing artefacts will be far less
noticeable on more normal volume datasets so it may be worth just
making a judgment call about whether these datasets are meaningful and
worthy of trying to optimize for.

Robert.

On 25 June 2012 17:55,  clement@csiro.au wrote:
 Hi Robert,

   Thanks for your advice.  It looks better if I increased sample density.  
 When I tried on another case, see the attachment.  If colour is filled in 
 center section only and increased the sample density, the aliasing became 
 much worse.  If I decreased the sample density, it looks better.  Dp you know 
 when should I adjust the sample density to reduce aliasing?


 Regards,
 Clement
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Tuesday, 26 June 2012 1:34 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Antialiasing in Volume rendering

 Hi Clement,

 On 25 June 2012 13:29,  clement@csiro.au wrote:
 Sorry, I forget to attach the images.

 Top image:  there is no aliasing.
 Bottom image:  aliasing appears on the side that has not been filled colour.

 As I suspected the aliasing is down to under sampling of the ray, so
 up the sample ratio.

 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] osgOpenFlight LightPointRecords parsing SEQUENCE pallet color as RGB color

2012-06-25 Thread Brad Colbert
Hi folks,

OSG 3.0.1
OpenFlight 16.4

I've been looking at the code that loads light points in the OpenFlight loader. 
 I was putting together a test and ran into an issue.  It appears that in the 
FLASHING_SEQUENCE section in LightPointsRecords.cpp:316 (IndexedLightPoint) 
that the loader is putting the color index value into the RGB component of the 
color sequence instead of the RGB values looked up from the color pallet.  

The base color of the lightpoint appears correct which has an index of 639 
(255,0,0).

The sequence is configured to go from blue to green, but what we see is Red, 
darker red.

Color index values for the sequence
383 (0,0,255)
511 (0,255,0)

Printing out the values in the sequence at the loader before they are added to 
the sequence we get:

LPAnimation::FLASHING_SEQUENCE 1 : 0.498039, 0.00392157, 0, 0
LPAnimation::FLASHING_SEQUENCE 1 : 1, 0.00392157, 0, 0

and looking at the bits of the RGB components concatenated we get:

383, 511

Which is the original color index values and not the RGB components that would 
be the result of the lookup.

Can anyone point to where the lookup of the RGB components should happen so I 
can fix this?

Also, I've attached a simple model for your viewing pleasure.

Thank you!

Cheers,
Brad

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




Attachments: 
http://forum.openscenegraph.org//files/pole_red_907.zip


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


Re: [osg-users] ECEF to openGl

2012-06-25 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Are you using OSG or OpenGL?

Since you're using ECEF CS, I'm assuming you want to set things up for
viewing on a spheroid. 

If you're using OSG, you can do the following using OSG's EllipsoidModel
class (earth instance below) to set up viewing given a position and a
look-at location in geodetic CS. It uses your example numbers. I would
have chosen an altitude of something  0.0 to get height above
ellipsoid... 

double geoEyeLat = 15.0;
double geoEyeLon = 10.0;
double alt = 0.0;
double geoLookatLat = geoEyeLat + 0.01;
double geoLookatLon = geoEyeLon;
osg::Vec3d eye;
osg::Vec3d up;
osg::Vec3d lookat;
earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(geoEyeLat),
osg::DegreesToRadians(geoEyeLon), alt, 

eye[0], eye[1], eye[2]);
up = earth-computeLocalUpVector(eye[0], eye[1], eye[2]);
earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(geoLookatLat),
osg::DegreesToRadians(geoLookatLon), alt, 

lookat[0], lookat[1], lookat[2]);
osg::Matrixd t_matrix;
t_matrix.makeLookAt(eye, lookat, up);
view-getCamera()-setViewMatrix(t_matrix);

Hope this helps...

-Shayne



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Pilip
Rogati
Sent: Thursday, June 14, 2012 5:16 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] ECEF to openGl

Hi.
I have a big problem. not sure this is the good place to post this, but
here goes.
I am working on some aircraft simulation game... Problem for me are
coordinates conversion.
All my coordinates are in ECEF. 
I have problem setting up my camera properly and then later transforming
ECEF positions of aircraft so they can be rendered correctly. can
someone please tell me the right way to do it, or even better some code
would be nice.

for example. my camera is at lat 15, lon 10, elevation 0.
i want it to look at lat 15.01, lon 10, elevation 0.
I convert both of theses to ecef, so i have my cameraPosition and
cameraTarget.
how to convert models ecef position so i have opengl x-right, y-up,
z-forward?


Thank you!

Cheers,
Pilip

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





___
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] Need some help - Adding a CameraManipulator to a second camera.

2012-06-25 Thread Sebastian Sack
Hi community,

i have a little problem:

i created a second camera, showing my scene from another viewing point, like in 
this tutorial (with render to texture as an overlay)


now i want to add a CameraManipulator to this camera.

my normal camera has a manipulator, too. you can move with the arrow keys in 
the scene. (viewer.setCameraManipulator(new MyManipulator))

now i want to turn the second camera around with some other keys ('a' and 'd')

can you help me out?

thanks a lot.

osgdogg

ps: i know - my english isn't that good

... 

Thank you!

Cheers,
Sebastian

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





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


Re: [osg-users] [3rdparty] ShadowedScene doesn't display HUD Camera

2012-06-25 Thread Alex Weber
solved it, was some problem with the hiearchy of the scenegraph :)

Alex

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





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


Re: [osg-users] [osgPPU] DoF blur issues for antialiased text

2012-06-25 Thread Mike Wozniewski
Hi all,

I'm still struggling with this and just wanted to add some extra details.

The problem is that the blur around text near the camera is not being combined 
with blur further back. It's almost like the blur is being drawn from front to 
back while text (rendered as glyphs with alpha channel) are being drawn from 
back to front. Is that possible?

I imagine that this would need to be fixed on the shader side. ie, in 
depth_of_field_fp.glsl (?):


Code:
void main(void)
{
vec2 inTex = gl_TexCoord[0].st;

// compute distance to the viewer
float a = zFar / ( zFar - zNear );
float b = zFar * zNear / ( zNear - zFar );

float depth = texture2D( texDepthMap, inTex ).x;
float dist = b / ( depth - a );

// get color map and blurred color map values
vec4 colorValue = texture2D (texColorMap, inTex).rgba;
vec4 blurredValue1 = texture2D ( texBlurredColorMap, inTex).rgba;
vec4 blurredValue2 = texture2D ( texStrongBlurredColorMap, inTex).rgba;

// now compute the bluriness value
float blur = clamp(abs(dist - focalLength) / focalRange, 0.0, 1.0);
float factor1 = 1.0;
float factor2 = 0.0;

// compute blend factors
if (blur  0.5)
factor2 = (blur - 0.5) * 2.0;
else
factor1 = blur * 2.0;

// the resulting color value is the combination of blurred and non-blurred 
map
vec4 result = mix(colorValue, blurredValue1, factor1);
gl_FragColor = mix(result, blurredValue2, factor2);
}



ie, will gl_FragColor correctly combine previously drawn alpha values?

Any help would be greatly appreciated.

-Mike

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





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


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Clement.Chu
Hi Robert,

  If I extended the RayTracedTechnique and override the default VERTEX and 
FRAGMENT glsl codes to replace my own glsl code, which will measure distance 
along the ray.  Are you talking about this case to overcome the aliasing 
artifact ?  


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Tuesday, 26 June 2012 4:41 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Antialiasing in Volume rendering

Hi Clement,

The datasets you are working of will always challenge a ray traced
sampler as there is sudden cutoff to a flat face so that any small
change in adjacent pixels can result in a enough of different sampling
as to result in a visible step.  Increasing sample density will
usually reduce the step and make it less obvious but unless you go sub
pixel it will likely remain visible.

Another route one could go is to use a different shader that samples
at texel centers rather than just a measured distance along the ray as
is done with the present shaders.

Also I think you'll find that this aliasing artefacts will be far less
noticeable on more normal volume datasets so it may be worth just
making a judgment call about whether these datasets are meaningful and
worthy of trying to optimize for.

Robert.

On 25 June 2012 17:55,  clement@csiro.au wrote:
 Hi Robert,

   Thanks for your advice.  It looks better if I increased sample density.  
 When I tried on another case, see the attachment.  If colour is filled in 
 center section only and increased the sample density, the aliasing became 
 much worse.  If I decreased the sample density, it looks better.  Dp you know 
 when should I adjust the sample density to reduce aliasing?


 Regards,
 Clement
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Tuesday, 26 June 2012 1:34 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Antialiasing in Volume rendering

 Hi Clement,

 On 25 June 2012 13:29,  clement@csiro.au wrote:
 Sorry, I forget to attach the images.

 Top image:  there is no aliasing.
 Bottom image:  aliasing appears on the side that has not been filled colour.

 As I suspected the aliasing is down to under sampling of the ray, so
 up the sample ratio.

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


Re: [osg-users] [osgPlugins] Which model format to use? FBX vs. VRML

2012-06-25 Thread Jean-Sébastien Guay

Hello,


I hope to use either FBX or VRML models. What are the pros and cons
of each model?


I will echo Jan's suggestions and add a bit more info.

VRML support is pretty bad in current content creation tools (I've 
tested with Max and Maya primarily). The problem is mostly the way 
things are represented is different for each tool's exported VRML, and 
the amount of things in your scene that will make it into OSG is pretty low.


FBX is a bit better I have found. Both Max and Maya's exported FBX files 
have pretty good coverage of what is in your scene, and the OSG FBX 
loader is pretty good (and its primary author Michael Platings has been 
very responsive in the past, though it's been a while since I've seen 
him post on the list).


Jan's suggestion to go with a native exporter is spot-on. the Max 
exporter osgExp is very good, as is the Maya exporter osg2maya (just 
google those names). Their authors are (or have been) regular posters on 
this list, so bugs or things broken by changes in OSG's API (though 
infrequent) are normally quickly fixed. And the advantage of getting an 
OSG file directly is very interesting, you can write scripts that will 
add information to nodes directly in Max and things like that.


Essentially, this advantage is huge. You go directly from Max or Maya to 
.osg format, there is no intermediate format in between where 
information can get lost in the conversion... Whoever makes the models 
in Max or Maya has much better control over how their work will look in 
the final application, because the translation is direct, there's no 
need to figure out by trial and error which feature is not supported 
that makes it look like that and how to work around these limitations.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay  jean_...@videotron.ca
http://whitestar02.dyndns-web.com/


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


Re: [osg-users] 3D Modeler for OpenScenegraph

2012-06-25 Thread Jean-Sébastien Guay

Hello Andrea,


Do you think Blender can do that?


Not only Blender, but 3D Studio Max, Maya, Softimage XSI, genrally all 
3D modeling software will allow you to organize your scene in terms of 
groups, transforms (of which DOF is one specialization), LOD and so on.


Then the question becomes, how do I import the models created in these 
software tools in such a way that this hierarchy makes it into the OSG 
program?


Have a look at a post I just wrote that talks about this. The thread is 
called Which model format to use? FBX vs. VRML. In a nutshell, there 
are native plugins for Max, Maya and Blender (maybe others too) which 
export the scene from these programs directly into native .osg format, 
and these will generally preserve as much of the scene hierarchy as they 
can.


So then my advice is, choose whichever tool your artists / content 
creation people want to use, and then start using the OSG plugin for 
that tool. If the plugin has some shortcomings (for example last I used 
it the Maya plugin maya2osg didn't support LOD nodes) then work with the 
authors to help implement the missing feature. Open source at its best!


Hope this helps,

J-S
--
__
Jean-Sebastien Guay  jean_...@videotron.ca
http://whitestar02.dyndns-web.com/


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


[osg-users] AlphaPixel (and OSG?) swag and apparel?

2012-06-25 Thread Chris Hanson
  Hey, I just finished setting up a CafePress store for AlphaPixel apparel
and logo stuff (mostly so I could make myself some).

http://www.cafepress.com/alphapixel

  I set the margins down really low, so I think I get about 50 cents of
profit on typical items, but if any of you want to show your support for
AlphaPixel, go buy yourself some stuff. Maybe I'll earn enough to buy
myself a few more shirts.


  It occurred to me when I was done that I could set up a similar set of
customized logo stuff for the OpenSceneGraph logo.

  Would anyone want that sort of thing?

  Would anyone be offended if I did so? I don't recall exactly what license
the OSG logo is under, but I don't want to step on any toes here.


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK

2012-06-25 Thread Mike Hatcher
Hi,

I'm having the same problem.  I'm also running Ubuntu 12.04.  I know the code 
works because I have it running under Fedora 13.

The critical line is:
g++  -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS  -L/usr/X11R6/lib64 
-L../../../../local/lib -L../../../../devel/lib/Linux64  -shared  DAHud.o 
DynamicManager.o EnvironmentManager.o HudManager.o StaticManager.o TileGroup.o 
VectionViewMode.o vectionVisuals.o vectionVisUtils.o VehicleCameraPlatform.o 
ViewModeFirstPerson.o ViewModeThirdPerson.o VisData.o Visuals.o   -losgSim 
-losgGA -losgViewer -losg -losgUtil -losgDB -losgParticle -losgText -losgSim 
-losgFX -lOpenThreads -lsimApp -lSimRenderer -ljpeg -lxclApp -lboost_signals -o 
Visuals.so

The -L in the above example in my case does need to be there because it is also 
linking against Producer.  Because it is a shared library everything compiles 
just fine.  It's when it runs that I have a problem.  I wind up with:

undefined symbol: _ZN6osgSim12DOFTransform8traverseERN3osg11NodeVisitorE

I've tried adding every osg* lib I can think of but it makes no difference.  
Any ideas would be much appreciated!


Thank you!

Cheers,
Mike

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





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