[osg-users] Techniques to shift CPU load to GPU

2016-05-17 Thread Rajani Godson
Hi,
Iam using OSG Engine as the rendering tool for my application currently iam 
facing frame delay because my CPU load is 100% but my GPU is taking only 20 to 
40 % usage.How to  
 shift CPU load to GPU.
Graphics Card:-Nvidia Quadro 6000
Operating System:Ubuntu 12.4LTS

Thank you!

Cheers,
Rajani

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





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


[osg-users] Up vectors in setHomePosition with FirstPersonManipulator doesn't seems to affect camera view changes

2016-05-17 Thread Simone Rapposelli
Hi,

I am newbie, so please excuse me for my possible blunders...

I am trying to set eye, center and up vector in setHomePosition of a 
FirstPersonManipulator.
It works correctly but if I set whatever components in the "up" vector, 
anything change in the viewer (I would like to have such a roll behavior).
What am I doing wrong? 

Thank you!

Cheers,
Simone :'

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





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


Re: [osg-users] extending the osgWidget example osgWidgetMenu

2016-05-17 Thread Robert Kiser
Thank you for this reply, Mr. Osfield.

I didn't want to be a pest, but was hoping that someone would see this and have 
a quick fix in their back pocket.

Perhaps I can message this gentleman and maybe Jeremy Moles as well to see if 
they might have a suggested path for me to try.

Thanks,

Bob Kiser

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





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


Re: [osg-users] extending the osgWidget example osgWidgetMenu

2016-05-17 Thread Robert Osfield
Hi Bob,

On 17 May 2016 at 19:29, Robert Kiser  wrote:
> So, was this question too ridiculously easy as to be worth answering or was 
> it too hard for anyone to answer?
>
> Either way, I'm still stuck.

Unfortunately Cedric Pinson the osgWidget author is so busy with
osgjs/sketchfab that he doesn't frequent the forum/mailing much these.
He's the best person to answer your question.

I don't personally have much experience with osgWidget so have to
defer to others who actively use it.

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


Re: [osg-users] extending the osgWidget example osgWidgetMenu

2016-05-17 Thread Robert Kiser
So, was this question too ridiculously easy as to be worth answering or was it 
too hard for anyone to answer?

Either way, I'm still stuck.

Thanks in advance,

Bob Kiser

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





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


Re: [osg-users] Windows 8.1 DPI-aware scaling: Problem and solution

2016-05-17 Thread Björn Blissing
Hi Paul,

Regarding the error when you are trying to run the script: I suspect that you 
have another name for your build target then TARGET_TARGETNAME. This is only a 
variable name that I use for my build target names. Yours is probably something 
completely different. Check your what the first variable in ADD_EXECUTABLE or 
ADD_LIBRARY in your CMake script and use that variable instead of 
TARGET_TARGETNAME.

Regarding your second question: The script is complete, when you are amending 
manifests to DLL files you need to change the characters #1 to #2 in the 
script. 

I have updated my gist comment to reflect this:
https://gist.github.com/bjornblissing/6fc452fe7ec1fdfe3419#gistcomment-1317136

Hope that solves your issues.

Regards
Björn

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





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


Re: [osg-users] How does PIXEL_SIZE_ON_SCREEN work

2016-05-17 Thread Robert Osfield
Hi Bruno,

On 17 May 2016 at 14:23, Bruno Oliveira  wrote:
> Thank you both. The problem I'm having is relative to the point clouds
> density: too dense clouds will result in poor rendering performance if I
> tune my LOD to render sparser clouds. I can't find a good trade-off for the
> LOD resolution that fits both cases. I will probably subclass the LOD class.

Rendering very large point data clouds is specialist problem with very
specific needs compared to rendering traditional polygonal scenes.  To
get the best results for your particular problem then coming up with
custom approaches may well be best.

One trick I've used in the past with point clouds is to trade point
size for point density - this works well when the point clouds
represent surface data such as collected by radar or laser scanning of
3D objects or environments.  If you have normal and colour data using
point sprites can work really well at filling in the gaps between
points, which in turn means you can get away with lower point density
and still have a compelling visual.

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


Re: [osg-users] Arcball Camera without unexpecting 'roll' of the camera

2016-05-17 Thread Jan Ciger
On Tue, May 17, 2016 at 2:35 PM, Daniel Neos  wrote:

> Unfortunalety there is no feature "throw" feature. My class inherits from
> osgGA::GUIEventHandler and there is no setAllowThrow implemented, as far as
> I know.
>
>
And if I am zooming in, sometimes the effect gets worse and the camera is
> hardly to control. Maybe there is an error in my rotation setup?
>


That sounds like a classic case of gimbal lock to me. You are rotating
using 2 Euler angles rotations, so it is easy to align the axes in exactly
"the wrong way" and trigger the singularity when approaching +- 90 degrees.

You may want to look at this code:
https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball

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


Re: [osg-users] How does PIXEL_SIZE_ON_SCREEN work

2016-05-17 Thread Bruno Oliveira
Thank you both. The problem I'm having is relative to the point clouds
density: too dense clouds will result in poor rendering performance if I
tune my LOD to render sparser clouds. I can't find a good trade-off for the
LOD resolution that fits both cases. I will probably subclass the LOD class.

Thank you once again.

2016-05-17 12:07 GMT+01:00 Robert Osfield :

> Hi Bruno,
>
> If you have some very specific metrics you'd like to use to choose LOD
> levels that aren't supported by the osg::LOD then you could subclass
> from osg::Group and implement your own Level of Detail behavior
>
> 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] Arcball Camera without unexpecting 'roll' of the camera

2016-05-17 Thread Daniel Neos
Unfortunalety there is no feature "throw" feature. My class inherits from 
osgGA::GUIEventHandler and there is no setAllowThrow implemented, as far as I 
know.

Here is (part of) my actual mouse dragging code:


Code:


bool CameraHandler::handle(const osgGA::GUIEventAdapter & ea, 
osgGA::GUIActionAdapter & us)
{
osgViewer::View* viewer = dynamic_cast();
osg::Matrixd viewMatrix = viewer->getCamera()->getViewMatrix();
osg::Vec3d translation = viewMatrix.getTrans();

osg::Matrixd rotationX = osg::Matrix::rotate(deltaX  * 0.5, 
osg::Y_AXIS);
osg::Matrixd rotationY = osg::Matrix::rotate(-deltaY * 0.5, 
osg::X_AXIS);
osg::Matrixd preTrans = osg::Matrix::identity();
osg::Matrixd postTrans = osg::Matrix::identity();

osg::Vec3d bsCenter = osg::Vec3d(137.69, 284.17, 3305.0); // 
scene is (almost) static
m_rotationPoint = osg::Vec3(0.0, 0.0 , 0.0); // good rotation 
point for 

m_rotationPoint = translation - bsCenter; // good rotation 
point for 

preTrans.setTrans(-m_rotationPoint);
postTrans.setTrans(m_rotationPoint);

viewMatrix = viewMatrix * (preTrans * rotationX * rotationY * 
postTrans);
viewer->getCamera()->setViewMatrix(viewMatrix);

// ensure fixed point to look at
osg::Vec3d eye, center, up;
viewer->getCamera()->getViewMatrixAsLookAt(eye, center, up);
if (focusPointFlag)
{
viewer->getCamera()->setViewMatrixAsLookAt(eye, bsCenter , 
up);
}

return true;
}





And if I am zooming in, sometimes the effect gets worse and the camera is 
hardly to control. Maybe there is an error in my rotation setup?

Thank you!

Cheers
Daniel Neos


cbuchner1 wrote:
> Could it be that the "throw" feature of the camera manipulator is responsible 
> for the roll?
> 
> If so, try disabling it.
> 
> 
> Also, post source code if you want specific help with a specific issue in 
> your implementation.
> 
> 
> Christian
> 
> 
> 
> 



Code:




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





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


Re: [osg-users] How does PIXEL_SIZE_ON_SCREEN work

2016-05-17 Thread Robert Osfield
Hi Bruno,

If you have some very specific metrics you'd like to use to choose LOD
levels that aren't supported by the osg::LOD then you could subclass
from osg::Group and implement your own Level of Detail behavior

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


Re: [osg-users] Windows 8.1 DPI-aware scaling: Problem and solution

2016-05-17 Thread Paul McIntosh
Hi Björn,

Thanks for the info but sorry I am having trouble getting this to work (CMake 
3.4.0)...


Code:
CMake Error at CMakeLists.txt:1353 (ADD_CUSTOM_COMMAND):
  add_custom_command Wrong syntax.  A TARGET or OUTPUT must be specified.



I copied dpiawarescaleing.manifest and CMakeMainifest.txt to the OSG based dir 
and appended it to CMakeLists.txt

cat CMakeMainifest.txt >> CMakeLists.txt


> If you are amending manifests to DLL-files you will need to change the #1 to 
> #2 in the CMAKE example above. 


I only see #1 is the code incomplete?

Cheers,

Paul[/code]

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





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


Re: [osg-users] Arcball Camera without unexpecting 'roll' of the camera

2016-05-17 Thread Christian Buchner
Could it be that the "throw" feature of the camera manipulator is
responsible for the roll?
If so, try disabling it.

Also, post source code if you want specific help with a specific issue in
your implementation.

Christian


2016-05-16 14:59 GMT+02:00 Daniel Neos :

> Hi everyone,
>
> I have implemented a Cameramanipulator by myself, because I need more
> individually control over the camera in the scene, like rotating around a
> specific axis.
>
> I let osg compute the Boundingsphere of my scene and set the rotationpoint
> and the lookat-point or center-point at the center of the Boundingsphere.
>
> My rotation works like this
>
> 1.) Translate the camera to the center of the Boundingsphere
> (Multiplicated from the right side of the viewmatrix of the camera fist)
>
> 2.) Rotate the viewmatrix by the OSG::x_axis and OSG::y_axis (depending on
> the mousemovement)
>
> 3.) Translate the camera back with the vector from step 1.
>
> 4.) Now with the last step I ensure, that the camera stays focused at the
> samepoint by getting the eye, center and up vector and reseting the center
> vector, while eye and up remains the same.
>
> This usually works fine and it is easy to navigate through the scene with
> the mouse, but as I reach some regions the camera unexpectedly seem to
> rotate around its own z-axis which results in to a 'roll'.
>
> How can I prevent this behaviour? Sample code with arcball camera would be
> appreciated too :)
>
> Thank you!
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67113#67113
>
>
>
>
>
> ___
> 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] How does PIXEL_SIZE_ON_SCREEN work

2016-05-17 Thread Jordi Torres
Hi Bruno,


We also work with pointclouds in PointCloudViz ( www.pointcloudviz.com ) :)


2016-05-17 11:08 GMT+02:00 Bruno Oliveira :

> I am rendering point clouds.
>
> What I want to do is to guarantee a certain point density is displayed. I
> know the number of points in each LOD and I know the bounding boxes of
> those LOD's. Can't I calculate a certain resolution value to pass to the
> LOD?
>
>
In the document I sent it states for PIXEL_SIZE_ON_SCREEN :
"The current screen-space extent that OSG uses in this mode is determined
by constructing a sphere that contains all of the model in question, then
3D projecting the diameter of the sphere into screen space and measuring
the diameter in pixels."

With respect to that it could be argued that a sphere projected in
ScreenSpace ( perspective ) is an ellipse so it has 2 diameters. Anyway
that measures are kind of orientative if you think in the major diameter it
will work. So you need to assign ranges to your LOD's based on this
assumption. You can try values ( i.e. from 500 to 1000 ) and tweak them
iteratively.

Anyway if you need a better understanding take a look to the traverse
method of PagedLOD node (
https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/PagedLOD.cpp#L125
)

Hope it helps.



> 2016-05-16 11:54 GMT+01:00 Bruno Oliveira  >:
>
>> Thank you very much ! I understand very well the concept now, But I can't
>> still figure out a good range value, and based on what
>>
>> 2016-05-16 11:13 GMT+01:00 Jordi Torres :
>>
>>> Hi Bruno,
>>>
>>> Take a look to this document from Chris ( Alphapixel )
>>> http://alphapixel.com/wp-content/uploads/2015/04/LOD-Level-of-detail-in-OpenSceneGraph-OSG.pdf
>>> .
>>> It could shed some light on LODding.
>>>
>>> Cheers.
>>>
>>> 2016-05-16 12:03 GMT+02:00 Bruno Oliveira <
>>> bruno.manata.olive...@gmail.com>:
>>>
 Hello,

 I am using a LOD but I don't understand how PIXEL_SIZE_ON_SCREEN range
 mode works.


 I am doing

 lod->setRangeMode(osg::LOD::RangeMode::PIXEL_SIZE_ON_SCREEN);

 but what parameters can I use to configure this mode?

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

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


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


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


Re: [osg-users] How does PIXEL_SIZE_ON_SCREEN work

2016-05-17 Thread Bruno Oliveira
I am rendering point clouds.

What I want to do is to guarantee a certain point density is displayed. I
know the number of points in each LOD and I know the bounding boxes of
those LOD's. Can't I calculate a certain resolution value to pass to the
LOD?

2016-05-16 11:54 GMT+01:00 Bruno Oliveira :

> Thank you very much ! I understand very well the concept now, But I can't
> still figure out a good range value, and based on what
>
> 2016-05-16 11:13 GMT+01:00 Jordi Torres :
>
>> Hi Bruno,
>>
>> Take a look to this document from Chris ( Alphapixel )
>> http://alphapixel.com/wp-content/uploads/2015/04/LOD-Level-of-detail-in-OpenSceneGraph-OSG.pdf
>> .
>> It could shed some light on LODding.
>>
>> Cheers.
>>
>> 2016-05-16 12:03 GMT+02:00 Bruno Oliveira <
>> bruno.manata.olive...@gmail.com>:
>>
>>> Hello,
>>>
>>> I am using a LOD but I don't understand how PIXEL_SIZE_ON_SCREEN range
>>> mode works.
>>>
>>>
>>> I am doing
>>>
>>> lod->setRangeMode(osg::LOD::RangeMode::PIXEL_SIZE_ON_SCREEN);
>>>
>>> but what parameters can I use to configure this mode?
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>>
>> --
>> Jordi Torres
>>
>>
>>
>> ___
>> 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] glClearBufferData function support

2016-05-17 Thread Sebastian Messerschmidt

Hi Robert, Luca

There is the BufferObject/GLBufferObject class. So maybe clearing the 
buffer data could be a member function of the BufferOject base class.


Cheers
Sebastian

On 17 May 2016 at 07:59, Luca Bianconi  wrote:

Is the opengl 4.3 function glClearBufferData supported by osg? If yes how can i 
use it? If no, is there a way to use it?

Just done a greap of OSG master and it doesn't have glClearBufferData
so the answer for now is no.

Implementing in your own local code you could use a draw callback,
such as an osg::Camara pre/post DrawCallback.   The other approach
would be to add the function entry point into include/osg/GLExtensions
and add where it's appropriate to add the call into the OSG to be
conviniently support it.  I haven't yet looked at the specs of the
function so can only guess at where it might be supported.  Adding it
into the core OSG would mean it could be part of the up coming
OSG-3.6.

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] glClearBufferData function support

2016-05-17 Thread Robert Osfield
Hi Luca,

On 17 May 2016 at 07:59, Luca Bianconi  wrote:
> Is the opengl 4.3 function glClearBufferData supported by osg? If yes how can 
> i use it? If no, is there a way to use it?

Just done a greap of OSG master and it doesn't have glClearBufferData
so the answer for now is no.

Implementing in your own local code you could use a draw callback,
such as an osg::Camara pre/post DrawCallback.   The other approach
would be to add the function entry point into include/osg/GLExtensions
and add where it's appropriate to add the call into the OSG to be
conviniently support it.  I haven't yet looked at the specs of the
function so can only guess at where it might be supported.  Adding it
into the core OSG would mean it could be part of the up coming
OSG-3.6.

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


[osg-users] glClearBufferData function support

2016-05-17 Thread Luca Bianconi
Hi,

Is the opengl 4.3 function glClearBufferData supported by osg? If yes how can i 
use it? If no, is there a way to use it?

Thank you!

Cheers,
Luca

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





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