Re: [osg-users] Frame rate hit using OSG 2

2007-09-08 Thread Robert Osfield
On 9/7/07, Gert van Maren [EMAIL PROTECTED] wrote:
 Hi Donn,

 We went across this week and are getting the same. About 40% drop in
 framerate with certain paged data sets.

Curious.  2.x and 1.2 are still fundamentally the same scene graph.
CullVisitor and DatabasePager changed little in the 1.2 to 2.0 period.
 Changes to CullVisitor principally lie in the handling of RTT
Camera's.

Recently I checked in a range of changes to DatabasePager to manage
threading better under Windows, and to add compile context support,
but neither of these I'd expect to see an impact on cull.

In the SVN version there is now default use of mutexes in the
rendering backend which has slowed the cull traversal a bit, this code
is still experimental and subject to further changes.

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


Re: [osg-users] Error in Image.cpp

2007-09-08 Thread Robert Osfield
Hi Art, J-S et al.

The - was meant to be a = and a case of finger wobble and the me not
spotting any compiler warning for it.   The has now been fixed and
checked in.

Curious I'm have aggressive warnings turned out right now, as I've
been merging warning fixes and make fixes of my own.  I guess with
agressive warning so many silly errors go buy the important ones get
swamped.

Robert.

On 9/7/07, Art Tevs [EMAIL PROTECTED] wrote:
 Yes you are right.

 it should be binding2DArray = GL_FALSE;

 Hmm, strange why does compiler do not see that this is
 a non-sense instruction...
 Are the -Wall Flags activated, Robert?


 Art


 --- Jean-Sébastien Guay
 [EMAIL PROTECTED] schrieb:

  Hello,
 
  In Image.cpp as of about 5 minutes ago (14:50 EST)
  there is this:
 
   if
  (extensions2DArray-isTexture2DArraySupported())
   {
 
  glGetBooleanv(GL_TEXTURE_BINDING_2D_ARRAY_EXT,
  binding2DArray);
   }
   else
   {
   binding2DArray - GL_FALSE;
   }
 
  I suspect the else should be
 
   binding2DArray = GL_FALSE;
 
  right?
 
  J-S
  --
 
 __
  Jean-Sebastien Guay
  [EMAIL PROTECTED]
 
  http://whitestar02.webhop.org/
 
 
 
  This message was sent using IMP, the Internet
  Messaging Program.
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 



   Jetzt Mails schnell in einem Vorschaufenster überfliegen. Dies und viel 
 mehr bietet das neue Yahoo! Mail - www.yahoo.de/mail
 ___
 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] Help - trying to get a wxWidgets implementation of osgViewer::Viewer working!

2007-09-08 Thread Roger James
I have just re-implemented my wxWindows implementation of osgViewer to use
osgViewer::Viewer instead of the old SimpleViewer. The code is very heavily
based on the osgviewerWX example (as was the old version!).

 

I have come across two problems. 1. I cannot get the TrackballManipilator to
work. 2. I get an assert on program exit because the view is being deleted
whilst the window is hidden.

 

Looking at 1. - I can see in the debugger that it appears that trackball
code is correctly handling all the mouse events but main scene view matrix
is not being updated. I have got somewhat lost trying to track the sequence
of events by which this should happen. Can anyone give me any guidance on
this? I am suspicious of the fact that requestRedraw and
requestContinuousUpdate are empty implementations., but this may be a red
herring(a false conclusion).

 

As far as 2. goes it is a feature of my app the it can exit whilst the popup
3d window is hidden, it used to work with the simpleViewer based code.
However I suspect I need to do more clean up now?  Any comments?

 

I have attached my source files.

 

Roger

 

#pragma once

#include osg/node
#include osgViewer/Viewer
#include wx/glcanvas.h

class GraphicsWindowWX: public wxGLCanvas, public osgViewer::GraphicsWindow
{
public:
GraphicsWindowWX(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize, long style = 0,
const wxString name = wxT(TestGLCanvas));

~GraphicsWindowWX();

void init();

void OnPaint(wxPaintEvent event);
void OnSize(wxSizeEvent event);
void OnEraseBackground(wxEraseEvent event);
void OnKeyDown(wxKeyEvent event);
void OnKeyUp(wxKeyEvent event);
void OnMouse(wxMouseEvent event);

//
// GraphicsWindow interface
//

void grabFocus();
void grabFocusIfPointerInWindow();
void useCursor(bool cursorOn);

bool makeCurrentImplementation();
void swapBuffersImplementation();

// note implemented yet...just use dummy implementation to get working.
virtual bool valid() const { return true; }
virtual bool realizeImplementation() { return true; }
virtual bool isRealizedImplementation() const  { return true; }
virtual void closeImplementation() {}
virtual bool releaseContextImplementation() { return true; }

private:
wxCursor _oldCursor;

DECLARE_EVENT_TABLE()
};

class CWxOsgViewer : public wxFrame
{
public:
CWxOsgViewer(wxWindow *pParent, long lStyle = wxDEFAULT_FRAME_STYLE);
~CWxOsgViewer(void);
void SetRootNode(osg::Node *pNode);

protected:
void OnIdle(wxIdleEvent event);
DECLARE_EVENT_TABLE()
osg::ref_ptrosgViewer::Viewer m_p3dViewer;
osg::ref_ptrosg::Node m_pRootNode;
};
// For compilers that support precompilation, includes wx.h.
#include wx/wxprec.h

#ifndef WX_PRECOMP
#include wx/wx.h
#endif

#include WxOsgViewer.h
#include osgViewer/ViewerEventHandlers
#include osgGA/TrackballManipulator


BEGIN_EVENT_TABLE(CWxOsgViewer, wxFrame)
EVT_IDLE(CWxOsgViewer::OnIdle)
END_EVENT_TABLE()


CWxOsgViewer::CWxOsgViewer(wxWindow *pParent, long lStyle) : wxFrame(pParent, 
wxID_ANY, _(Triangulation Results), wxDefaultPosition, wxSize(600, 400), 
lStyle)
{
GraphicsWindowWX *pGraphicsWindow = new GraphicsWindowWX(this);
m_p3dViewer = new osgViewer::Viewer;
wxPoint ActualPosition = pGraphicsWindow-GetPosition();
wxSize ActualSize = pGraphicsWindow-GetSize();

m_p3dViewer-getCamera()-setGraphicsContext(pGraphicsWindow);
m_p3dViewer-getCamera()-setViewport(ActualPosition.x, 
ActualPosition.y, ActualSize.x, ActualSize.y);
m_p3dViewer-addEventHandler(new osgViewer::StatsHandler);
m_p3dViewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);

m_p3dViewer-setSceneData(new osg::Node);
m_p3dViewer-setCameraManipulator(new osgGA::TrackballManipulator);
}

CWxOsgViewer::~CWxOsgViewer(void)
{
}

void CWxOsgViewer::SetRootNode(osg::Node *pNode)
{
m_p3dViewer-setSceneData(pNode);
}


void CWxOsgViewer::OnIdle(wxIdleEvent event)
{
if (IsShown()) // If another app window is using the idle loop we will 
contine to get
// idle events even if the window is 
hidden
m_p3dViewer-frame();
}

BEGIN_EVENT_TABLE(GraphicsWindowWX, wxGLCanvas)
EVT_SIZE(GraphicsWindowWX::OnSize)
EVT_PAINT(GraphicsWindowWX::OnPaint)
EVT_ERASE_BACKGROUND(GraphicsWindowWX::OnEraseBackground)
EVT_KEY_DOWN(GraphicsWindowWX::OnKeyDown)
EVT_KEY_UP(GraphicsWindowWX::OnKeyUp)
EVT_MOUSE_EVENTS(GraphicsWindowWX::OnMouse)
END_EVENT_TABLE()

GraphicsWindowWX::GraphicsWindowWX(wxWindow *parent, wxWindowID id,
const wxPoint pos, const wxSize size, long style, const wxString name)
: 

[osg-users] osgText precision issue

2007-09-08 Thread sherman wilcox
I'm having a bit of trouble with mangled text if I zoom in to close.
This text is on an osgDem generated ellispoid. In the attached
screenshots, the text appears correctly in text2.jpg. However, in
text3.jpg you'll see the problem. This only occurs if I zoom in really
close to the text. If I back off the camera a bit, the text reverts
back to the correct state.

My questions are:

1) What's causing this?
2) How best to address the issue?
attachment: text3.jpgattachment: text2.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgText precision issue

2007-09-08 Thread beelzebob999-osg

Years ago, we wrote an earth-viewer program in which
we had a requirement that we had to be able to zoom
all the way from space, down to an item the size of a
quarter and smaller, smoothly.  Your images look like
an issue we had at the time, which was a floating
point precision problem.  The openGL stacks we had
apparently could only use floats, and did all matrix
multiplication as floats (even if the matrices we
passed in were doubles).  The fix was to maintain our
own matrix stack (of doubles) and do all matrix
multiplication ourselves, and load the finished matrix
into GL on each frame.  

I don't know if it's possible to configure OpenGL now
to use doubles for its matrix stacks instead of
floats, but, if so, I bet that would fix your problem.
 

--- sherman wilcox [EMAIL PROTECTED] wrote:

 I'm having a bit of trouble with mangled text if I
 zoom in to close.
 This text is on an osgDem generated ellispoid. In
 the attached
 screenshots, the text appears correctly in
 text2.jpg. However, in
 text3.jpg you'll see the problem. This only occurs
 if I zoom in really
 close to the text. If I back off the camera a bit,
 the text reverts
 back to the correct state.
 
 My questions are:
 
 1) What's causing this?
 2) How best to address the issue?
  ___
 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] osgText precision issue

2007-09-08 Thread sherman wilcox
Yeah, that sounds like it will do the trick. I'll have to re-work some
code, but that should address the issue.

On 9/8/07, Jason Beverage [EMAIL PROTECTED] wrote:
 Hi Sherman,

 The issue you're seeing is probably a precision issue since OpenGL works in
 floats.  I've seen a similar effect with Text objects in my applications.
 One way to reduce this precision problem is to to not position your text
 using the setPosition function but to position it by using a MatrixTransform
 as the parent of the geode containing your text.  This will allow OSG to
 accumulate the transformation and camera matrices in doubles and only
 convert to float the very last moment to increase precision.  It is the same
 technique that osgdem uses when managing its tiles.

 Hope this help!

 Jason


 On 9/8/07, sherman wilcox [EMAIL PROTECTED] wrote:
 
  I'm having a bit of trouble with mangled text if I zoom in to close.
  This text is on an osgDem generated ellispoid. In the attached
  screenshots, the text appears correctly in text2.jpg. However, in
  text3.jpg you'll see the problem. This only occurs if I zoom in really
  close to the text. If I back off the camera a bit, the text reverts
  back to the correct state.
 
  My questions are:
 
  1) What's causing this?
  2) How best to address the issue?
 
  __ _
  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] osgText precision issue

2007-09-08 Thread chris
The other thing to do, and the most important, is to locate the local origin
where your text is *before* converting to floats. This will give you the
most accuracy. I know the problem well and how to solve it, but don't know
OSG so can't tell you how this is done in OSG.

best of luck,

chris

On 09/09/2007, sherman wilcox [EMAIL PROTECTED] wrote:

 Yeah, that sounds like it will do the trick. I'll have to re-work some
 code, but that should address the issue.

 On 9/8/07, Jason Beverage [EMAIL PROTECTED] wrote:
  Hi Sherman,
 
  The issue you're seeing is probably a precision issue since OpenGL works
 in
  floats.  I've seen a similar effect with Text objects in my
 applications.
  One way to reduce this precision problem is to to not position your text
  using the setPosition function but to position it by using a
 MatrixTransform
  as the parent of the geode containing your text.  This will allow OSG to
  accumulate the transformation and camera matrices in doubles and only
  convert to float the very last moment to increase precision.  It is the
 same
  technique that osgdem uses when managing its tiles.
 
  Hope this help!
 
  Jason
 
 
  On 9/8/07, sherman wilcox [EMAIL PROTECTED] wrote:
  
   I'm having a bit of trouble with mangled text if I zoom in to close.
   This text is on an osgDem generated ellispoid. In the attached
   screenshots, the text appears correctly in text2.jpg. However, in
   text3.jpg you'll see the problem. This only occurs if I zoom in really
   close to the text. If I back off the camera a bit, the text reverts
   back to the correct state.
  
   My questions are:
  
   1) What's causing this?
   2) How best to address the issue?
  
   __ _
   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




-- 
http://ping.com.au
http://systemic.com.au
http://planet-earth.org/Rez/RezIndex.html
--
It be a great secret: there be more truth at the centre.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org