Re: [osg-users] OT: Sudden 100x performance drop in glReadPixels

2011-06-16 Thread Ralf Stokholm
Hi John

Have you investigated the memory consumption when this happens, thinking you
could be starting to hit page file?

Brgs

Ralf

On 16 June 2011 15:06, John Vidar Larring larr...@weatherone.tv wrote:

 Hi Sergey,

 Thanks for the async reading tip! It gives us a general speed-up, but it
 does not fix the issue at hand. But thanks anyway for great community
 support!

 We used osg::Timer to time the execution of the following calls in the code
 you suggested below: glReadPixels, glMapBuffer, memcpy and the total time of
 the whole code segment per frame and we got the following results (all
 numbers are in milliseconds):

 *** PXREAD  MAPBUF  MEMCPY  TOTAL ***
0.038   0.004   7.274   7.316
0.038   0.004   7.262   7.304
0.039   0.004   7.275   7.318
0.037   0.004   7.276   7.317
 [...snip... about 20-30 minutes later ...]
0.040.004   7.277   7.321
0.037   0.005   7.293   7.335
0.039   0.004   7.279   7.322
0.038   0.004   7.274   7.316
0.037   81.524  7.285   88.846 --- ???
0.039   802.79  7.253   810.082--- ???
0.039   800.092 7.247   807.378
0.037   802.858 7.269   810.164
0.036   800.102 7.279   807.417
0.036   803.398 7.25810.684
0.038   799.461 7.255   806.754
0.037   802.716 7.247   810
0.038   799.323 7.25806.611
0.037   799.439 7.265   806.741
0.039   803.154 7.248   810.441
 [...snip... stays like this until program is terminated]

 No Errors, performance just suddenly drops from excellent to a virtual
 halt. This is a total mystery to me, and I haven't seen anyone else on the
 web posting similar problems... sigh!

 So we are trying to come up with theories as to what can potentially hurt
 glReadPixels performance (either sync or async) so badly.

 Drivers and HW are among the usual suspects, but the client have the same
 issue on multiple machines while we are having trouble reproducing, on a
 range of similar HW with the same SW, drivers and config.

 Are there any odd comination of GL calls than can interrupt/interfere with
 glReadPixels?

 Again any suggestion or ideas are greatly appreciated?

 Best regards,
 John


 Sergey Kurdakov wrote:

 Hi John,
 I cannot say, what the problem is,

 but the possible solution is to use pbo with glReadPixels so that you read
 previous frame - and all reading is async - not slowing app at all

 here is a code for you
 //somewhere after rendering

 glReadBuffer(GL_FRONT);
 // get next buffer's index
  unsigned int iNextBuffer = (_iCurrentBuffer + 1) % N_MAX_BUFFERS;
  // kick of readback of current front-buffer
  // into the next buffer
glBindBuffer(GL_PIXEL_PACK_BUFFER, _aPixelBuffer[iNextBuffer]);//bind
 pbo1
glReadPixels(0, 0, m_width, m_height, GL_BGRA,
  GL_UNSIGNED_BYTE, BUFFER_OFFSET(0));//readback
// map the current buffer containing the
// image read back the previous time around
glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT,
 _aPixelBuffer[_iCurrentBuffer]);//bind pbo2
   _pPixels = static_castunsigned char
 *(glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY));

 if(_pPixels)
 {
  //something like:
  memcpy(image,_pPixels,m_width*m_height*4);
 // unmap the buffer
 if (!glUnmapBuffer(GL_PIXEL_PACK_BUFFER))
{
std::cerr  Couldn't unmap pixel buffer. Exiting\n;
assert(false);
}
 }

// unbind readback buffer to not interfere with
  // any other (traditional) readbacks.
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
  // make next-buffer the current buffer
_iCurrentBuffer = iNextBuffer;
 glReadBuffer(GL_BACK);


 make sure you have inited buffers

 glGenBuffers(N_MAX_BUFFERS, _aPixelBuffer);
 for (unsigned int iBuffer = 0; iBuffer  N_MAX_BUFFERS; ++iBuffer)
{
glBindBuffer(GL_PIXEL_PACK_BUFFER, _aPixelBuffer[iBuffer]);
glBufferData(GL_PIXEL_PACK_BUFFER, m_width*m_height*4, NULL,
 GL_STATIC_READ);
 errorcode = glGetError();
} glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);

 and that you delete them after use

 glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0);
 glDeleteBuffersARB(N_MAX_BUFFERS, _aPixelBuffer);


 Regards
 Sergey

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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users

Re: [osg-users] [vpb] terrain in meters

2011-04-06 Thread Ralf Stokholm
Hi Vijeesh

The database will us the same format as the input data, unless you specify a
different output format. In general its better to transform your data to the
desired format first using a tool like gdal.

If you want flat terrains in meters UTM projections are probably the best
option.

Brgs.

Ralf


On 6 April 2011 07:35, Vijeesh Theningaledathil vije...@nal.res.in wrote:

 Hi,

 Is it possible to generate the database in meter(cartesian coordinates
 rather than lat lon degrees)?

 Thank you!

 Cheers,
 Vijeesh

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





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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] coordinate system in terrain

2011-02-25 Thread Ralf Stokholm
Hi

Im not an expert on the output of gdalinfo, but it looks like your files are
lat lon, from what i know they should be able to generate an ECEF terrain
model.

The first thing I would do is to use ogsviewer to view the file, here you
should see a globe, or part of a globe, if you dont something in your osgdem
generation is not working.

For Delta I have no experience in using non UTM maps for delta, I would
start trying to load it in Stage and see if its possible to place objects
from there, but others might have some experience with global models for
Delta.

Brgs.

Ralf

On 25 February 2011 08:49, Vijeesh Theningaledathil vije...@nal.res.inwrote:

 Hi,

 Thanks Mr. Ralf. But from the output of gdalinfo, how can i say that it is
 flat earth or round earth. In my first post i had pasted the output of
 gdalinfo for the source files. My problem is I'm not able to render the
 terrain generated from the above source files using any of the IG(subrscene,
 delta3d). Can you tell me which IG is best suitable to render the terrain.
 And I need to know the origin lat lon if its a flat earth. I used osgdem to
 generate my terrain with --geocentric option.


 Thank you!

 Cheers,
 Vijeesh

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





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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Multithreading

2011-02-25 Thread Ralf Stokholm
Hi List

Im currently working on getting my application, build on Delta3d working
with osg multithreading.

In singlethreading everything works fine but multithreading modes fail. Is
there any documentation og other sources of information on what to do /
awoid doing at different times in the application loop when working with
multiple render context in a multithreaded osg app?

Im on windows btw.

Brgs.

-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multithreading

2011-02-25 Thread Ralf Stokholm
Hi Robert

Thanks for your time

About the fail, it depends a bit on how I start my application, if I set
realizeUponCreate=false the application fails when Delta attempts to start
their CEGUI implementation. So I use RealizeUponCreate=true and I have added
a osg::ThreadingHandler to allow me to make the switch at runtime.

When I make the switch at runtime the following errors are output, and they
keep comming.

This also happen when doing the same on really simple delta3d examples like
.

170: [Screen #0] GraphicsWindowWin32::makeCurrentImplementation() - Unable
to se
t current OpenGL rendering context. Reason: The requested resource is in
use.

Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,)
Warning: detected OpenGL error 'invalid operation' at end of
SceneView::draw()
Warning: detected OpenGL error 'invalid operation' after applying attribute
View
port 02C4ED48
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0xc11
Warning: detected OpenGL error 'invalid operation' at start of
State::apply(Stat
eSet*)
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0xb50
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0xb71
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0xc11
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0x4000
Warning: detected OpenGL error 'invalid operation' after applying attribute
Mate
rial 02C4E678
Warning: detected OpenGL error 'invalid operation' after applying attribute
Ligh
tModel 02C4D4C0
Warning: detected OpenGL error 'invalid operation' after applying attribute
Blen
dFunc 02C4E520
Warning: detected OpenGL error 'invalid operation' after applying attribute
Colo
rMask 1D0B9248
Warning: detected OpenGL error 'invalid operation' after applying attribute
Dept
h 1CFBD9B8
Warning: detected OpenGL error 'invalid operation' after applying GLMode
0xde1
Warning: detected OpenGL error 'invalid operation' after applying attribute
Text
ure2D 1C5B95B0
Warning: detected OpenGL error 'invalid operation' after applying attribute
TexE
nv 02C4E808
Warning: detected OpenGL error 'invalid operation' at end of
State::apply(StateS
et*)
Warning: detected OpenGL error 'invalid operation' at start of
State::apply(Stat
eSet*)

Brgs.

Ralf Stokholm

On 25 February 2011 13:20, Robert Osfield robert.osfi...@gmail.com wrote:

 Hi Ralf,

 Could you explain by what you mean by fail?

 In terms of docs, the topic of threading has been discussed many times
 of osg-users list/forum so is probably your best source of
 information.  Use of multi-threading isn't typically that complicated,
 just enable it and that avoid modifying data when it's being read by
 one of the other threads.

 The most common problem when multi-threading is using update callbacks
 on drawables or state that modified while the draw traversal is still
 running.  This can happen when using the DrawThreadPerContext or
 CullThreadCameraDrawThreadPerContext threading models.  The way to
 prevent these problems is to simply set the DataVariance on the
 StateSet or Drawable leaves to DYNAMIC, which tells the draw traversal
 to hold back the next frame till all the dynamic objects are
 dispatched.

 Robert.

 On Fri, Feb 25, 2011 at 11:57 AM, Ralf Stokholm alfma...@arenalogic.com
 wrote:
  Hi List
  Im currently working on getting my application, build on Delta3d working
  with osg multithreading.
  In singlethreading everything works fine but multithreading modes fail.
 Is
  there any documentation og other sources of information on what to do /
  awoid doing at different times in the application loop when working with
  multiple render context in a multithreaded osg app?
  Im on windows btw.
  Brgs.
 
  --
  Ralf Stokholm
  Director RD
  Email: a...@arenalogic.com
  Phone: +45 28 30 83 52
  Web: www.arenalogic.com
 
  This transmission and any accompanying documents are intended only for
  confidential use of the designated recipient(s) identified above.  This
  message contains proprietary information belonging to Arenalogic Aps.  If
  you have received this message by error, please notify the sender.
 
  ___
  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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender

Re: [osg-users] Multithreading

2011-02-25 Thread Ralf Stokholm
Hi Robert

I understand that this is really a Delta3d issue, that is why I was more
looking for general information on the differences between the
singlethreaded and multithreaded renderloops.

Thanks for your time.

/Ralf

On 25 February 2011 14:49, Robert Osfield robert.osfi...@gmail.com wrote:

 Hi Ralf,

 As far as I know CEGUI is not thread safe or able to handle multiple
 graphics contexts so it may well be that you can't use multi-threading
 in conjunction with the GUI.

 You'll need to discuss this with the Delta3D team as these type of
 issues are likely to be very specific to Delta3D rather than the OSG.

 Robert.

 On Fri, Feb 25, 2011 at 1:40 PM, Ralf Stokholm alfma...@arenalogic.com
 wrote:
  Hi Robert
  Thanks for your time
  About the fail, it depends a bit on how I start my application, if I set
  realizeUponCreate=false the application fails when Delta attempts to
 start
  their CEGUI implementation. So I use RealizeUponCreate=true and I have
 added
  a osg::ThreadingHandler to allow me to make the switch at runtime.
  When I make the switch at runtime the following errors are output, and
 they
  keep comming.
  This also happen when doing the same on really simple delta3d examples
 like
  .
  170: [Screen #0] GraphicsWindowWin32::makeCurrentImplementation() -
 Unable
  to se
  t current OpenGL rendering context. Reason: The requested resource is in
  use.
  Warning: detected OpenGL error 'invalid operation' after
 RenderBin::draw(,)
  Warning: detected OpenGL error 'invalid operation' at end of
  SceneView::draw()
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  View
  port 02C4ED48
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0xc11
  Warning: detected OpenGL error 'invalid operation' at start of
  State::apply(Stat
  eSet*)
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0xb50
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0xb71
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0xc11
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0x4000
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Mate
  rial 02C4E678
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Ligh
  tModel 02C4D4C0
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Blen
  dFunc 02C4E520
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Colo
  rMask 1D0B9248
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Dept
  h 1CFBD9B8
  Warning: detected OpenGL error 'invalid operation' after applying GLMode
  0xde1
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  Text
  ure2D 1C5B95B0
  Warning: detected OpenGL error 'invalid operation' after applying
 attribute
  TexE
  nv 02C4E808
  Warning: detected OpenGL error 'invalid operation' at end of
  State::apply(StateS
  et*)
  Warning: detected OpenGL error 'invalid operation' at start of
  State::apply(Stat
  eSet*)
  Brgs.
  Ralf Stokholm
  On 25 February 2011 13:20, Robert Osfield robert.osfi...@gmail.com
 wrote:
 
  Hi Ralf,
 
  Could you explain by what you mean by fail?
 
  In terms of docs, the topic of threading has been discussed many times
  of osg-users list/forum so is probably your best source of
  information.  Use of multi-threading isn't typically that complicated,
  just enable it and that avoid modifying data when it's being read by
  one of the other threads.
 
  The most common problem when multi-threading is using update callbacks
  on drawables or state that modified while the draw traversal is still
  running.  This can happen when using the DrawThreadPerContext or
  CullThreadCameraDrawThreadPerContext threading models.  The way to
  prevent these problems is to simply set the DataVariance on the
  StateSet or Drawable leaves to DYNAMIC, which tells the draw traversal
  to hold back the next frame till all the dynamic objects are
  dispatched.
 
  Robert.
 
  On Fri, Feb 25, 2011 at 11:57 AM, Ralf Stokholm 
 alfma...@arenalogic.com
  wrote:
   Hi List
   Im currently working on getting my application, build on Delta3d
 working
   with osg multithreading.
   In singlethreading everything works fine but multithreading modes
 fail.
   Is
   there any documentation og other sources of information on what to do
 /
   awoid doing at different times in the application loop when working
 with
   multiple render context in a multithreaded osg app?
   Im on windows btw.
   Brgs.
  
   --
   Ralf Stokholm
   Director RD
   Email: a...@arenalogic.com
   Phone: +45 28 30 83 52
   Web: www.arenalogic.com
  
   This transmission and any accompanying documents are intended only for
   confidential use of the designated recipient(s) identified above.
 This
   message contains proprietary information belonging

Re: [osg-users] [vpb] coordinate system in terrain

2011-02-24 Thread Ralf Stokholm
Hi Vijeesh

Is it the source data or your generated terrain you wish to id?

If its your source data you can use gdalinfo.exe it will output information
on the projection of your source data, your generated terrain will be in the
same projection unless you specify something else.

If you generate a ive binary terrain you can use osgconv to convert the root
terrain file to .osg you can then inspect this using a text editor. the root
file contains a coordinate system node detailing the coordinate system the
terrain is using.

brgs

Ralf

On 25 February 2011 07:56, Vijeesh Theningaledathil vije...@nal.res.inwrote:

 Hi Shayne
 Thanks. But still I cannot make out how to differentiate between flat earth
 and ECEF. Is there anything we can check to identify?



 Thank you!

 Cheers,
 Vijeesh

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





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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CPU usage

2011-02-19 Thread Ralf Stokholm
Hi Niel

I have not tried this myself, but I remember that support was added for
manually handling the render loop.

OSG will default to a render loop that follows your screen refresh, and if
this is forced off it will redraw as fast as possible. But i think there is
support for handling when to initiate the redraw from within your
application. If you do this CPU usage should go down drastically if you
don't have to redraw often.

There should be some discussion of this on the mailing list, but I don't
have a link so you will have to do the digging yourself.

Brgs.

Ralf Stokholm
http://www.arenalogic.com

On 19 February 2011 19:15, Neil Neilson n...@nlneilson.com wrote:

 Hi,

 What can be done to reduce CPU usage when the image is not being
 changed/updated?

 After trying the examples using a pre-built 2.9.9 and the latest from the
 SVN built with VS10 the CPU usage is high.
 On a dual core one is nearly max and the other core is minimal.

 With an app that much of the time may only call for an update or redraw
 once a second then it seems a double buffer
 could display the stationary image with minimal CPU.

 This is something I have not had to tinker with since what I have used
 before this was build into the SDKs.

 I am new to OSG (and osgEarth) so this issue may have been brought up
 before but could not find it.

 Thank you!

 Cheers,
 Neil

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





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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Hiding and Showing a Node with Key Press

2011-02-18 Thread Ralf Stokholm
node()-setNodeMask(visible ? ~0 : 0);

should do it

On 18 February 2011 19:45, Ross Lance ross.la...@gmail.com wrote:

 All,

 I am trying to setup a keyboard event to toggle a particular node on and
 off. I am not sure if I should use osg::Switch node or node masks? Any
 suggestions or examples you could point me to?

 Thanks,
 Ross

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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-19 Thread Ralf Stokholm
 are using OSG 2.8.3.

 We are having a heck of a hard time getting OSG to take advantage of
 our multiple graphics cards. Help!

 Here's what we did:

 If we load a fairly large model into our test program we can get a
 frame
 rate of about 150 FPS when displaying in a single window. (2) We are
 running single-threaded, and assign to a specific core.

 When we background this and run a second copy of the program to
 another
 graphics card and core then both programs run at 150 FPS. Same
 thing for
 running three and four copies at once.

 That is, four processes using four graphics cards on four cores
 run just
 as
 fast as a single process. All four cores are at near 100% CPU
 utilization
 according to top. So far, so good.

 Now we modify the program to load the model and create multiple
 windows on
 multiple cards. There's one window per card and each uses a different
 core. (3)

 The threading model is CullThreadPerCameraDrawThreadPerContext, the
 default chosen by OSG. The environment variable
 OSG_SERIALIZE_DRAW_DISPATCH
 is not set, so it defaults to ON, which we think means draw in
 serial.

 If we draw to four windows on four different cards we get about 36
 FPS.
 There are four different cores being used, and each has about 25%
 of the
 CPU. This probably this makes sense as the draws are in serial. 150
 FPS/4
 is about 36 FPS. As expected, we get nearly identical results if we
 create
 four windows on a single card using four different cores.

 If we set OSG_SERIALIZE_DRAW_DISPATCH=OFF we hope to see better
 performance,
 but with four windows on four graphics cards we only get 16 FPS!
 There
 are
 four different cores bring used, one at about 82%, and the other
 three at
 75%, but what are they doing? Again, we get nearly identical
 results if
 using four windows on a single card.

 So

 How can we get OSG to draw to four windows on four cards in one
 process as
 fast as running four separate processes?

 Any pointers or suggestions are welcome.

 Thanks,

 John


 1 - Our immersive system consists of 3 projectors and a console each
 driven
 by an Nvidia FX5800 graphics card all genlocked for 3D stereo
 display. The four graphics cards are in two QuardoPlex Model D2 units
 connected to the host. The host computer is an 8 core Dell Precision
 T5400 running 64 bit Linux (CentOS 5.5). We are using Nvidia driver
 version 195.36.24

 2 - the program is attached- it uses only OSG. We run our tests with
 _GL_SYNC_TO_VBLANK=0 to get the maximum frame rate.

 3 - one graphics context per window and one camera per window


 ___
 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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Custom file type loading?

2010-03-18 Thread Ralf Stokholm
Hi Peter

I have no personal experience with this, but from my understanding the most
correct pattern would be to add a new plugin for your file type. Take a look
at the way other files are handled either images like bmp's or models.

Brgs.

Ralf Stokholm

On 18 March 2010 09:06, Peter Bear th3fly...@gmail.com wrote:

 Hi, I was wondering if anyone would be able to point me in the right
 direction as to how to add support to load custom file types not currently
 supported by OSG. I've been looking for a while and haven't turned much up
 that appears to be of use.

 Thank you!

 Cheers,
 Peter

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





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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgText quality issue

2010-03-18 Thread Ralf Stokholm
Hi

Im not sure if this is the last time it was changed, but inspecting the log
it was changed a revision 6602 from

unsigned int sizeAdjustment = 0; // was 1.
to
unsigned int sizeAdjustment = 1;

With the following comment: *Reorganised the managment of margins around
glyphs so that is done entirely with src/osgText/Font.cpp rather than the
font plugins or Text.cpp*
**
Not really sure why, but I couldent help looking for it so I might as well
share.

Brgs.

Ralf Stokholm



2010/3/18 Mathias Fröhlich m.froehl...@science-computing.de


 Hi,

 On Wednesday 17 March 2010, Farshid Lashkari wrote:
  I'm in the process of porting our application from OSG 1.2 to 2.9. One
  major issue that immediately stood out was the quality of osgText. All
 the
  letters seem to be cut off by one pixel along the edges. There has been a
  lot of changes since 1.2, but I did find one setting that seemed to fix
 the
  issue for me.
 
  On line 539 of Font.cpp there is a hard-coded variable called
  sizeAdjustment that is set to 1. In OSG 1.2 this value was set to 0.
  Changing this value back to 0 pretty much resolves the quality issue for
  me. I've attached a screenshot comparing the result of changing the
 value.
 
  Does anybody else notice these artifacts? Is there a downside to changing
  the sizeAdjustment value back to 0? Any insight is appreciated.
 Yes, I was coding around that in the QFont implementation by an own margin
 that appeared to fix that problem. That left the original reason on the
 todo
 list ...
 Glad to see that we know where this happens.

 Greetings

 Mathias

 --
 Dr. Mathias Fröhlich, science + computing ag, Software Solutions
 Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
 Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
 --
 Vorstand/Board of Management:
 Dr. Bernd Finkbeiner, Dr. Roland Niemeier,
 Dr. Arno Steitz, Dr. Ingrid Zech
 Vorsitzender des Aufsichtsrats/
 Chairman of the Supervisory Board:
 Michel Lepert
 Sitz/Registered Office: Tuebingen
 Registergericht/Registration Court: Stuttgart
 Registernummer/Commercial Register No.: HRB 382196


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




-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Best way to limit/scissor a render surface

2010-02-10 Thread Ralf Stokholm
Hi All

I have been trying two ways to prevent the rendering of a branch from
exceeding a predefined display area. The display area could represent a
radar screen and I want the symbols of the screen to be clipped if it is
outside the screen area.

I have tried using clip planes, which works. But I had a lot of problems
with conflicts with already active clip planes and the limit to about 6 or 8
clip planes in OpenGL. It also seams a bit overkill to have to use a clip
plane to limit simple 2D rendering.

I then switched to using scissors, this works as well, but I'm having
problems adjusting the scissor rect, which is relative to the current window
to my display which is relative to a specific view shown in that screen.

How are other people doing this? will view ports and a specific camera or
other tricks present a better solution?

Brgs.

-- 
Ralf Stokholm
Director RD
Email: a...@arenalogic.com
Phone: +45 28 30 83 52
Web: www.arenalogic.com

This transmission and any accompanying documents are intended only for
confidential use of the designated recipient(s) identified above.  This
message contains proprietary information belonging to Arenalogic Aps.  If
you have received this message by error, please notify the sender.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Please Help with Setup

2009-11-15 Thread Ralf Stokholm
Hi Jacob

Not sure why you are hawing problems with your setup, im using vs2008 but it
shouldent make much difference comparred to vs2005. You could try
downloading vs2008 express though I have successfully build using the
express versions.

Anyway I have a folder called scenerygenerator in my svn with the following
svn externals

osg
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.2
osgdata
http://www.openscenegraph.org/svn/osg/OpenSceneGraph-Data/tags/OpenSceneGraph-Data-2.8.0
3rdPartysvn
https://osgtoy.svn.sourceforge.net/svnroot/osgtoy/3rdParty/branches/3rdParty_win32binaries_vs80sp1
osgdem
http://www.openscenegraph.org/svn/VirtualPlanetBuilder/tags/VirtualPlanetBuilder-0.9.10
From there on I use scripts for building osg, with little modefication they
should work for you as well.

I use FWtools for gdal etc, install FWtools 2.4.6 or edit the script to
whatever you use. same goes for your visual studio stuff.

The put the following in a build script in the folder you set the svn
externals on, then is should build :-) when not let me know.

##
setlocal
SET AX=%CD%
if exist C:\Program Files set PGM_FILES=C:\Program Files
if exist C:\Program Files (x86) set PGM_FILES=C:\Program Files (x86)
SET OSG_SOURCE_DIR=%AX%\osg
SET OSG_DIR=%AX%\osgbuild
SET OSG_INCLUDE_DIR=%AX%\osg\include;%AX%\osgbuild\include
SET INCLUDE=%INCLUDE%;%OSG_INCLUDE_DIR%
::Call environment variables script
call %PGM_FILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86
::call %PGM_FILES%\Microsoft Platform SDK for Windows Server 2003
R2\SetEnv.Cmd /XP32
:OSG
@echo 
@echo 
@echo # Building openSceneGraph
@echo 
@echo 
if not exist ./osgbuild md osgbuild
pushd osgbuild
 cmake -debug-output ..\osg -G Visual Studio 9 2008 -DWIN32_USE_MP:BOOL=ON
-DFREETYPE_INCLUDE_DIR_ft2build=%AX%\3rdParty\include
-DFREETYPE_INCLUDE_DIR_freetype2=%AX%\3rdParty\include
-DFREETYPE_LIBRARY=%AX%\3rdParty\lib\freetype237.lib
-DCMAKE_BUILD_TYPE=Release
 vcbuild /useenv OpenSceneGraph.sln Release|Win32
 ::vcbuild /useenv OpenSceneGraph.sln Debug|Win32
popd
::goto END
:VPB
@echo 
@echo 
@echo # Building VirtualPlanetBuilder
@echo 
@echo 
if not exist ./osgdembuild md osgdembuild
pushd osgdembuild
 cmake -debug-output ..\osgdem -G Visual Studio 9 2008
-DCURL_INCLUDE_DIR=%AX%\3rdParty\include
-DCURL_LIBRARY=%AX%\3rdParty\lib\curllib.lib
-DGDAL_LIBRARY=%PGM_FILES%\FWTools2.4.6\lib\gdal_i.lib
-DGDAL_INCLUDE_DIR=%PGM_FILES%\FWTools2.4.6\include
-DCMAKE_BUILD_TYPE=Release
 vcbuild /useenv VIRTUALPLANETBUILDER.sln Release|Win32
 ::vcbuild /useenv VIRTUALPLANETBUILDER.sln Debug|Win32
popd

:END
endlocal
###

Brgs.

Ralf Stokholm
www.arenalogic.com


2009/11/15 Chris 'Xenon' Hanson xe...@alphapixel.com

 Jacob Armstrong wrote:
  Thanks for the response, Chris! I would definitely like to discuss this
  further, and I think a phone call would help out tremendously. Would I
  be able to reach you at that phone number during the week?

  Certainly.

  I'm not sure
  what I can do as far as the remote-desktop assistance, that would be
  up to my manager. The link you provided worked in my web browser, so I
  could manually download everything if need-be, right?

  I've never tried that, and I don't know how that would work. You really do
 want to have
 Subversion operating correctly though, to stay on top of bug fixes.

  The only problem
  I would have after that is setting up the VirtualPlanetBuilder
  directories so they play with the OSG, if I even need that.

  You will need that.

  The only
  thing I'm really using out of the entire product is OSGDem, which I
  understand is in VPB now. Do I really need OSG to be able to run VPB?

  You need OSG to build VPB, and to run VPB/OSGDEM.

  If
  so, then I'm not sure how to set them both up, with dependencies so they
  work together. My availability is pretty limited today as well, and I'm
  actually traveling for work this week, so I'm not sure when I'll be able
  to phone you if you're still available after today.

  Well, get in touch when you're ready to discuss it.

  Thanks,
  Jake

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 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

Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-09 Thread Ralf Stokholm
Hi All

Just wantet to add that we are also using Delta3d and as a consequence we
are using the composite viewer.

Brgs.

Ralf Stokholm

2009/10/8 Michael Bach Jensen mich...@ifad.dk

 Hello everyone,

 We are having the exact same problem at our company for quite some time
 (currently on osg 2.8.0 via Delta3D and using TerraPage terrains). I have
 verified that viewing the terrain in the osgViewer works fine, but in our
 app, which also uses multiple cameras, the memory-keeps-growing-until-crash
 issue occurs when the cameras are not looking at the exact same thing (have
 the same projection and view matrices with the same LOD scale). The more
 different they are, the easier it is to trigger the issue, it seems.

 What we did to work around the issue, is to make sure that no two cameras
 in the graph render the same PagedLOD node. That is, we load the terrain
 multiple times using osgDB::readNodeFile and point each camera to each
 instance.

 I hope this helps on shedding some light on what is going on.

 Additional info:
 Delta3D design currently limits OSG to single-threaded mode. I am on
 WindowsXP, using an NVidia card, not that I think that makes a difference.

 I also seem to recall, that the active lod node list in the pager starts to
 grow rapidly when I put the second camera into the scene graph at runtime.

 Cheers,
 Michael

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





 ___
 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] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread Ralf Stokholm
Hi Sergey

Im afraid I dont have an answer, but I can back up your observations.

We are using two cameras for our application one for a standard view the
other for an IR targeting POD. The two cameras are looking in opposite
directions and have different lodscales.

I have also notised that the memmory usage keeps rising untill the app
chrashes and that this will happen faster if the IR camera is zoomed with
according lodscale.

I have tried various settings for the database pager, but the problem
remains.

Brgs.

Ralf Stokholm




2009/10/7 sergey leontyev sleon...@ist.ucf.edu

 Hello,

 (i am using OSG 2.8.2)

 Let me try to explain the problem :

 I have a big database (TerraPage).  I load it into my application. I have
 two views (cameras) within a window and i can position each camera
 individually looking directly down at the terrain ( I am using orthographic
 projection ). If I move 2 cameras to an identical location everything is
 fine, and I can keep moving them to the same position.

 However, when i move them to a different locations ( looking at different
 tiles i presume). The memory usage starts to increase at about 0.5mb per
 second and never stops. It seems to only happen when i use setViewAsLookAt
 which changes the modelview matrix. I used to move around the map using the
 ortographic projection matrix(by setting left and right top and bottom
 params) i have never noticed the memory increase.

 In other words it seems that having 2 views with cameras positioned in
 different places break something in the databasepager.

 I have tried playing with some settings such
 setTargetMaximumNumberOfPageLOD or calling clear on the database pager. Does
 anyone have or had similar issues? I have no idea how to debug this. Is what
 i am saying possible? and the databsepager has a bug?

 Does anyone have any ideas? How to debug this? How to rule out the that
 there is a bug in databasepager?

 Any help or advices are appreciated.
 Thanks!
 Sergey

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





 ___
 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] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread Ralf Stokholm
Hi Robert

Unfortunatly I cant upgrade to trunk without a considerable effort, so that
wont happen right now. But the texture pools looks really interesting with
regards to large paged terrains.

I doubt if its a driver thing directly, as Im able to run osgviewer on the
same dataset without problems, if i for instance move far away from the
terrain memmory will drop etc. If I do the same in my application moovi both
cameras far away from the paged data wont result in the same drom in mommory
consumption.

These observations are done in windows task mgr so they might not be
completely valid, but the end result is that if i fly back and fourth usin
the viewer it will never chrash, if I do it using my application it will
eventually chrash, this might well be me screwing up somewhere else but it
supports the observations Sergey are making.

Database is VPB database app 500 Gig
OSG 2.8.2
Windows vista and XP Nvidia GTX280 Graphics latest drivers.

I was wondering if somthing in the database pager is preventing the release
like a copy of a refptr or similar?

Brgs
Ralf
2009/10/7 Robert Osfield robert.osfi...@gmail.com

 HI Sergey and Ralf,

 I haven't seen this behavior in the DatabasePager before, and it might
 not be directly related to the DatabasePager at all.  The
 DatabasePager itself doesn't actually know anything about cameras, it
 just handles requests made to it from the cull traversals.  The code
 for handling the requests is thread safe so there should be no problem
 with having multiple cameras making multiple requests.

 If you do have multiple cameras then you will naturally be requiring
 more data to be loaded into memory, and less data will able to be
 expired than normal.  Whether this can explain the growth in memory
 you are seeing I would doubt though.  Perhaps the OpenGL drivers is
 playing tricks.  If you can try your app on a different
 OS/driver/hardware combination to see if the same behavior exists.

 Another thing you could try is the svn/trunk version of the OSG as it
 now contains and texture and buffer object pool mechanism that you can
 turn on that will keep a lid on how much OpenGL memory you're app is
 using and might just be what you need.

 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] Paged LOD for osg terrain

2009-09-24 Thread Ralf Stokholm
Hi Brett

Osg paged lod is basically implemented as the name states, there are a
pagedLod node in your model that will spawn a load of the nodes below it
when it gets close enough to the camera and is inside the view frustum.

I guess the technique is quite similar to a standard LOD node except for
that the nodes need to be loaded in from the disk. The actual loading of the
nodes are done an a separate thread so there is a mechanism for
synchronising when a given data set that has been requested is made
available for rendering.

From your question it sounds like you are looking for some a more thesis
type algorithm for handling LOD, there is no such thing for paged lod, as it
is basically just a mechanism for asynchronously loading parts of a large
model.

Brgs.

Ralf Stokholm
www.arenalogic.com



2009/9/24 Brett Thomas Lee brettle...@hotmail.com

 Hi,

 All I want is the technique description since there are lot of LOD
 techniques out there.Based on which technique is osg LOD is based on???Any
 papers??

 Thank you!

 Cheers,
 Brett

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





 ___
 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] osg DIS (Distributed Interactive Simulation)

2009-08-25 Thread Ralf Stokholm
Hi All

If you need a distributed simulation based on OSG I can recommend Delta3d
which has already integrated HLA RPRFOM (works with RTI-s MÄK Pitch
Portico and CERTI) and also DIS based on OpenDIS.

Brgs.

Ralf Stokholm
Arenalogic
www.arenalogic.com


2009/8/25 Tomlinson, Gordon gtomlin...@overwatch.textron.com

  And don't forget  HLA  :)  (
 http://en.wikipedia.org/wiki/High_Level_Architecture_(simulation)) as this
 has depreicated DIS for many :)


 *Gordon
 Product Manager 3d
 *__
 *Gordon Tomlinson
 **Email * : gtomlinson @ overwatch.textron.com
 __


  --
 *From:* osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Maxim Gammer
 *Sent:* Tuesday, August 25, 2009 5:57 AM
 *To:* OpenSceneGraph Users
 *Subject:* Re: [osg-users] osg DIS (Distributed Interactive Simulation)

   Hi,

 what's wrong with CERTI or PORTICO?

 2009/8/25 Trajce Nikolov nikolov.tra...@gmail.com

 Hello community,
 are you interested in opensource crossplatform DIS library?

 cheers,
 Nick

 http://www.linkedin.com/in/tnikolov
 Sent from Benoni, Gauteng, South Africa

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




 --
 Maxim Gammer


 ___
 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] osgPresentation missing CmakeList.txt file

2009-06-25 Thread Ralf Stokholm
Hi Rober / List

It seams there is a missing CMakeList.txt file in the osgPresentation folder
that causes trunk build to fail

Brgs.

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


Re: [osg-users] osgPresentation missing CmakeList.txt file

2009-06-25 Thread Ralf Stokholm
Hi Robert

That part works now btw but seams this on is missing as well.

Cannot open include file: 'osgPresentation/Export':

I will be on osg and vpb trunk testing VPB stuu for the nexe release btw.
Will put in some more information in the proper thread later.

Brgs.

Ralf

2009/6/25 Robert Osfield robert.osfi...@gmail.com

 Hi Ralf,

 Sorry about this, missed the svn add for the CMakeLists.txt when I
 checked the rest of the changes in.  I've now checked in the
 src/osgPresentation/CMakeLists.txt.

 Robert.

 On Thu, Jun 25, 2009 at 7:33 AM, Ralf Stokholmalfma...@arenalogic.com
 wrote:
  Hi Rober / List
 
  It seams there is a missing CMakeList.txt file in the osgPresentation
 folder
  that causes trunk build to fail
 
  Brgs.
 
  Ralf Stokholm
  ___
  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] osgPresentation doesn't build on the SVN

2009-06-25 Thread Ralf Stokholm
Hi Robert

I still get a heap of linker errors. Have my nose in something else so I
havent investigated it further.

Log attached.

Brgs. Ralf


2009/6/25 Robert Osfield robert.osfi...@gmail.com

 Hi Serge,

 Sorry about this, a copy and paste error in the CMakeLists.txt looks
 to have foiled the export of symbols.  I've now fixed this error could
 you do an svn update and let me know how you get on.

 Robert.

 On Thu, Jun 25, 2009 at 6:11 PM, Serge Lagesserge.la...@gmail.com wrote:
  Hi Robert,
 
  On the SVN, osgPresentation doesn't build (lots of linking errors, see
 the
  attached file). I am under Windows Xp.
 
  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

Setting environment for using Microsoft Visual Studio 2008 x86 tools.


# Building openSceneGraph


-- searching TIFF --tiff.h--libtiff--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching FREETYPE 
--ft2build.h--freetype;freetype234;freetype234MT;freetype235;freetype237--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching CURL 
--curl/curl.h--libcurl;curllib--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching JPEG 
--jpeglib.h--libjpeg--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching GLUT --GL/glut.h--glut32--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching GIFLIB 
--gif_lib.h--ungif;libungif--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching ZLIB 
--zlib.h--z;zlib;zlib1--C:/SVN/va/SceneryBuilder/3rdparty--
-- searching PNG 
--png.h--libpng;libpng13--C:/SVN/va/SceneryBuilder/3rdparty--
-- Found JPEG: C:/SVN/va/SceneryBuilder/3rdParty/lib/libjpeg.lib
-- Found PNG: C:/SVN/va/SceneryBuilder/3rdParty/lib/libpng13.lib
-- Configuring done
-- Generating done
-- Build files have been written to: C:/SVN/va/SceneryBuilder/osgbuild
Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022
Copyright (C) Microsoft Corporation. All rights reserved.

Build started: Project: ZERO_CHECK, Configuration: Release|Win32
ZERO_CHECK - up-to-date

Build started: Project: osgPresentation, Configuration: Release|Win32
Linking...
   Creating library 
C:\SVN\va\SceneryBuilder\osgbuild\lib\Release\..\osgPresentation.lib and object 
C:\SVN\va\SceneryBuilder\osgbuild\lib\Release\..\osgPresentation.exp
PickEventHandler.obj : warning LNK4217: locally defined symbol 
?selectsl...@slideeventhandler@osgPresentation@@qae_...@z (public: bool 
__thiscall osgPresentation::SlideEventHandler::selectSlide(int,int)) imported 
in function public: void __thiscall 
osgPresentation::PickEventHandler::doOperation(void) 
(?dooperat...@pickeventhandler@osgPresentation@@QAEXXZ)
PickEventHandler.obj : warning LNK4217: locally defined symbol 
?dispatchev...@slideeventhandler@osgPresentation@@qaexabukeyposit...@2@@Z 
(public: void __thiscall 
osgPresentation::SlideEventHandler::dispatchEvent(struct 
osgPresentation::KeyPosition const )) imported in function public: void 
__thiscall osgPresentation::PickEventHandler::doOperation(void) 
(?dooperat...@pickeventhandler@osgPresentation@@QAEXXZ)
PickEventHandler.obj : warning LNK4217: locally defined symbol 
?insta...@slideeventhandler@osgPresentation@@sapa...@xz (public: static class 
osgPresentation::SlideEventHandler * __cdecl 
osgPresentation::SlideEventHandler::instance(void)) imported in function 
public: void __thiscall osgPresentation::PickEventHandler::doOperation(void) 
(?dooperat...@pickeventhandler@osgPresentation@@QAEXXZ)
SlideShowConstructor.obj : warning LNK4217: locally defined symbol 
?requiresblend...@animationmaterial@osgPresentation@@QBE_NXZ (public: bool 
__thiscall osgPresentation::AnimationMaterial::requiresBlending(void)const ) 
imported in function protected: class osg::Node * __thiscall 
osgPresentation::SlideShowConstructor::attachMaterialAnimation(class osg::Node 
*,struct osgPresentation::SlideShowConstructor::PositionData const ) 
(?attachmaterialanimat...@slideshowconstructor@osgPresentation@@iaepavn...@osg@@pa...@abupositiondata@12@@Z)
SlideShowConstructor.obj : warning LNK4217: locally defined symbol 
?ins...@animationmaterial@osgPresentation@@qaexnpavmater...@osg@@@Z (public: 
void __thiscall osgPresentation::AnimationMaterial::insert(double,class 
osg::Material *)) imported in function protected: class osg::Node * __thiscall 
osgPresentation::SlideShowConstructor::attachMaterialAnimation(class osg::Node 
*,struct osgPresentation::SlideShowConstructor::PositionData const ) 
(?attachmaterialanimat...@slideshowconstructor@osgPresentation@@iaepavn...@osg@@pa...@abupositiondata@12@@Z)
SlideShowConstructor.obj : 

Re: [osg-users] Qt osgviewer

2009-06-16 Thread Ralf Stokholm
Hi Gustavo

Im not familiar with a sample for raw OSG integration with QT but Delta3D is
integrating with QT and the Delta rendering engine is a relatively thin
layer on top of OSG.

Brgs

Ralf Stokholm

2009/6/16 Gustavo Puche gustavo.pu...@gmail.com

 Hi guys,

 We are developing a robotic system based on OpenRAVE and we want to develop
 a viewer based in OSG. Does anybody knows how can we use the osgviewer in a
 Qt window [Question] We are not interested in the fullscreen view.

 Thank you!

 Cheers,
 Gustavo

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





 ___
 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] master/slave camera question

2009-06-10 Thread Ralf Stokholm
Hi Wyatt

This could basically be achived by setting a render target for your depth
buffer.



osg::Texture2D* CreateDepthTexture( unsigned short w, unsigned short h )
{
osg::Texture2D* texture = new osg::Texture2D() ;
texture-setTextureSize( w, h );
texture-setInternalFormat(GL_DEPTH_COMPONENT);
texture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
texture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
return texture;
}

m_RttDepthBuffer = CreateDepthTexture(sizeX,sizeY);
m_RttCamera = new osg::Camera;
m_RttCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
m_RttCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_RttCamera-setViewport(0, 0, m_RttFrameBuffer-getTextureWidth(),
m_RttFrameBuffer-getTextureHeight());
m_RttCamera-setCullingMode(osg::CullSettings::VIEW_FRUSTUM_CULLING);
m_RttCamera-attach(osg::Camera::DEPTH_BUFFER, m_RttDepthBuffer.get());

After each render the m_RttDepthBuffer texture will contain your depths as a
greyscale image.
Brgs.

Ralf Stokholm

2009/6/10 Wyatt Earp wyattbsearp1...@gmail.com

 Ultimately I am trying to generate an image where each pixel
 represents the distance from the viewer to the content in the pixel.
 I guess you could think of it as something like an imaging range
 finder.

 Wyatt

 On 6/10/09, Robert Osfield robert.osfi...@gmail.com wrote:
  HI Wyatt,
 
  On Tue, Jun 9, 2009 at 11:07 PM, Wyatt Earpwyattbsearp1...@gmail.com
  wrote:
  Let me see if I understand this... Assuming I pass no args to the app
 when
  I
  run it, the osgdistortion createDistortionSubgraph first creates a
 camera
  which will render the scene to a texture attached to an FBO before the
  main
  camera renders the scene.  Then the hud camera is created to render
 the
  quad textured with the texture created by the previous camera?  So I
 have
  two slave cameras in addition to the main camera?
 
  Yes two slave cameras, and a master camera that is passive - it just
  provides the projection and view matrix for the first of the slaves to
  use for it's projection and modelview matrix, the second camera has
  ignores the master projection and modelview matrix, the two slaves
  achieve this be setting their ReferenceFrame to RELATIVE_RF (the
  default) and ABSOLTE_RF respectively.The slave Camera's also set
  their RenderOrder to make sure the RTT camera is draw first.
 
  How would I render scene to a depth texture?  Do I create a depth
 texture
  and attach it to the first camera?
 
  You just attach the texture you want to the Camera's depth buffer
  component rather than the colour buffer component.
 
  Assuming that I want to use the texture created by the first camera as
 an
  input to frag shader program, would I need to add a third camera which I
  would add the shader as is done in the osgshaders example?
 
  If you want another pass then you might use another camera, but if you
  just do everything in a second pass using the original texture then
  the will be no need to do add another slave camera.  You really don't
  provide enough info on what exactly you are trying to achieve and why
  so I can't really say too much on what you actually need in your case.
 
  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


Re: [osg-users] ATI cards and openscenegraph

2009-06-10 Thread Ralf Stokholm
Hi Peted

You should in general not have any issues with OSG and ATI drivers I am
personally running OSG on both NVIDIA and ATI hardware and it works fine on
both.

Robert is currently using an ATI card on his development machine and if you
search the archives there will be some information on his experience and any
issues he has discovered.

Good luck :-)

Brgs.

Ralf Stokholm

2009/6/11 pe...@iinet.net.au

 Hello

 Im getting a Powercolor ATI HD3850 graphics card for my PC.
 and am running XP sp3.
 I was wondering if there are any problems in general with
 openscenepgraph and either this card or even ATI cards/drivers in
 general.

 This would be for both runnning opengl/openscenegraph apps and for
 development in both.

 Up until now i have only ever had nvidia cards, so im just wondering
 if anyone has exprienced any issues with ATI, either via the
 openscenepgraph or even opengl stuff



 Any advice appreciated

 thanks

 Peted

 ___
 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] Database pager questions

2009-06-04 Thread Ralf Stokholm
Hi Brett

12) As far as I know the database pager is multithreaded regardless if osg
is running multi or single threaded. Osg threading is related to threading
of the cull and draw traversals.
3) How does the pager decide when to page something in?
My understanding is that this is based on the cull traversal if a pagedlod
is (inside) the cull requirements based on the viewfrustrun and the lodscale
of the camera. its children are loaded.

4) How does the pager decide when to page something out?
This depends on your sceme, when a given lod no longer fulfills the
requirements to be in the scene it could be culled. The database pager pre
2.8 uses a sceme based on how much time has passed since the node last
fulfilled the requirements to stay in the scene, in 2.8 the maximum number
of nodes to keep can be capped.
5) How does the pager page something out?
Initially it is removed from the scenegraph and then the nodes are deleted
(more likely they are dereferences and the ref_ptr takes care of freeing the
memmory.

Brgs

Ralf Stokholm

2009/6/4 brettwiesner brettwies...@gmail.com

 Hi,

 Just validating some assumptions about the database pager...
 1) Is paging in single threaded mode blocking? If OSG is in single threaded
 mode, will the pager load data and stop rendering or will it load in another
 thread anyway?
 2) If OSG is running in multithreaded mode will the pager load data
 asychronously?

 Now some real questions:
 3) How does the pager decide when to page something in?
 4) How does the pager decide when to page something out?
 5) How does the pager page something out?

 Thanks,
 Brett
 ___
 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] Set image as static background

2009-05-18 Thread Ralf Stokholm
Hi Roy

I see nothing strange in your sample, have you tried setting a higher debug
level to see if some of the functions fail?

Are you running this in a simeple viewer app like one of the samples?

Brgs.

Ralf Stokholm

2009/5/18 roy vardi royva...@walla.co.il

 Hi Ralf,

 Thanks, but it still doesn't work...
 I've added the first function you wrote, and then connected the return
 geode to a projection pointer, connecting it to my model's root. Shouldn't
 i connect it (or set it...) to the camera viewer somehow?
 Here's what i did:

 osg::Geode* geode = new osg::Geode;
 osg::Geometry* geometry =
 osg::createTexturedQuadGeometry(osg::Vec3(0,0.5,0),osg::Vec3(1,0,0),osg::Vec3(0,0,1),0,
 0, 1, 1);
 geode-addDrawable(geometry);
 osg::Texture2D* t_texture = new
 osg::Texture2D(osgDB::readImageFile(stars.jpg));
 geode-getOrCreateStateSet()-setTextureAttributeAndModes(0,t_texture,
 osg::StateAttribute::ON);
 geode-getOrCreateStateSet()-setTextureMode(0,
 GL_TEXTURE_2D,osg::StateAttribute::ON);

 osg::Projection* Proj = new osg::Projection;
 Proj-setMatrix(osg::Matrix::ortho2D(0,1,0,1));
 root-addChild(Proj);
 Proj-addChild(geode);

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

 Thanks again!!!

 Cheers,
 roy

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





 ___
 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] Set image as static background

2009-05-17 Thread Ralf Stokholm
Hi Roy

 There is an osgClearNode, that might be what you want, but this works for
me.

osg::Geode* createNodeWithMyImageOnIt(const std::string filename)
{
osg::Geode* geode = new osg::Geode;
osg::Geometry* geometry =
osg::createTexturedQuadGeometry(osg::Vec3(0,0.5,0),osg::Vec3(1,0,0),osg::Vec3(0,0,1),0,
0, 1, 1);
geode-addDrawable(geometry);
osg::Texture2D* texture = new
osg::Texture2D(osgDB::readImageFile(filename));
geode-getOrCreateStateSet()-setTextureAttributeAndModes(0,texture,
osg::StateAttribute::ON);
geode-getOrCreateStateSet()-setTextureMode(0,
GL_TEXTURE_2D,osg::StateAttribute::ON);
//geode-getOrCreateStateSet()-setMode(GL_LIGHTING,
osg::StateAttribute::OFF);
return geode;
}

void Cockpit::Drawgauges()
{
osg::Projection* Proj = new osg::Projection;
Proj-setMatrix(osg::Matrix::ortho2D(0,1,0,1));
osg::Geode* backgroundImage = createNodeWithMyImageOnIt(imagefile);
m_CockpitGroup-addChild(Proj);
Proj-addChild(backgroundImage);

Brgs.

Ralf Stokholm

2009/5/18 roy vardi royva...@walla.co.il

 Hi guys (and girls...),

 I'm new with the OSG.
 I'm creating a basic model, and for the past couple of hours have tried
 without success to set a loaded image as the model's background, instead of
 the default one (the blue color).
 I know that there is a camera function which can change the background
 color, but it only supports an RGB coordinates input.
 Is there an easy way to just set an image as the background?

 Thank you!

 Cheers,
 roy

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





 ___
 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] Initial cut at CMake support + branch of osgEphemeris

2009-04-13 Thread Ralf Stokholm
Hi Robert

Just a small heads up that the SimCore project which is an
addon/extension of Delta3d is using osgEphemeris, they are building
using Cmake, so their might be a hint to get from that one.

http://delta3d-extras.svn.sourceforge.net/svnroot/delta3d-extras/SimulationCore/trunk/ext

Brgs.

Ralf Stokholm

2009/4/10 Robert Osfield robert.osfi...@gmail.com:
 Hi All,

 I'm off doing training next week and one of the topics may well be touch
 upon is osgEphemeris so I've pulled down the CVS from Don's AndesEnginnering
 website and had a bash at getting it, and it's dependency of Producer
 compiling.  I struggled to get things working so ended up having a bash at
 porting osgEphemeris to using CMake and against the latest OSG rev.

 To get the build working I've drawn the CMake files from VPB, OSG and
 osgEarth, it's a bit of hack... but it's almost working.  So far the
 osgEphemeris library itself is compiling and linking, and the plugin is
 compiling, but the paths are failing.  So... I was wondering if some helpful
 soul might be able to spot my CMake script error(s).

 I've put up by branch of osgEphemeris on the openscenegraph.org subversion
 repository, you can grab it from:

     svn co http://www.openscenegraph.org/svn/osgEphemeris/trunk osgEphemeris

 Then to compile it's the usual OSG/Cmake routine, and under unices it looks
 like:

     ./configure
    make

 Which goes pretty sweetly till it tries to link the plugin.  These are the
 errors I get:

 [ 86%] Building CXX object
 src/osgEphemeris/CMakeFiles/osgEphemeris.dir/StarField.o
 [ 93%] Building CXX object
 src/osgEphemeris/CMakeFiles/osgEphemeris.dir/sun_image.o
 Linking CXX shared library ../../lib/libosgEphemeris.so
 [ 93%] Built target osgEphemeris
 Scanning dependencies of target osgdb_osgephemeris
 [100%] Building CXX object
 src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/IO_EphemerisModel.o
 Linking CXX shared module /osgPlugins-2.9.2/osgdb_osgephemeris.so
 /usr/bin/ld: cannot open output file
 /osgPlugins-2.9.2/osgdb_osgephemeris.so: No such file or directory
 collect2: ld returned 1 exit status
 make[2]: *** [/osgPlugins-2.9.2/osgdb_osgephemeris.so] Error 1
 make[1]: ***
 [src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/all] Error 2

 The error seems to be in the path to what should
 osgEmpheris/lib/osgPlugins-2.9.2, but instead it's just got the path
 /osgPlugins-2.9.2/osgdb_osgephemeris.so.  While I've tried to honour how the
 OSG does thing w.r.t plugins something is obviously wrong..   Hopefully what
 is wrong might ring a bell to the OSG/Cmake guru's.

 I haven't yet put together an osgViewer based example but this should be
 pretty straight forward.

 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] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-06 Thread Ralf Stokholm
Hi Robert

I have gotten a bit further with this, and there are some indications
it might be a viable solution.

But I have run into a problem, it seams that Im not removing patches
from my physics engine when higher resolutions patches replaces them.

Can You confirm that If a given osgTerrain::TerrainTile is replaced by
its four higher resolution children the acociated heightfields are not
deleted, and as a result the observer callback is not called?

And if this is the case do you have any good ideas on how to figure
out when to disable these patches in the physics engine, so that I
dont have multiple patches loaded for the same area?

Brgs.

Ralf Stokholm

2009/4/3 Robert Osfield robert.osfi...@gmail.com:
 Hi Ralf,

 Use the osg::Observer mechanism for watching when objects get deleted.  Just
 register your observer with the TerrainTile/HeightField you've set up your
 physics for then you'll be able to get your observer called when it goes out
 of scope.   osg::observert_ptr uses osg::Observer, as does osg::State so
 have a look at these for usage of Observer.

 Robert.

 On Fri, Apr 3, 2009 at 11:44 AM, Ralf Stokholm alfma...@arenalogic.com
 wrote:

 Hi Robert

 Its not that I need to keep the memmory around.

 I need to know when a terrain tile is unloaded from the scene and use
 that event to unload the physics heightfield as well.

 Im guessing the life of a TerrainTile is similar to this:

 1. Loaded/created by the database pager
 2. Added to the scenegraph by the databasepager.
 3. Disabled/hidden by the CullVisitor.
 4. Enabled/Shown by the CullVisitor. (possibly if it is only culled
 out for a short time OSG 2.6.1)
 5. Unloaded/Destroyed.

 I need a way to catch at least event 1 and 5. Could this be done using
 reference counting or is there a better way?

 Brgs.

 Ralf Stokholm

 2009/4/3 Robert Osfield robert.osfi...@gmail.com:
  Hi Ralf,
 
  If you need to keep the memory around then use a ref_ptr to the
  HeightField, but... this will keep the memory around so if you do no
  longer
  need it you might want to implement a scheme to free it, such as
  watching
  when the ref count goes to one.
 
  The other approach is to use an observer_ptr that doesn't change the
  ref
  count of the HeightFiled, and gets reset to 0 when the HeightField get
  deleted.  You can also use a custom osg::Observer to watch for object
  deletions as well.
 
  Robert
 
  On Fri, Apr 3, 2009 at 11:22 AM, Ralf Stokholm alfma...@arenalogic.com
  wrote:
 
  Hi Robert (list)
 
  Im trying to use the ReadFileCallback to load the heightfield int my
  physics engine.
 
  So far I have been using a CullVisitor to grap the triangles from the
  finished scene, but it has major drawback in that it forces me to load
  the data as meshes which is terrible for memmory and takes a long time
  to load.
 
  It seams im able to load the data as heightfields from the
  ReadFileCallback, but this leads to my next problem. I need a way to
  reference the data later, to be able to remove it when tiles are
  deletet and disable it when tiles are disabled by the scene
  cullvisitor.
 
  Is there a way to relate the nodes i visit in my ReadFileCallback to
  nodes i visit in a special cullvisitor for the final scenegraph?
 
  Basically do you have any hints on how to syncronise the state of my
  physics engine with the state of my Paged VPB terrain?
 
  Brgs.
 
  Ralf Stokholm
 
 
  2009/4/2 Ralf Stokholm alfma...@arenalogic.com:
   Hi Robert
  
   Thanks a lot, was starting to get at this but using a more primitive
   approach of running through all the children of the node that I did
   get.
  
   Will try to implement your method.
  
   Brgs.
  
   Ralf Stokholm
  
   2009/4/2 Robert Osfield robert.osfi...@gmail.com:
   Hi Ralf,
  
   You'll need to write a custom NodeVisitor that traverses through the
   loaded
   scene graph and picks out the TerrainTile using dyanmic cast.   It
   just
   so
   happens that I'm actually working on a ReadFileCallback/custom
   Visitor
   that
   does pick out all the TerrainTile's in a subgraph (there will
   typically
   be
   one, two or four due to the quad tree structure generated by VPB.)
  
   The visitor looks like:
  
   class FindTerrainTileVisitor : public osg::NodeVisitor
   {
   public:
       FindTerrainTileVisitor():
       osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
       {
       }
  
       void reset()
       {
       _terrainTiles.clear();
       }
  
       void apply(osg::Group group)
       {
       osgTerrain::TerrainTile* terrainTile =
   dynamic_castosgTerrain::TerrainTile*(group);
       if (terrainTile)
       {
       _terrainTiles.push_back(terrainTile);
       }
       else
       {
       traverse(group);
       }
       }
  
       typedef std::list osg::ref_ptrosgTerrain::TerrainTile 
   TerrainTiles;
       TerrainTiles _terrainTiles;
   };
  
   The custom ReadFileCallback's readNode method looks like

Re: [osg-users] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-06 Thread Ralf Stokholm
Hi Robert

Lower levels of detail aren't unreferenced but kept around in any paged
database, this includes a osgTerrain::TerrainTile based paged database.

I was expecting this.

With regards to active tiles, my problem is that going this approach I
cant figure out how to extract the state information from the
scenegraph. From what I understand the TerrainTiles that I process
during my read file callback will not provide any information on when
they are invalidated by the loading of higher resolution tiles, right?

I understand that the physics part is specific to my application, but
an interface or pattern for syncronising the active scenegraph
generated when running an osgTerrain::TerrainTile based paged database
with a given application is usefull in other places.

As I said so far we have been using a cullvisitor that runs through
the entire scenegraph looking for terrain nodes. It then checks if
these nodes are already in our set of nodes. If its not a new physics
object is generated by pulling the geometry using a trianglevisitor.
This method is both slow, repeats bookkeping already performed in the
Terrain/Scene graph machinery and uses way more memmory than is
neccecery. Basically I end up generating 3 unique vertices and 3
indecies for each triangle rendered. This will consime roughly 28
times the amount of memmory that would be needed if I could use the
heightfield data directly.

Brgs. Ralf

2009/4/6 Robert Osfield robert.osfi...@gmail.com:
 Hi Ralf,

 Lower levels of detail aren't unreferenced but kept around in any paged
 database, this includes a osgTerrain::TerrainTile based paged database.

 As how to manage the mapping of which physics tiles should be active... well
 I don't know what to recommend, there a lots of different ways you could
 probably tackle it.  My job is the scene graph, I'll leave application dev
 issues to members of the community.

 Robert.

 On Mon, Apr 6, 2009 at 3:12 PM, Ralf Stokholm alfma...@arenalogic.com
 wrote:

 Hi Robert

 I have gotten a bit further with this, and there are some indications
 it might be a viable solution.

 But I have run into a problem, it seams that Im not removing patches
 from my physics engine when higher resolutions patches replaces them.

 Can You confirm that If a given osgTerrain::TerrainTile is replaced by
 its four higher resolution children the acociated heightfields are not
 deleted, and as a result the observer callback is not called?

 And if this is the case do you have any good ideas on how to figure
 out when to disable these patches in the physics engine, so that I
 dont have multiple patches loaded for the same area?

 Brgs.

 Ralf Stokholm

 2009/4/3 Robert Osfield robert.osfi...@gmail.com:
  Hi Ralf,
 
  Use the osg::Observer mechanism for watching when objects get deleted.
  Just
  register your observer with the TerrainTile/HeightField you've set up
  your
  physics for then you'll be able to get your observer called when it goes
  out
  of scope.   osg::observert_ptr uses osg::Observer, as does osg::State
  so
  have a look at these for usage of Observer.
 
  Robert.
 
  On Fri, Apr 3, 2009 at 11:44 AM, Ralf Stokholm alfma...@arenalogic.com
  wrote:
 
  Hi Robert
 
  Its not that I need to keep the memmory around.
 
  I need to know when a terrain tile is unloaded from the scene and use
  that event to unload the physics heightfield as well.
 
  Im guessing the life of a TerrainTile is similar to this:
 
  1. Loaded/created by the database pager
  2. Added to the scenegraph by the databasepager.
  3. Disabled/hidden by the CullVisitor.
  4. Enabled/Shown by the CullVisitor. (possibly if it is only culled
  out for a short time OSG 2.6.1)
  5. Unloaded/Destroyed.
 
  I need a way to catch at least event 1 and 5. Could this be done using
  reference counting or is there a better way?
 
  Brgs.
 
  Ralf Stokholm
 
  2009/4/3 Robert Osfield robert.osfi...@gmail.com:
   Hi Ralf,
  
   If you need to keep the memory around then use a ref_ptr to the
   HeightField, but... this will keep the memory around so if you do no
   longer
   need it you might want to implement a scheme to free it, such as
   watching
   when the ref count goes to one.
  
   The other approach is to use an observer_ptr that doesn't change
   the
   ref
   count of the HeightFiled, and gets reset to 0 when the HeightField
   get
   deleted.  You can also use a custom osg::Observer to watch for object
   deletions as well.
  
   Robert
  
   On Fri, Apr 3, 2009 at 11:22 AM, Ralf Stokholm
   alfma...@arenalogic.com
   wrote:
  
   Hi Robert (list)
  
   Im trying to use the ReadFileCallback to load the heightfield int my
   physics engine.
  
   So far I have been using a CullVisitor to grap the triangles from
   the
   finished scene, but it has major drawback in that it forces me to
   load
   the data as meshes which is terrible for memmory and takes a long
   time
   to load.
  
   It seams im able to load the data as heightfields from

Re: [osg-users] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-03 Thread Ralf Stokholm
Hi Robert (list)

Im trying to use the ReadFileCallback to load the heightfield int my
physics engine.

So far I have been using a CullVisitor to grap the triangles from the
finished scene, but it has major drawback in that it forces me to load
the data as meshes which is terrible for memmory and takes a long time
to load.

It seams im able to load the data as heightfields from the
ReadFileCallback, but this leads to my next problem. I need a way to
reference the data later, to be able to remove it when tiles are
deletet and disable it when tiles are disabled by the scene
cullvisitor.

Is there a way to relate the nodes i visit in my ReadFileCallback to
nodes i visit in a special cullvisitor for the final scenegraph?

Basically do you have any hints on how to syncronise the state of my
physics engine with the state of my Paged VPB terrain?

Brgs.

Ralf Stokholm


2009/4/2 Ralf Stokholm alfma...@arenalogic.com:
 Hi Robert

 Thanks a lot, was starting to get at this but using a more primitive
 approach of running through all the children of the node that I did
 get.

 Will try to implement your method.

 Brgs.

 Ralf Stokholm

 2009/4/2 Robert Osfield robert.osfi...@gmail.com:
 Hi Ralf,

 You'll need to write a custom NodeVisitor that traverses through the loaded
 scene graph and picks out the TerrainTile using dyanmic cast.   It just so
 happens that I'm actually working on a ReadFileCallback/custom Visitor that
 does pick out all the TerrainTile's in a subgraph (there will typically be
 one, two or four due to the quad tree structure generated by VPB.)

 The visitor looks like:

 class FindTerrainTileVisitor : public osg::NodeVisitor
 {
 public:
     FindTerrainTileVisitor():
     osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
     {
     }

     void reset()
     {
     _terrainTiles.clear();
     }

     void apply(osg::Group group)
     {
     osgTerrain::TerrainTile* terrainTile =
 dynamic_castosgTerrain::TerrainTile*(group);
     if (terrainTile)
     {
     _terrainTiles.push_back(terrainTile);
     }
     else
     {
     traverse(group);
     }
     }

     typedef std::list osg::ref_ptrosgTerrain::TerrainTile  TerrainTiles;
     TerrainTiles _terrainTiles;
 };

 The custom ReadFileCallback's readNode method looks like:

     virtual osgDB::ReaderWriter::ReadResult readNode(const std::string
 filename, const osgDB::ReaderWriter::Options* options)
     {
     osg::notify(osg::NOTICE)Loading tile filenamestd::endl;
     osgDB::ReaderWriter::ReadResult result =
 osgDB::Registry::instance()-readNodeImplementation(filename,options);
     if (result.validNode())
     {
     FindTerrainTileVisitor fttv;
     result.getNode()-accept(fttv);
     for(FindTerrainTileVisitor::TerrainTiles::iterator itr =
 fttv._terrainTiles.begin();
     itr != fttv._terrainTiles.end();
     ++itr)
     {
     osgTerrain::TerrainTile* terrainTile = itr-get();
     /// my stuff omitted, put your  stuff here
     }
  }
   }


 Robert.

 On Thu, Apr 2, 2009 at 1:05 PM, Ralf Stokholm alfma...@arenalogic.com
 wrote:

 Hi List

 Im trying to get the heightfiled data from a VPB terrain using
 ReadFileCallback.

 I use the code from readfile callback like this.

   class MyReadFileCallback : public osgDB::Registry::ReadFileCallback
   {
   public:
      virtual osgDB::ReaderWriter::ReadResult readNode(const
 std::string fileName, const osgDB::ReaderWriter::Options* options)
      {
         // note when calling the Registry to do the read you have to
 call readNodeImplementation NOT readNode, as this will
         // cause on infinite recusive loop.
         osgDB::ReaderWriter::ReadResult result =
 osgDB::Registry::instance()-readNodeImplementation(fileName,options);
         if (result.validHeightField())
         {
            LOG_ERROR(Found a valid HeightField);
         }
         return result;
      }
   };

 The idea was simply to see if I had the heightfield available, but
 even though I have verified that it gets called it is never a valid
 heightfield.

 This is on a terrain build using VPB with the --TERRAIN option.

 Shouldent I be able to get the heightfieldnodes?

 Brgs.

 Ralf Stokholm
 ___
 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] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-03 Thread Ralf Stokholm
Hi Robert

Its not that I need to keep the memmory around.

I need to know when a terrain tile is unloaded from the scene and use
that event to unload the physics heightfield as well.

Im guessing the life of a TerrainTile is similar to this:

1. Loaded/created by the database pager
2. Added to the scenegraph by the databasepager.
3. Disabled/hidden by the CullVisitor.
4. Enabled/Shown by the CullVisitor. (possibly if it is only culled
out for a short time OSG 2.6.1)
5. Unloaded/Destroyed.

I need a way to catch at least event 1 and 5. Could this be done using
reference counting or is there a better way?

Brgs.

Ralf Stokholm

2009/4/3 Robert Osfield robert.osfi...@gmail.com:
 Hi Ralf,

 If you need to keep the memory around then use a ref_ptr to the
 HeightField, but... this will keep the memory around so if you do no longer
 need it you might want to implement a scheme to free it, such as watching
 when the ref count goes to one.

 The other approach is to use an observer_ptr that doesn't change the ref
 count of the HeightFiled, and gets reset to 0 when the HeightField get
 deleted.  You can also use a custom osg::Observer to watch for object
 deletions as well.

 Robert

 On Fri, Apr 3, 2009 at 11:22 AM, Ralf Stokholm alfma...@arenalogic.com
 wrote:

 Hi Robert (list)

 Im trying to use the ReadFileCallback to load the heightfield int my
 physics engine.

 So far I have been using a CullVisitor to grap the triangles from the
 finished scene, but it has major drawback in that it forces me to load
 the data as meshes which is terrible for memmory and takes a long time
 to load.

 It seams im able to load the data as heightfields from the
 ReadFileCallback, but this leads to my next problem. I need a way to
 reference the data later, to be able to remove it when tiles are
 deletet and disable it when tiles are disabled by the scene
 cullvisitor.

 Is there a way to relate the nodes i visit in my ReadFileCallback to
 nodes i visit in a special cullvisitor for the final scenegraph?

 Basically do you have any hints on how to syncronise the state of my
 physics engine with the state of my Paged VPB terrain?

 Brgs.

 Ralf Stokholm


 2009/4/2 Ralf Stokholm alfma...@arenalogic.com:
  Hi Robert
 
  Thanks a lot, was starting to get at this but using a more primitive
  approach of running through all the children of the node that I did
  get.
 
  Will try to implement your method.
 
  Brgs.
 
  Ralf Stokholm
 
  2009/4/2 Robert Osfield robert.osfi...@gmail.com:
  Hi Ralf,
 
  You'll need to write a custom NodeVisitor that traverses through the
  loaded
  scene graph and picks out the TerrainTile using dyanmic cast.   It just
  so
  happens that I'm actually working on a ReadFileCallback/custom Visitor
  that
  does pick out all the TerrainTile's in a subgraph (there will typically
  be
  one, two or four due to the quad tree structure generated by VPB.)
 
  The visitor looks like:
 
  class FindTerrainTileVisitor : public osg::NodeVisitor
  {
  public:
      FindTerrainTileVisitor():
      osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
      {
      }
 
      void reset()
      {
      _terrainTiles.clear();
      }
 
      void apply(osg::Group group)
      {
      osgTerrain::TerrainTile* terrainTile =
  dynamic_castosgTerrain::TerrainTile*(group);
      if (terrainTile)
      {
      _terrainTiles.push_back(terrainTile);
      }
      else
      {
      traverse(group);
      }
      }
 
      typedef std::list osg::ref_ptrosgTerrain::TerrainTile 
  TerrainTiles;
      TerrainTiles _terrainTiles;
  };
 
  The custom ReadFileCallback's readNode method looks like:
 
      virtual osgDB::ReaderWriter::ReadResult readNode(const std::string
  filename, const osgDB::ReaderWriter::Options* options)
      {
      osg::notify(osg::NOTICE)Loading tile filenamestd::endl;
      osgDB::ReaderWriter::ReadResult result =
  osgDB::Registry::instance()-readNodeImplementation(filename,options);
      if (result.validNode())
      {
      FindTerrainTileVisitor fttv;
      result.getNode()-accept(fttv);
      for(FindTerrainTileVisitor::TerrainTiles::iterator itr =
  fttv._terrainTiles.begin();
      itr != fttv._terrainTiles.end();
      ++itr)
      {
      osgTerrain::TerrainTile* terrainTile = itr-get();
      /// my stuff omitted, put your  stuff here
      }
   }
    }
 
 
  Robert.
 
  On Thu, Apr 2, 2009 at 1:05 PM, Ralf Stokholm alfma...@arenalogic.com
  wrote:
 
  Hi List
 
  Im trying to get the heightfiled data from a VPB terrain using
  ReadFileCallback.
 
  I use the code from readfile callback like this.
 
    class MyReadFileCallback : public osgDB::Registry::ReadFileCallback
    {
    public:
       virtual osgDB::ReaderWriter::ReadResult readNode(const
  std::string fileName, const osgDB::ReaderWriter::Options* options

[osg-users] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-02 Thread Ralf Stokholm
Hi List

Im trying to get the heightfiled data from a VPB terrain using ReadFileCallback.

I use the code from readfile callback like this.

   class MyReadFileCallback : public osgDB::Registry::ReadFileCallback
   {
   public:
  virtual osgDB::ReaderWriter::ReadResult readNode(const
std::string fileName, const osgDB::ReaderWriter::Options* options)
  {
 // note when calling the Registry to do the read you have to
call readNodeImplementation NOT readNode, as this will
 // cause on infinite recusive loop.
 osgDB::ReaderWriter::ReadResult result =
osgDB::Registry::instance()-readNodeImplementation(fileName,options);
 if (result.validHeightField())
 {
LOG_ERROR(Found a valid HeightField);
 }
 return result;
  }
   };

The idea was simply to see if I had the heightfield available, but
even though I have verified that it gets called it is never a valid
heightfield.

This is on a terrain build using VPB with the --TERRAIN option.

Shouldent I be able to get the heightfieldnodes?

Brgs.

Ralf Stokholm
___
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 heightfield from ReadFileCallback VPB Terrain

2009-04-02 Thread Ralf Stokholm
Hi Jason

Thanks for the surgestion, tried the following.

 osgDB::ReaderWriter::ReadResult result =
osgDB::Registry::instance()-readNodeImplementation(fileName,options);
 if (result.validNode())
 {
LOG_ERROR(Found a valid Node);
if (dynamic_castosgTerrain::TerrainTile*(result.getNode()))
{
   LOG_ERROR(Found a valid TerrainTile);
}
 }

There are plenty of valid nodes, but none of them will accept a cast
to TerranTile, is there a way to verify that my generated dataset
contains TerrainTiles ?

Brgs.

Ralf Stokholm

2009/4/2 Jason Beverage jasonbever...@gmail.com:
 Hi ralf

 Try casting the node to an osgTerrain::TerrainTile. If the cast works you'll
 be able to grab the elevation layer and cast it to a heightfieldlayer and
 grab the hf

 Jason

 Sent from my iPhone

 On Apr 2, 2009, at 8:05 AM, Ralf Stokholm alfma...@arenalogic.com wrote:

 Hi List

 Im trying to get the heightfiled data from a VPB terrain using
 ReadFileCallback.

 I use the code from readfile callback like this.

  class MyReadFileCallback : public osgDB::Registry::ReadFileCallback
  {
  public:
     virtual osgDB::ReaderWriter::ReadResult readNode(const
 std::string fileName, const osgDB::ReaderWriter::Options* options)
     {
        // note when calling the Registry to do the read you have to
 call readNodeImplementation NOT readNode, as this will
        // cause on infinite recusive loop.
        osgDB::ReaderWriter::ReadResult result =
 osgDB::Registry::instance()-readNodeImplementation(fileName,options);
        if (result.validHeightField())
        {
           LOG_ERROR(Found a valid HeightField);
        }
        return result;
     }
  };

 The idea was simply to see if I had the heightfield available, but
 even though I have verified that it gets called it is never a valid
 heightfield.

 This is on a terrain build using VPB with the --TERRAIN option.

 Shouldent I be able to get the heightfieldnodes?

 Brgs.

 Ralf Stokholm
 ___
 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] How to get heightfield from ReadFileCallback VPB Terrain

2009-04-02 Thread Ralf Stokholm
Hi Robert

Thanks a lot, was starting to get at this but using a more primitive
approach of running through all the children of the node that I did
get.

Will try to implement your method.

Brgs.

Ralf Stokholm

2009/4/2 Robert Osfield robert.osfi...@gmail.com:
 Hi Ralf,

 You'll need to write a custom NodeVisitor that traverses through the loaded
 scene graph and picks out the TerrainTile using dyanmic cast.   It just so
 happens that I'm actually working on a ReadFileCallback/custom Visitor that
 does pick out all the TerrainTile's in a subgraph (there will typically be
 one, two or four due to the quad tree structure generated by VPB.)

 The visitor looks like:

 class FindTerrainTileVisitor : public osg::NodeVisitor
 {
 public:
     FindTerrainTileVisitor():
     osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
     {
     }

     void reset()
     {
     _terrainTiles.clear();
     }

     void apply(osg::Group group)
     {
     osgTerrain::TerrainTile* terrainTile =
 dynamic_castosgTerrain::TerrainTile*(group);
     if (terrainTile)
     {
     _terrainTiles.push_back(terrainTile);
     }
     else
     {
     traverse(group);
     }
     }

     typedef std::list osg::ref_ptrosgTerrain::TerrainTile  TerrainTiles;
     TerrainTiles _terrainTiles;
 };

 The custom ReadFileCallback's readNode method looks like:

     virtual osgDB::ReaderWriter::ReadResult readNode(const std::string
 filename, const osgDB::ReaderWriter::Options* options)
     {
     osg::notify(osg::NOTICE)Loading tile filenamestd::endl;
     osgDB::ReaderWriter::ReadResult result =
 osgDB::Registry::instance()-readNodeImplementation(filename,options);
     if (result.validNode())
     {
     FindTerrainTileVisitor fttv;
     result.getNode()-accept(fttv);
     for(FindTerrainTileVisitor::TerrainTiles::iterator itr =
 fttv._terrainTiles.begin();
     itr != fttv._terrainTiles.end();
     ++itr)
     {
     osgTerrain::TerrainTile* terrainTile = itr-get();
     /// my stuff omitted, put your  stuff here
     }
  }
   }


 Robert.

 On Thu, Apr 2, 2009 at 1:05 PM, Ralf Stokholm alfma...@arenalogic.com
 wrote:

 Hi List

 Im trying to get the heightfiled data from a VPB terrain using
 ReadFileCallback.

 I use the code from readfile callback like this.

   class MyReadFileCallback : public osgDB::Registry::ReadFileCallback
   {
   public:
      virtual osgDB::ReaderWriter::ReadResult readNode(const
 std::string fileName, const osgDB::ReaderWriter::Options* options)
      {
         // note when calling the Registry to do the read you have to
 call readNodeImplementation NOT readNode, as this will
         // cause on infinite recusive loop.
         osgDB::ReaderWriter::ReadResult result =
 osgDB::Registry::instance()-readNodeImplementation(fileName,options);
         if (result.validHeightField())
         {
            LOG_ERROR(Found a valid HeightField);
         }
         return result;
      }
   };

 The idea was simply to see if I had the heightfield available, but
 even though I have verified that it gets called it is never a valid
 heightfield.

 This is on a terrain build using VPB with the --TERRAIN option.

 Shouldent I be able to get the heightfieldnodes?

 Brgs.

 Ralf Stokholm
 ___
 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] How do I access the Z-Buffer content from the last render pass

2009-03-09 Thread Ralf Stokholm
Hi Daniel

I dont know if its possible to do this from the native z buffer, but I
know its possible if you create the zbuffer as part of a render target.

i.e.


osg::Texture2D* CreateTexture( unsigned short w, unsigned short h )

{

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

texture-setTextureSize( w, h );

texture-setInternalFormat(GL_RGBA);

texture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);

texture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

return texture;

}

osg::Texture2D* CreateDepthTexture( unsigned short w, unsigned short h )

{

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

texture-setTextureSize( w, h );

texture-setInternalFormat(GL_DEPTH_COMPONENT);

texture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);

texture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

return texture;

}

{

SceneTextureCamera::SceneTextureCamera( int sizeX, int sizeY, const std::
string camera )

{

//create a texture to use as a render target 512 x 512 for now

m_RttFrameBuffer = CreateTexture(sizeX,sizeY);

m_RttDepthBuffer = CreateDepthTexture(sizeX,sizeY);

//get the camera node and do some initialization

m_RttCamera = new osg::Camera;

m_RttCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

m_RttCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

m_RttCamera-setViewport(0, 0, m_RttFrameBuffer-getTextureWidth(),
m_RttFrameBuffer-getTextureHeight());

m_RttCamera-setCullingMode(osg::CullSettings::VIEW_FRUSTUM_CULLING);

m_RttCamera-setCullingActive(true);

// Frame buffer objects are the best option

m_RttCamera-setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER_RTT);

// We need to render to the texture BEFORE we render to the screen

m_RttCamera-setRenderOrder(osg::Camera::PRE_RENDER);

// The camera will render into the texture that we created earlier

m_RttCamera-attach(osg::Camera::COLOR_BUFFER, m_RttFrameBuffer.get());

m_RttCamera-attach(osg::Camera::DEPTH_BUFFER, m_RttDepthBuffer.get());

// Set the view transform of the camera

m_RttCamera-setViewMatrixAsLookAt(osg::Vec3(1.0f, 0.0f, -1.0f),
osg::Vec3(278.1f,
982.1f, -1.0f), osg::Vec3(0.0f, 0.0f, 1.0f));

m_RttCamera-setProjectionMatrixAsPerspective(3.0,1.0,20.0,5.0);

m_RttCamera-setComputeNearFarMode(osg::CullSettings::
DO_NOT_COMPUTE_NEAR_FAR);

// Add whatever children you want drawn to the texture

m_RttCamera-addChild(SceneRoot);

}
Brgs.

Ralf Stokholm
www.arenalogic.com


2009/3/9 Daniel Holz dani...@cm-labs.com

 Hi osg-users,

 is it possible to access the Z-Buffer content from a render pass 1 in the
 shaders during a second render pass 2 if I do not clear the Z-Buffer content
 in pass 1?

 In my project I render my scene in pass 1 and set the clear mask for pass 2
 to 0, hence not clearing neither the color nor the depth buffer:
   pCamPass2-setClearMask(0);

 Now, how do I read out the Z-Buffer content of the gpu for a given pixel in
 the fragment shader of pass2?
 Trying to read from gl_FragDepth did not work.

 Any suggestions?

 Cheers
 Daniel

 ___
 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] OSGDem Question

2009-03-09 Thread Ralf Stokholm
Hi Albert

You can specify a default color as a command line parameter, I have
experienced chrashed using this, but if you build from sources you can
change the default color in the code. That worked for me.

As far as I know the quadtree osgdem builds will always have a rootnode
covering the entire area.

Brgs.

Ralf Stokholm
www.arenalogic.com



2009/3/9 Albert osgfo...@tevs.eu

 Hello All,

 I'm attempting to generate some terrain data of south western Australia
 using OSGdem.  I am using Erdas Imagine to create an Area Of Interest tiff
 file of Australia and then running the file through OSGDem.  My question
 comes in the output portion.  I notice OSGDem is outputting a black canvas
 background behind the terrain so that it forms a rectangular shape.  Is
 there a way I can tell OSGDem not to do that or at least make that black
 background transparent, so I can seamlessly overlay the map I created over a
 lower resolution map of the world.

 I have attached a screen capture of the map (with black background) for
 your reference.

 Thanks in advance,

 Albert

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




 ___
 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] NodeVisitor - how fast can it be ?

2009-01-11 Thread Ralf Stokholm
Hi Vladimir

Im guessing you would still have a problem regarding costal areas, my bet
would be that you would have many nodes that contain both water and land.

Im guessing you should find a way to treat this on the pixel level.

Either by encoding it in the texture or elevation data, or by using stencil
texhniques.

Brgs.

Ralf Stokholm
www.arenalogic.com

2009/1/11 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hello Vladimir,

 So I wrote NodeVisitor that returns a NodeList of nodes that matching a
 certain name.
 But I'm afraid such approach is far not the best (and definitely not so
 fast, because in depth there's a strcomp() somewhere).


 Well, if your NodeVisitor runs in the frame loop of course it's probably
 not best way... The solution might be to only run the visitor at startup
 (when loading the terrain), and save the list of node pointers it returns
 for later. This will work fine if your terrain doesn't change. If there's a
 possibility that your terrain changes, then you can always run the visitor
 only when the terrain changes, so (if the visitor is really slow) you might
 get a frame hit at that time but after that it will be fine.

 In any case, apart from these ideas on how to do things better, for any
 performance concern like this one, the general guidelines apply:
 1. Profile the code and see if it's using up a significant amount of time.
 If not, then don't waste time optimizing it.
 2. If you get a solid 60Hz, it's not worth wasting time optimizing this.

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


Re: [osg-users] [CMake] Output directory for builds

2009-01-03 Thread Ralf Stokholm
Hi Sukender

from osgmacroutils.cmake around line 160 osg 2.6.1

IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/debug or
release by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by
the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin
folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position
relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES
PREFIX ../bin/${OSG_PLUGINS}/)
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES
PREFIX ../../bin/${OSG_PLUGINS}/ IMPORT_PREFIX ../)
ENDIF(NOT MSVC_IDE)
ELSE(OSG_MSVC_VERSIONED_DLL)

Brgs.

Ralf Stokholm
www.arenalogic.com
2009/1/4 Sukender suky0...@free.fr

 (This is half-off-topic)

 Hi all CMake experts,

 I would like to know how OSG's CMake script generates all binaries in one
 directory. I mean osgXX-osg.dll (release) and osgXX-osgd.dll (debug) are
 both generated in /bin, but if I write something like
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
(same for CMAKE_*_OUTPUT_DIRECTORY)
 in another project, then I got my binaries in /bin/Debug and /bin/Release.
 Any idea?

 Sukender
 PVLE - Lightweight cross-platform game engine -
 http://pvle.sourceforge.net/
 ___
 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] Building VPB on Windows

2008-12-24 Thread Ralf Stokholm
Hi Michael

For gdal on windows take a look at FWtools, it includes gdal and a lot of
the plugins that you would have to build yourself.

Brgs.

Ralf Stokholm
www.arenalogic.com

2008/12/24 christophe loustaunau christophe.loustau...@gmail.com

 Hi Michael,

 Cmake can't fing gdal and osg on your system. *
 *For gdal, you can find it here : http://www.gdal.org/*
 *For osg, you may have made an error with your Environment variable.You
 could add your lib path to the Environment variable path.

 Regards.


 On Wed, Dec 24, 2008 at 6:16 AM, Michael W. Hall hal...@att.net wrote:

 Attached you will find reported errors.

 Michael


 On Wed, 2008-12-24 at 00:58 +, Simon Hammett wrote:
  Well it's hard to give you any pointers if you don't supply the error
  messages...
 
  2008/12/23 Michael W. Hall hal...@att.net:
   I just ran the configure utility.  I am getting errors with CMake
   configure.  Reports that a lot of the variables are set to not found.
  
   Windows XP BTW and Visual Studio 2005.
  
   Michael
  
   On Tue, 2008-12-23 at 15:33 -0600, Michael W. Hall wrote:
   I am trying to build VPB on my Windows machine.  I get about 64
 errors.
   I got the 2.6 version of OSG and I got the latest VPB from SVN.  This
   could be my problem.
  
   I created all the Environment variables (i.e. OSG_ROOT, OSG_BIN_PATH,
   etc).  When I tried a rebuild, it failed with the same errors.  Could
   someone put me on track?
  
   Thanks,
   Michael
  
   ___
   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




 --
 Christophe Loustaunau.

 ___
 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] Callback when loading nodes in the database pager

2008-12-19 Thread Ralf Stokholm
Hi Both

Thanks for the hints, ReadFileCallback defenatly seams like it would solve
most of my problem.

How do I determine if the file loaded was part of my terrain or another
specifik pagedLod dataset, and as such should be handled in the
filecallback?

Brgs.

Ralf Stokholm

2008/12/19 Maciej Krol mack...@gmail.com

 Hi Ralf, Christophe

 We use ReadFileCallback to modify requested nodes from database pager. It
 works fine, but make sure Your code is thread safe.

 Regards,
 Maciej

 2008/12/18 christophe loustaunau christophe.loustau...@gmail.com

 Hi Ralf,

 look at ReadFileCallback in the example osgCallBack, it may be what you
 wan't.

 Regards.

   On Thu, Dec 18, 2008 at 2:20 PM, Ralf Stokholm alfma...@arenalogic.com
  wrote:

   Hi List

 Is it possible to attach a callback to handle/modify loaded nodes in the
 database thread?

 Background:

 We are using VPB generatet terrain database in a delta3d application, to
 get the terrain mesh into our simulation we are using a cull visitor which
 takes care of loading loading and removing collision meshes from the physics
 engine when the accociatet node is generatet and removed.

 Even though this approach works well, it is rather slow and it annoys me
 that I have to dublikate bookkeeping which must already be implementet in
 the databasepager. I would also like to put the work in the database thread
 when possible.

 Is there any callbacks or similar for plugging in this code at the
 moment?

 Brgs.

 Ralf Stokholm.
 www.arenalogic.com

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




 --
 Christophe Loustaunau.

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




 --
 Regards,
 Maciej Krol

 ___
 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] Callback when loading nodes in the database pager

2008-12-18 Thread Ralf Stokholm
Hi List

Is it possible to attach a callback to handle/modify loaded nodes in the
database thread?

Background:

We are using VPB generatet terrain database in a delta3d application, to get
the terrain mesh into our simulation we are using a cull visitor which takes
care of loading loading and removing collision meshes from the physics
engine when the accociatet node is generatet and removed.

Even though this approach works well, it is rather slow and it annoys me
that I have to dublikate bookkeeping which must already be implementet in
the databasepager. I would also like to put the work in the database thread
when possible.

Is there any callbacks or similar for plugging in this code at the moment?

Brgs.

Ralf Stokholm.
www.arenalogic.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Framedrops in paged terrain databases windows XP

2008-12-15 Thread Ralf Stokholm
Hi List

I have been fighting a studdering problem in my application for a while, my
best guess at the moment is tht the problem is relatet to paging of large
terrains.

We are using a large terrain build using virtual planet builder.

To test the behavior of this model i load it in osgviewer and I notice the
same drops here, to get some better data on this i modified the stats class
so that it will also collect max times for the various tasks, and changed it
to show frame time and not FPS.

I load the model in the viewer so that it is set up to strech across my two
screens 1920x1200 and 1920x1080.

I rarely see a frametime average above 10 ms, but when I experience the
drops I have seen max frametimes as high as 160 ms. The connections seams to
be with the last draw call that will increase its max time as high as 150
ms.

So I guess my question is what could make my last draw reach so high, is the
interaction with the database pager part of this draw?

I have tried many different settings for the env values for the database
pager, but although they make a difference on performance it dosent seam to
affect the random framedrop.

Im running on windows XP, core2 quad 3 Ghz 4 BG mem, terrain is running of a
2 TB raid 0 drive and I have a Nvidia GTX 280 graphics card.
osg is version 2.6.1

Brgs

Ralf Stokholm
http://arenalogic.eu/air_combat_trainer.aspx
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Framedrops in paged terrain databases windows XP

2008-12-15 Thread Ralf Stokholm
Hi Robert

Thanks for the swift answer.

Will investigate some more and maby check out the new pager options once we
get past our delivery in two days :-)

Marcin

How would not enabling vsync affect the pager?
again framerate is not a problem its the extremely long frames we are seeing
from time to time.

Brgs.

Ralf Stokholm
www.arenalogic.com


2008/12/15 Robert Osfield robert.osfi...@gmail.com

 Hi Ralf,

 Frame drops like this are very likely down to either the OS's virtual
 memory being utilized or memory down on the GPU hitting a limit.  I
 would had thought that frame drops are unlikely to down to the
 database pager itself, although it's management of memory may well be
 exacerbating the situation by not expiry subgraphs quick enough for
 their memory to be reused thus keeping the overall memory consumption
 below tollerable limits.

 The DatabasePager has lots of work done to it since 2.6.1, much of it
 in the area of expiry of subgraph and in particular there is new
 scheme that works to cap the total number of PagedLOD that are loaded
 in to memory, with the later 2.7.x dev releases and svn/trunk you can
 enable this new mode by setting the env var OSG_MAX_PAGEDLOD to a
 value such 500, the lower the value to lower you memory usage will be,
 but the less data will be kept in memory so that you revisit a region
 it won't be cached.

 It just so happens I'm currently working on making the new scheme the
 default setting for the DatabasePager.  The next dev release will have
 this in place.

 Robert.

 On Mon, Dec 15, 2008 at 12:37 PM, Ralf Stokholm alfma...@arenalogic.com
 wrote:
  Hi List
 
  I have been fighting a studdering problem in my application for a while,
 my
  best guess at the moment is tht the problem is relatet to paging of large
  terrains.
 
  We are using a large terrain build using virtual planet builder.
 
  To test the behavior of this model i load it in osgviewer and I notice
 the
  same drops here, to get some better data on this i modified the stats
 class
  so that it will also collect max times for the various tasks, and changed
 it
  to show frame time and not FPS.
 
  I load the model in the viewer so that it is set up to strech across my
 two
  screens 1920x1200 and 1920x1080.
 
  I rarely see a frametime average above 10 ms, but when I experience the
  drops I have seen max frametimes as high as 160 ms. The connections seams
 to
  be with the last draw call that will increase its max time as high as 150
  ms.
 
  So I guess my question is what could make my last draw reach so high, is
 the
  interaction with the database pager part of this draw?
 
  I have tried many different settings for the env values for the database
  pager, but although they make a difference on performance it dosent seam
 to
  affect the random framedrop.
 
  Im running on windows XP, core2 quad 3 Ghz 4 BG mem, terrain is running
 of a
  2 TB raid 0 drive and I have a Nvidia GTX 280 graphics card.
  osg is version 2.6.1
 
  Brgs
 
  Ralf Stokholm
  http://arenalogic.eu/air_combat_trainer.aspx
  ___
  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] VirtualPlantBuilder Ubuntu 64bit Quad Core only using single core

2008-11-04 Thread Ralf Stokholm
You need to call VPB with the vpbmaster exe to make use of multiple cores.

Im not sure what version this is avaliable from, but if you use the rev.
that matches osg 2.6 it will work.

Brgs.

Ralf

2008/11/4 Mark Yantek [EMAIL PROTECTED]

  OSG-USERS,



 My build of VirtualPlanetBuilder(VPB) 0.9.1 only utilizes one core out of
 the available four. Is there a way to tell VPB to use more than one core?



 I'm using Ubuntu 8.10 64-bit with an Intel quad core CPU.



 Thanks



 -Mark Yantek



 ___
 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] VPB bug or faulty data?

2008-10-27 Thread Ralf Stokholm
Hi Alejandro
Im not 100% here, but I think you still need to specify some sort of
projection basis, even plain lat lon uses some defenition of the geoid like
WGS84 og similar.

Natrally it could be a problem with you GTiff file.

What version of VPB OSG are you using?

Brgs.

Ralf

2008/10/27 Alejandro Aguilar Sierra [EMAIL PROTECTED]

 Hi,

 Actually the data has no projections, it is in plain
 longitude/latitude coordinates. Which is the recomended projection for
 data about 1 or two degrees long so I can have it in kilometers?

 Regards,

 -- A.

 On Sun, Oct 26, 2008 at 2:04 AM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi Alejandro
 
  It seams you are missing projection information in the createt geotiff
 file.
 
  VPB needs some sort of projection system information in the input or you
  should specify the projection in the commandline for VPB
 
  It will be faster if you project your source data using ie gdalwarp, adal
  translate can also encode the projection data if its missing and you know
  what it should be.
 
  Brgs.
 
  Ralf Stokholm
 
  2008/10/26 Alejandro Aguilar Sierra [EMAIL PROTECTED]
 
  Hello:
 
  I got DEM data from INEGI (Mexican Geographic Institute) and convert
  it to Geo Tiff.
 
  gdal_translate -of GTiff -co TILED=YES
  MDE-n20s19e097o099.bil volcanes.tif
  gdaladdo -r average volcanes.tif 2 4 8 16 32
 
  gdalinfo volcanes.tif
  Warning 1: TIFFReadDirectory:volcanes.tif: Wrong StripByteCounts
  field, ignoring and calculating from imagelength
  Driver: GTiff/GeoTIFF
  Files: volcanes.tif
  Size is 7200, 3600
  Coordinate System is `'
  Origin = (-99.000,20.000)
  Pixel Size = (0.0002778,-0.0002778)
  Image Structure Metadata:
   INTERLEAVE=BAND
  Corner Coordinates:
  Upper Left  ( -99.000,  20.000)
  Lower Left  ( -99.000,  19.000)
  Upper Right ( -97.000,  20.000)
  Lower Right ( -97.000,  19.000)
  Center  ( -98.000,  19.500)
  Band 1 Block=256x256 Type=UInt16, ColorInterp=Gray
   NoData Value=0
   Overviews: 3600x1800, 1800x900, 900x450, 450x225, 225x113
  Warning 1: TIFFReadDirectory:volcanes.tif: Wrong StripByteCounts
  field, ignoring and calculating from imagelength
 
 
  If I try to create the terrain database this way I get only a line
  osgdem -d volcanes.tif -l 8  -v 1.0 -o volcanes.ive
 
  so I have to give approximate pixel size with xx and yy and it
 apparently
  works.
  osgdem --xx 33 --yy 33 -d volcanes.tif -l 8 -v 1.0 -o volcanes.ive
 
  Is there not enough information in the geotiff file? or this is a bug?
 
  Regards,
 
  -- A.
  ___
  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] VPB bug or faulty data?

2008-10-27 Thread Ralf Stokholm
Hi Alejandro

You can use gdalwarp to (stamp) the projection information into you data.

try using something similar to the following:

//call gdalwarp to project my data to wgs84
//This will create a virtual raster (vrt) which does not copy the data of
the original raster
//but creates a sort of filter for reading the data.
gdal_translate -of vrt -a_srs EPSG:4326  volcanes.tif volcanes.vrt

//Then use the vrt as input
osgdem -d volcanes.vrt  -l 8  -v 1.0 -o kk


EPSG:4326 is short form defenition of a basic lat lon coordinate system,
same format you will receive ie landsat data in.

Hope this helps.

Brgs.

Ralf Stokholm

2008/10/27 Robert Osfield [EMAIL PROTECTED]

 Hi Alejandro,

 Your data *is* the problem, please add the coordinate system info.
 Using the --xx etc options really is not a good solution going
 forward.  Use properly set up data and things will work fine.  Please
 go check out the gdal website for info on how to set up your data.

 As for VPB docs, I haven't had a chance to write full docs for all the
 utilities yet.  There are some notes online.

 Robert.

 On Mon, Oct 27, 2008 at 4:43 PM, Alejandro Aguilar Sierra
 [EMAIL PROTECTED] wrote:
  Hi Robert and Umit,
 
  As probably you already read it, my data is georeferenced but has no
  projection info (plain latitude, l,ongitude). Using plain osgdem
  produces a wrong 1 dimension field (a line).
 
  osgdem -d volcanes.tif  -l 8  -v 1.0 -o kk
 
  I have to give some approximated --xx and --yy data to make it work
  and even so it does wrongly, creating the mirror image in the Y
  direction, as you can see comparing the texture image with the
  produced terrain.
  Any hint?
 
  Where can I find documentation about vpbmaster, vpbcache and vpbsize?
 
  Regards,
 
  -- A.
 
  On Mon, Oct 27, 2008 at 3:40 AM, Robert Osfield
  [EMAIL PROTECTED] wrote:
  Hi Umit,
 
  On Mon, Oct 27, 2008 at 9:25 AM, Ümit Uzun [EMAIL PROTECTED]
 wrote:
  Thanks for clarification. But I remember that, VPB can manipulate only
 WGS84
  referenced data. But it may be valid for only BlueMarble viewer. Sorry
 for
  wrong comment :)
 
  When building geocentric databases VPB reprojects the data into WGS84
  and then builds the data, if you are using vpbmaster then you'll need
  to do this reprojection as a prior step to calling vpbmaster.  The
  vpbcache utility can do this reprojection for you.  If you are just
  using osgdem standalone then it can do the reprojection for you.
 
  The key is that your source data should have at least a projection
  that GDAL recognizes otherwise you end up having to build your own
  projection.  GDAL has tools to allow you to do this.
 
  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] VPB bug or faulty data?

2008-10-26 Thread Ralf Stokholm
Hi Alejandro

It seams you are missing projection information in the createt geotiff file.

VPB needs some sort of projection system information in the input or you
should specify the projection in the commandline for VPB

It will be faster if you project your source data using ie gdalwarp, adal
translate can also encode the projection data if its missing and you know
what it should be.

Brgs.

Ralf Stokholm

2008/10/26 Alejandro Aguilar Sierra [EMAIL PROTECTED]

 Hello:

 I got DEM data from INEGI (Mexican Geographic Institute) and convert
 it to Geo Tiff.

 gdal_translate -of GTiff -co TILED=YES
 MDE-n20s19e097o099.bil volcanes.tif
 gdaladdo -r average volcanes.tif 2 4 8 16 32

 gdalinfo volcanes.tif
 Warning 1: TIFFReadDirectory:volcanes.tif: Wrong StripByteCounts
 field, ignoring and calculating from imagelength
 Driver: GTiff/GeoTIFF
 Files: volcanes.tif
 Size is 7200, 3600
 Coordinate System is `'
 Origin = (-99.000,20.000)
 Pixel Size = (0.0002778,-0.0002778)
 Image Structure Metadata:
  INTERLEAVE=BAND
 Corner Coordinates:
 Upper Left  ( -99.000,  20.000)
 Lower Left  ( -99.000,  19.000)
 Upper Right ( -97.000,  20.000)
 Lower Right ( -97.000,  19.000)
 Center  ( -98.000,  19.500)
 Band 1 Block=256x256 Type=UInt16, ColorInterp=Gray
  NoData Value=0
  Overviews: 3600x1800, 1800x900, 900x450, 450x225, 225x113
 Warning 1: TIFFReadDirectory:volcanes.tif: Wrong StripByteCounts
 field, ignoring and calculating from imagelength


 If I try to create the terrain database this way I get only a line
 osgdem -d volcanes.tif -l 8  -v 1.0 -o volcanes.ive

 so I have to give approximate pixel size with xx and yy and it apparently
 works.
 osgdem --xx 33 --yy 33 -d volcanes.tif -l 8 -v 1.0 -o volcanes.ive

 Is there not enough information in the geotiff file? or this is a bug?

 Regards,

 -- A.
 ___
 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] VPB and multiple ive files...

2008-10-09 Thread Ralf Stokholm
vpbmaster is basically a server for osgdem. You can call it with the exact
same commandline you use to call osgdem, it will then schedule all the
builds and in addition use all the processors on your system for the build.

It will not currently build osga databases but if my experiences hold you
wont be able to generate a 30 gig osga anyway.

my command line

vpbmaster -t input_vrt -d input_dem -l 14 --TERRAIN --max-anisotropy 8.0 -o
F:\dk_dem2\dk_dem.ive

-Ralf

2008/10/9 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
[EMAIL PROTECTED]

 I'm using 0.9.7 on Window XP SP 2. I'm using the command osgdem. What is
 VPB
 master?

 The database size is about 30gig...

 -Shayne

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Ralf
 Stokholm
  Sent: Wednesday, October 08, 2008 3:40 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] VPB and multiple ive files...

 Shayne

 What version of VPB are you using?

 I have succesfully build a database using two different input datasets one
 overall covering app 15x10 deg around denmark to give some area in the
 surroundings. This is very low res. And the 40 cm orthofoto covering all of
 denmark.

 I found that it will fail on winxp 32 if I tryed it with older versions of
 VPB.

 I could not create a osga archive larger than 4 Gig. and for non archived
 .ive output the limit was around 10 Gig.

 Moving to a newer version of VPB and using VPB master I succeded in
 building
 the above mentioned database which is around 500Gig. As im typing this my
 PC
 is 25 hours into a build of the same data with added 10m dem for hight.
 still 12 hours to go :-)

 My experience is that preprojection the inputdata is a good thing.

 Hope this helps.

 Brgs.

 Ralf

 2008/10/8 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
 [EMAIL PROTECTED]


Ralf,

I did try your suggested approach but VPB crashes with an exception.
 I'm
assuming that I've reached the limits of VPB and that it can't
 handle the
high resolution database (all 1 meter texture with level 1 DTED over
 a 2
degree by 2 degree region) along with building the --whole-globe
 option. If
I do them separately, things seem to work fine. That's why I was
 wondering
if I can build them separately and then merge them together.
 Eventually I
would like to have several high res insets that I can merge in and
 out as
need be rather than have one huge database...

-Shayne


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
 Ralf
Stokholm
Sent: Wednesday, October 08, 2008 3:14 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VPB and multiple ive files...

Hi Shayne

From what I understand about your question, this is what VPB is
 build for,
but in stead of chreating two ive*s you would simply feed the data
 to VPB
and ass for a whole world output.

VPB will then automatically handle merging your high resolution area
 into
the whole globe terrain.

Not sure if this was what you asked for

Brgs.

Ralf


2008/10/8 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
[EMAIL PROTECTED]


   This may be a silly question but I was wondering if VPB
 supports
stitching multiple ive files or databases together? In other words,
 can I
build two separate ive files with VPB and then merge them together?
 I would
like to build a whole earth model in one ive file and then merge in
 another
ive file that has a high resolution inset so that the two are tied
together.



   If this inquiry doesn't make sense or is incomplete, please
 accept
my apologies.



   Thanks for the help in advance.

   -Shayne


   ___
   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] VPB and multiple ive files...

2008-10-08 Thread Ralf Stokholm
Hi Shayne

From what I understand about your question, this is what VPB is build for,
but in stead of chreating two ive*s you would simply feed the data to VPB
and ass for a whole world output.

VPB will then automatically handle merging your high resolution area into
the whole globe terrain.

Not sure if this was what you asked for

Brgs.

Ralf

2008/10/8 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
[EMAIL PROTECTED]

  This may be a silly question but I was wondering if VPB supports
 stitching multiple ive files or databases together? In other words, can I
 build two separate ive files with VPB and then merge them together? I would
 like to build a whole earth model in one ive file and then merge in another
 ive file that has a high resolution inset so that the two are tied
 together.



 If this inquiry doesn't make sense or is incomplete, please accept my
 apologies…



 Thanks for the help in advance…

 -Shayne

 ___
 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] VPB and multiple ive files...

2008-10-08 Thread Ralf Stokholm
Shayne

What version of VPB are you using?

I have succesfully build a database using two different input datasets one
overall covering app 15x10 deg around denmark to give some area in the
surroundings. This is very low res. And the 40 cm orthofoto covering all of
denmark.

I found that it will fail on winxp 32 if I tryed it with older versions of
VPB.

I could not create a osga archive larger than 4 Gig. and for non archived
.ive output the limit was around 10 Gig.

Moving to a newer version of VPB and using VPB master I succeded in building
the above mentioned database which is around 500Gig. As im typing this my PC
is 25 hours into a build of the same data with added 10m dem for hight.
still 12 hours to go :-)

My experience is that preprojection the inputdata is a good thing.

Hope this helps.

Brgs.

Ralf
2008/10/8 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
[EMAIL PROTECTED]

 Ralf,

 I did try your suggested approach but VPB crashes with an exception. I'm
 assuming that I've reached the limits of VPB and that it can't handle the
 high resolution database (all 1 meter texture with level 1 DTED over a 2
 degree by 2 degree region) along with building the --whole-globe option. If
 I do them separately, things seem to work fine. That's why I was wondering
 if I can build them separately and then merge them together. Eventually I
 would like to have several high res insets that I can merge in and out as
 need be rather than have one huge database...

 -Shayne

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Ralf
 Stokholm
 Sent: Wednesday, October 08, 2008 3:14 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] VPB and multiple ive files...

 Hi Shayne

 From what I understand about your question, this is what VPB is build for,
 but in stead of chreating two ive*s you would simply feed the data to VPB
 and ass for a whole world output.

 VPB will then automatically handle merging your high resolution area into
 the whole globe terrain.

 Not sure if this was what you asked for

 Brgs.

 Ralf


 2008/10/8 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
 [EMAIL PROTECTED]


This may be a silly question but I was wondering if VPB supports
 stitching multiple ive files or databases together? In other words, can I
 build two separate ive files with VPB and then merge them together? I would
 like to build a whole earth model in one ive file and then merge in another
 ive file that has a high resolution inset so that the two are tied
 together.



If this inquiry doesn't make sense or is incomplete, please accept
 my apologies.



Thanks for the help in advance.

-Shayne


___
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] Finding a paged lod root

2008-10-02 Thread Ralf Stokholm
Hi All

When searching a directorystructure recursively, how do I easily identify a
.ive file as a paged lod root, so that I may stop the recursive search?


Backgruond:

My project is based on delta3d.

The map editor for delta3d (STAGE) will search the datadirectory and search
for models which can be added to a map.

My problem is that my VPB paged terrain database (3 mio files) is one of the
models in that directory, and this means it will take forever to open the
editor.

I would like to add the option for the editor to stop its recursive search
of a directory if it dertermines that an ive is the root of a paged lod
hirachy, could anyone provide some code lines that would reveal this.

Brgs.

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


[osg-users] osgscreencapture to videobuffer async

2008-09-25 Thread Ralf Stokholm
Hi All

In our application we have added the option of capturing video from our
playback stream. It works fine but performance is problematic. We are
currently using a simple glReadPixels call to get the immage from the
videocard, this takes around 5-6 ms in addition we append the immage to an
AVI video stream this takes another 12 ms. It should be possible to put the
12 in another thread, but I was vondering if it would be possible to do the
same with part of the glReadPixels call using PBO's.

This is what I have in mind:

From the Draw thread on initialrendercallback I would:

glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, read_pbo)
glReadPixels() //ASYNC
SignalVideoThread() //Async

and the in the video recorder thread when signaled


glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo);
GLubyte* src = (GLubyte*)ext-glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,
GL_READ_ONLY_ARB);
AVIStream.addframe(src)
glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);

Can someone tell me if this is feasable?, I was thinking that it would be
problematic to do the gl calls from another thread? or should I use a
compleately different approach?

This is run on windowsXP, Core2 quad, Nvidia GX280

Brgs.

Ralf Stokholm
Arenalogic
www.arenalogic.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgscreencapture to videobuffer async

2008-09-25 Thread Ralf Stokholm
Hi Robert / Jean

Thanks for the responce

I realise that glReadPixel has to be called by the drawthread, but as I
understand it the advantage in using pixel buffer objects should be that
glReadPixel would be async and therefore return in wery short time.

The actual download and cost is then put on the glMapBuffer call.

If this (glMapBuffer) was possible to do this in another thread then it
would safe me 5-6 ms in my primary thread. If this is not possible then the
value of the async glReadPixel seams to fall. Especially since it in many
cases seams to be a bit slower than a simple glReadPixel;

Brgs.

Ralf

2008/9/25 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,

 You can only do the glReadPixel call from the graphics thread so you
 can't thread this, all you can do is hide the cost of download from
 the GPU by using a double buffered PBO, as the osgscreencapture
 example illustrates.  To thread the writing of data you'll need to
 have a ring buffer of imagers that the draw thread writes to, and a
 background writing thread reads from.

 Robert.

 On Thu, Sep 25, 2008 at 2:57 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi All
 
  In our application we have added the option of capturing video from our
  playback stream. It works fine but performance is problematic. We are
  currently using a simple glReadPixels call to get the immage from the
  videocard, this takes around 5-6 ms in addition we append the immage to
 an
  AVI video stream this takes another 12 ms. It should be possible to put
 the
  12 in another thread, but I was vondering if it would be possible to do
 the
  same with part of the glReadPixels call using PBO's.
 
  This is what I have in mind:
 
  From the Draw thread on initialrendercallback I would:
 
  glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, read_pbo)
  glReadPixels() //ASYNC
  SignalVideoThread() //Async
 
  and the in the video recorder thread when signaled
 
 
  glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo);
  GLubyte* src =
  (GLubyte*)ext-glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,GL_READ_ONLY_ARB);
  AVIStream.addframe(src)
  glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
  glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
 
  Can someone tell me if this is feasable?, I was thinking that it would be
  problematic to do the gl calls from another thread? or should I use a
  compleately different approach?
 
  This is run on windowsXP, Core2 quad, Nvidia GX280
 
  Brgs.
 
  Ralf Stokholm
  Arenalogic
  www.arenalogic.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

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


Re: [osg-users] CompositeViewer, update traversal, prerender branch

2008-09-21 Thread Ralf Stokholm
Hi Fabian

Windows should handle a window that expands ower multiple devices, in our
application we have a single graphicswindow set up on two screens, the
graphics window is handmodified to position itself in the top left corner,
0,-1080 in this case and extends past both screens. I then set up two views
each taking up the space of a single monitor, and disable the window
decorator.

I know there is a call to do the setup something like
setupviewacrossalllscreens or so, but I havent experimentet with that yet.
Good luck.

Brgs

Ralf Stokholm

2008/9/21 Fabian Bützow [EMAIL PROTECTED]

 Hi Robert,
 thanks for your help in this case and thanks for all your other replies,
 you have been a great source of motivation and advice.

 However, my problem has not been completely solved, yet. You were right,
 with the single graphics context and window for all views, the textures are
 updated now in each View. Cheers! The problem is, that i want to project the
 render result with 2 or 3 projectors onto an object, each projector with an
 individual View. Is it possible to extend the one graphics window over
 several screens/projectors? With that i could undo the window decoration and
 fake two independent views..? Otherwise i probably have to use multiple
 graphics windows and share the context (what id like to avoid, since you
 said that would cause even more problems).

 Cheers,
 Fabian

 ps: i try to summarise, my (restricted) knowledge of graphics
 window/context etc.. Maybe others can contribute to that as well.
 When you dont specify a graphics context for a View, osg generates a new
 unique one for each View. Graphics contexts comprise basically everything
 you need for standard rendering, buffers etc. The scene data of the View is
 copied. Each graphics context is displayed in a new graphics window. (One
 graphics context-one window, multiple Views-multiple graphics
 contexts-multiple graphics windows).

 An update traversal is done only once per scenegraph(?), starting from the
 View that is placed highest in the scenegraph. After that cull and draw
 traversals are executed for each View.

 [Prerender cameras nodes under a View in the scenegraph are rendered once
 for each View, the results of this step are not shared among the Views.]

 hmm-more assumptions than knowledge..i should better stop ;)


 ___
 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] VPB using shoreline / borders vector data to determine alpha

2008-09-04 Thread Ralf Stokholm
Hi Robert /List

Would an option to use a shapefile containing ie. water bodies or borders to
set the transparency of a terrain layer be feaseble?

For my application it would be nice to use border vector data to eleminate
data from one dataset and blend into another.

It should also be relatively easy to extend a terrain with some nice looking
ocean effects if the terrain would simply alphablen into the warter surface
as determined by a shoreline shapefile?

What are your thourghts on this?

Brgs.

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


Re: [osg-users] VPB Status

2008-08-24 Thread Ralf Stokholm
Hi Robert

Had some time to revisit this, and as you suggested is is possible to change
the format of imagery generated if outputting to osg format.

I tried the --image-ext jpeg option and it generated jpg files as expected,
but to my surprise the generated output was larger than a similar dds
output.

I then spend some hours looking for creation options in the jpeg plug in and
found the JPEG_QUALITY option. But it didn't do anything.

This command line:
vpbmaster -t input_vrt -l 4 --build-options JPEG_QUALITY 20 --image-ext
jpeg -o dk2\dk.osg

results in a database of exactly the same size as it was without the
JPEG_QUALITY option.

I even tried leaving it at default and then recompile the jpeg plugin to use
20 as default quality in place of 100, that didn't change anything either.

Can you give me any hints on how to make this work?

Brgs.
Ralf Stokholm
Arenalogic



2008/8/3 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,

 osgdem does support changing the output format of the imagery, but it
 may well need to be accompanied by outputting to .osg.   I must admit
 I haven't tested this specific feature during my work on
 VirtualPlanetBuilder over the last year.  Once OSG-2.6.0 is out I
 should have a chance at revisiting this specific feature.

 Robert.

 On Wed, Jul 30, 2008 at 1:56 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi Robert / all
 
  Thanks for the info on vpbmaster again, finally got around to trying it
 out.
  My data is in the ecw format and after some initial problems the trick
 about
  transforming them into vrt which is recommentet in another thread worked
  like a charm.
 
  Im currently building what will be a roughly 600 gig database 14 levels
  deep. I cant wait to see how it runs in my sim. :-)
 
  During my investigations I tried specifying different output formats like
  jpeg, I expected a jpeg database to be smaller than what is currently
  generatet, but it wassent. Is there no way of generating a database
  containing more compressed data than the default? I know it would
 propably
  hurt paging performance, but it might be worth it in may case.
 
  Brgs.
 
  Ralf
  ___
  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] VPB Status

2008-08-24 Thread Ralf Stokholm
Arrrgh sry

On a rare occasion of brain activity i checked the timestamp on the jpeg
plug in i build with the changed default quality and somehow my build must
have failed.

It now builds much more compressed jpeg's :-)

The question that remains is how to channel the desired compression through
vpb to the writer plug in because my command line doesn't seam to work.

Additionally osg doesn't seam to work as an output, only the top level
texture is shown i guess its because vpb was changed to use sub folders but
the jpegs are all pleased in the root. This is not a big issue though as I
just checked that the jpegs can be embedded in the ive's as well.

Gotta try to build a new terrain and test the paging performance of a
database build with jpeg's

Brgs.

Ralf Stokholm
Arenalogic

2008/8/24 Ralf Stokholm [EMAIL PROTECTED]

  Hi Robert

 Had some time to revisit this, and as you suggested is is possible to
 change the format of imagery generated if outputting to osg format.

 I tried the --image-ext jpeg option and it generated jpg files as expected,
 but to my surprise the generated output was larger than a similar dds
 output.

 I then spend some hours looking for creation options in the jpeg plug in
 and found the JPEG_QUALITY option. But it didn't do anything.

 This command line:
 vpbmaster -t input_vrt -l 4 --build-options JPEG_QUALITY 20 --image-ext
 jpeg -o dk2\dk.osg

 results in a database of exactly the same size as it was without the
 JPEG_QUALITY option.

 I even tried leaving it at default and then recompile the jpeg plugin to
 use 20 as default quality in place of 100, that didn't change anything
 either.

 Can you give me any hints on how to make this work?

 Brgs.
 Ralf Stokholm
 Arenalogic



  2008/8/3 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,


 osgdem does support changing the output format of the imagery, but it
 may well need to be accompanied by outputting to .osg.   I must admit
 I haven't tested this specific feature during my work on
 VirtualPlanetBuilder over the last year.  Once OSG-2.6.0 is out I
 should have a chance at revisiting this specific feature.

 Robert.

 On Wed, Jul 30, 2008 at 1:56 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi Robert / all
 
  Thanks for the info on vpbmaster again, finally got around to trying it
 out.
  My data is in the ecw format and after some initial problems the trick
 about
  transforming them into vrt which is recommentet in another thread worked
  like a charm.
 
  Im currently building what will be a roughly 600 gig database 14 levels
  deep. I cant wait to see how it runs in my sim. :-)
 
  During my investigations I tried specifying different output formats
 like
  jpeg, I expected a jpeg database to be smaller than what is currently
  generatet, but it wassent. Is there no way of generating a database
  containing more compressed data than the default? I know it would
 propably
  hurt paging performance, but it might be worth it in may case.
 
  Brgs.
 
  Ralf
  ___
  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] Challenge for DatabasePager and cameras with high zoom

2008-08-22 Thread Ralf Stokholm
Hi List

Im working on a flightsimulator and have a wery high resolution orthophoto
based terrain.

One of my cameras is a targetingpod(TGP) camera with a very high zoom
factor, to compensate for this I set the cameras lodscale to fit. This all
works fine but the range based loading of lods could be optimised for the
Targeting pod camera by basing it on the frustrum. The TGP will ofthen focus
at the same spot for a loong time and will rearly have a high rate when
changing focus.

So I guess my questin is if it is viable to design the a special paging
scheme based on not only range but also the direction of the camera.

This could then substitute the normal range based paging for special
applications like my TGP camera.

Brgs.

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


Re: [osg-users] Challenge for DatabasePager and cameras with high zoom

2008-08-22 Thread Ralf Stokholm
Hi Ulrich

Havent tried that, is this a camera setting or will it affect my pilot view
camera as well?

Brgs.

Ralf Stokholm

2008/8/22 Ulrich Hertlein [EMAIL PROTECTED]

 Ralf Stokholm wrote:
  One of my cameras is a targetingpod(TGP) camera with a very high zoom
  factor, to compensate for this I set the cameras lodscale to fit. This
  all works fine but the range based loading of lods could be optimised
  for the Targeting pod camera by basing it on the frustrum. The TGP will

 Did you try osg::LOD::setRangeMode(PIXEL_SIZE_ON_SCREEN)?
 /ulrich
 ___
 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] Challenge for DatabasePager and cameras with high zoom

2008-08-22 Thread Ralf Stokholm
Hi Robert

Im using the setLodScale and that works fine solved  the huge problems i had
before.

But based on my current understanding the range based lod scale is less than
optimal for a camera with a large zoom that will only change its
transformation in the world slowly. It will page in an enourmous amount on
textures but will only ever display a small percentage.

This sort of camera must be perfectly suited to a frustrum or screen based
paging algorithm, and my question was if it in your oppinion was feasable in
the current architecture to integrate this as an optional pagingalgorithm.

Based on Ulrichs answer somethin similar might already exist though?

Brgs.

Ralf

2008/8/22 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,

 You can use LODScale to scale the LOD ranges to fit case where you
 want to zoom in.  This can be done without modifying the scene graph
 at - just by setting the osg::Camera in question i.e

  mycamera-setLODScale(0.25);

 Robert.

 On Fri, Aug 22, 2008 at 8:52 AM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi List
 
  Im working on a flightsimulator and have a wery high resolution
 orthophoto
  based terrain.
 
  One of my cameras is a targetingpod(TGP) camera with a very high zoom
  factor, to compensate for this I set the cameras lodscale to fit. This
 all
  works fine but the range based loading of lods could be optimised for the
  Targeting pod camera by basing it on the frustrum. The TGP will ofthen
 focus
  at the same spot for a loong time and will rearly have a high rate when
  changing focus.
 
  So I guess my questin is if it is viable to design the a special paging
  scheme based on not only range but also the direction of the camera.
 
  This could then substitute the normal range based paging for special
  applications like my TGP camera.
 
  Brgs.
 
  Ralf Stokholm
  Arenalogic
 
  ___
  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] osgdem performance...

2008-08-14 Thread Ralf Stokholm
Hi Shayne

We too have had some problems with the terrain, but at the moment it seams
to work fine. I have rearly seen any problems with osgviewer but in my
actual application i have had studders etc.

What sort of hardware are you using, I have a 40 gig 12 level database that
renders perfectly on xp. But it seams that the threading scheme chosen on
osgviewer makes a big difference on the timings that can be visualized in
osgviewer as well. Cull pr. camera draw pr. context seams to work the best,
but I guess that depends on the actual setup.

At the moment we are not adding altitude data to the terrain, this has made
a significant difference previously.

Switching from a dual core to a quad core seamed to make a difference as
well, on the dual core we were able to load both cores to 100% this does not
happen on the quad?

Hope some of this helps.

Brgs.

Ralf Stokholm
Arenalogic

2008/8/14 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
[EMAIL PROTECTED]

  I would like to get some feedback from users that might be rendering OSG
 terrain built with osgdem on Windows XP. Based on previous discussions, I
 understand that the terrain rendering on Windows does not have as good of
 performance as on Linux, however, I'm seeing abysmal frame rates when I'm
 rendering terrain on Windows. The paging performance is horrible. Perhaps
 it's the way I'm constructing my terrain or the setup in my OSG app…I'm not
 sure.



 While I don't understand the algorithm that is being used for OSG terrain,
 I would expect it to perform as good or somewhat close to other Windows
 based earth viewers such as NASA's WorldWind which seems to run just fine on
 Windows with large databases.



 For the record, here's the osgdem command I'm using to build the terrain…



 osgdem –TERRAIN –PagedLOD –geocentric –t dted –d texture –l  10 –o
 terrain/wasatch_utm.ive



 Any input on the matter would be appreciated…

 -Shayne

 ___
 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] VPB for osg 2.4

2008-08-12 Thread Ralf Stokholm
Hi All

Anyone having succes with a specific version of VPB for osg 2.4?

Im building on windowsXP using vpbmaster and it seams to start out fine but
then stops loading the processors and uses a huge amount of memmory. It
dosent really seam to stop again.

Brgs.

Ralf Stokholm

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


Re: [osg-users] VPB for osg 2.4

2008-08-12 Thread Ralf Stokholm
Hi Robert

Thanks for the promt answer. im afraid I cant upgrade to osg 2.6 right now,
we are using delta3d and it is currently constrained to 2.4.

I could try building using the latest tagged VPB 0.9.7 with OSG 2.3.6 would
a dataset created with this combination work with osg 2.4?

Brgs.

Ralf
2008/8/12 Robert Osfield [EMAIL PROTECTED]

 On Tue, Aug 12, 2008 at 8:54 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi All
 
  Anyone having succes with a specific version of VPB for osg 2.4?

 I didn't tag a specific version of VPB for use with OSG.  VPB is still
 in beta.  I have to recommend using VPB svn trunk against OSG 2.6 for
 best stability.

  Im building on windowsXP using vpbmaster and it seams to start out fine
 but
  then stops loading the processors and uses a huge amount of memmory. It
  dosent really seam to stop again.

 This isn't really enough info to be able to guess what might be up.
 If you try out the VPB svn trunk and OSG 2.6, and then provide the
 build info that you've used when you've hit problems so that others
 can try to recreate it.

 Also try building databases under a Unix system, such as Linux, as the
 Windows file system really sucks at handling large datasets that VPB
 churns through, you'll find performance double or more with a decent
 file system.

 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] VPB for osg 2.4

2008-08-12 Thread Ralf Stokholm
 Hi again

Yea, i just went over the latest release branch on delta3d, and it seams
like they have indeed made the change to osg 2.6 ...  Im so sry i didnt
bother to do this first. My only apology is that there was a series of
postings on the delta3d forum a while back surgesting that making the switch
to 2.6 was not trivial.

Sry

Fortunatly it will allow me to stay with VPB head once i make the switch to
newest delta.

Btw i succesfully build a 640 Gig dataset using vpb -r914 on windows XP so
its not impossible on windows :)

Brgs.

Ralf

2008/8/12 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,

 It should be straight forward to recompile Delta3D against OSG 2.6,
 while it's isn't binary compatible with OSG 2.4 the API is very close
 and shouldn't introduce any porting issues.

 Robert.

 On Tue, Aug 12, 2008 at 9:19 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi Robert
 
  Thanks for the promt answer. im afraid I cant upgrade to osg 2.6 right
 now,
  we are using delta3d and it is currently constrained to 2.4.
 
  I could try building using the latest tagged VPB 0.9.7 with OSG 2.3.6
 would
  a dataset created with this combination work with osg 2.4?
 
  Brgs.
 
  Ralf
  2008/8/12 Robert Osfield [EMAIL PROTECTED]
 
  On Tue, Aug 12, 2008 at 8:54 PM, Ralf Stokholm [EMAIL PROTECTED]
 
  wrote:
   Hi All
  
   Anyone having succes with a specific version of VPB for osg 2.4?
 
  I didn't tag a specific version of VPB for use with OSG.  VPB is still
  in beta.  I have to recommend using VPB svn trunk against OSG 2.6 for
  best stability.
 
   Im building on windowsXP using vpbmaster and it seams to start out
 fine
   but
   then stops loading the processors and uses a huge amount of memmory.
 It
   dosent really seam to stop again.
 
  This isn't really enough info to be able to guess what might be up.
  If you try out the VPB svn trunk and OSG 2.6, and then provide the
  build info that you've used when you've hit problems so that others
  can try to recreate it.
 
  Also try building databases under a Unix system, such as Linux, as the
  Windows file system really sucks at handling large datasets that VPB
  churns through, you'll find performance double or more with a decent
  file system.
 
  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] osgdem and UTM terrain tiles...

2008-08-07 Thread Ralf Stokholm
You could try getting overlapping data, my experience is that if your input
data have no overlaps it is likely to see artifacts on the boundaries.

2008/8/7 Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
[EMAIL PROTECTED]

  Using the GDAL tools, I've built a mosaic of terrain tiles that I'm
 stitching together using osgdem to create a terrain database. Each terrain
 tile uses a UTM mapping that is reprojected from a lat/long mapping.
 Unfortunately when I do the reprojection for each tile, the terrain tile
 gets slightly shifted so that when I stitch them all together using osgdem,
 I have discontinuities at each tile boundary in the finished terrain
 database.



 My question is, is there a way to avoid this nasty artifact using either
 GDAL or osgdem? Perhaps I need to resort to another tool to massage the data
 before handing it over to osgdem?



 Thanks for any input in advance…

 -Shayne

 ___
 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] VPB Status

2008-08-03 Thread Ralf Stokholm
Hi Robert

Thanks for the info, will the osga option be enabled again prior to the
release of vpb 1.0? althoúgh the current works fine im having the problem
that after my 600 G dataset has been created (30 Hours on my quad core) it
took another roughly 15-20 hours to copy it to an external ESATA harddrive
using robocopy. :-o

I know this is propable only a problem on windows, but I know that windows
really hate working on folder structures with multi million files, so one
big archive really works in this respect.

As a workaround would increasing the --tile-image-size reduce the number of
files for a similar size / detail dataset?
Brgs.

Ralf
2008/8/3 Robert Osfield [EMAIL PROTECTED]

 Hi Ralf,

 osgdem does support changing the output format of the imagery, but it
 may well need to be accompanied by outputting to .osg.   I must admit
 I haven't tested this specific feature during my work on
 VirtualPlanetBuilder over the last year.  Once OSG-2.6.0 is out I
 should have a chance at revisiting this specific feature.

 Robert.

 On Wed, Jul 30, 2008 at 1:56 PM, Ralf Stokholm [EMAIL PROTECTED]
 wrote:
  Hi Robert / all
 
  Thanks for the info on vpbmaster again, finally got around to trying it
 out.
  My data is in the ecw format and after some initial problems the trick
 about
  transforming them into vrt which is recommentet in another thread worked
  like a charm.
 
  Im currently building what will be a roughly 600 gig database 14 levels
  deep. I cant wait to see how it runs in my sim. :-)
 
  During my investigations I tried specifying different output formats like
  jpeg, I expected a jpeg database to be smaller than what is currently
  generatet, but it wassent. Is there no way of generating a database
  containing more compressed data than the default? I know it would
 propably
  hurt paging performance, but it might be worth it in may case.
 
  Brgs.
 
  Ralf
  ___
  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] VPB Status

2008-07-30 Thread Ralf Stokholm
Hi Robert / all

Thanks for the info on vpbmaster again, finally got around to trying it out.
My data is in the ecw format and after some initial problems the trick about
transforming them into vrt which is recommentet in another thread worked
like a charm.

Im currently building what will be a roughly 600 gig database 14 levels
deep. I cant wait to see how it runs in my sim. :-)

During my investigations I tried specifying different output formats like
jpeg, I expected a jpeg database to be smaller than what is currently
generatet, but it wassent. Is there no way of generating a database
containing more compressed data than the default? I know it would propably
hurt paging performance, but it might be worth it in may case.

Brgs.

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


Re: [osg-users] VPB Status

2008-07-19 Thread Ralf Stokholm
Hi Robert

Thanks for the update, will try experimenting with vpbmaster.

Looking forward to the 1,0 stuff :-)

Brgs.

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


[osg-users] VPB Status

2008-07-18 Thread Ralf Stokholm
Hi Robert / List

What is the status of VPB, it seams like not much has happened the last
quater?

What is the best version of VPB to use with osg 2.4?

At some point you mentioned that you would make a tutorial on the new master
builder any idea when this might appear.

Im sry if I sound impatient, but I have just gotten hold of app 300 Gigs of
orthofoto and elevation data for my latest project and it would be nice with
the distributed build option ;-)

Brgs.

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


[osg-users] VirtualPlanetBuilder and pagedLOD chalenges my Targeting pod camera

2008-05-16 Thread Ralf Stokholm
Hi

Im working on a flight simulator project and have been using VTP to generate
a terrain for visualisation, The input data is 30m landsat orthofoto and 90
m nasa elevation data. In addition there are som higher resolution orthofoto
for specifik target areaes dovn to 25 cm resolution.

My application has a Targeting POD displaying in the cockpit in adition to
the standart otw view, the problem is that I have a hard time getting it to
run smothly. To keep good quality in the TGP view I had to increase the
--radius-to-max-visible-distance-ratio from default 7 to 25 in order to get
the orthophoto to load early enough in my zoomed targeting pod view. I I
generate the terrain without height date it almost runs smooth at that
setting, but with elevation data it studders all the time. Especially when
turning my head.

Im using the delta 3d engine and the allocate 4ms for paging opperations
each frame.

This is tested on a brand new system Core2 duo 3.0 Ghz 4 Gb RAM and a
geforce 9800 GTX, it has a raid0 hard drive etc so I cant emagine this it
the limiting factor. Oh its running windowsXP sry :(

OSG is verison 2.2.0 and VTP is version 0.9.1

The aplication is rendered on 2 displays a 1920x1200 display for the cockpit
TGP view is roughly 512x512 ans a 1920x1080 display for external view.

The following is the command line used for generating the terrain archive.

osgdem -d height -t texture -l 20 --radius-to-max-visible-distance-ratio 25
-v 1.1 --cs +proj=laea +lat_0=55.5 +lon_0=9.5 +x_0=0 +y_0=0 +datum=WGS84
+units=m +no_defs -o denmark.ive -a denmark.osga

Is there any way of making the terrain load later in the OTW view? Or any
other hints on what parameters to play around with to improve the performace
of this?


Brgs

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


Re: [osg-users] VirtualPlanetBuilder and pagedLOD chalenges my Targeting pod camera

2008-05-16 Thread Ralf Stokholm
Hi Robert

Thx a lot for the swift answer. and sry for the acronyms.

Im working on testing it on osg 2.4 and the SVN version of VTP. Will know
more in a few days ( I hope)

It sounds like I should defenatly try running it on a linux box, it will be
quite a challenge though, havent spend much time with linux :(

The reason I have to tweak the *--radius-to-max-visible-distance-ratio
*variable
is that one of my cameras are rendering for a Targeting Pod (One of those
aiming devices for laser guided bombs that you see on Discovery) This camera
has the ability to zoom in on the target arear vith i.e. a 1.5 degree field
of view, this results in visual artifacts ( texture popping) because a given
lod is simply visible from farther away.

If i increase the *--radius-to-max-visible-distance-ratio *my normal out the
vindow view, which is rendered on a second screen using the same data will
load the same lods roughly 3 times too early. This camera uses a more normal
60 degree field of view, and wont have to load the lods at the same time.

I have testet the database in osgViewer and it seams to run smoother, but if
i set up the view to rotate cose to ground so the data rendered at any given
time will change fast i still get studders/framedrops.

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


[osg-users] Problem with multiple windows and GLcontext I think

2008-05-14 Thread Ralf Stokholm
Hi All
Im getting a chrash when using a hardwaremesh defined in the open source
engine delta3d, I have postet this question on thir forum as well but so far
no one has answered and since this might be relatet to osg or opengl ill try
posting it here.

My application makes use of two windows window a shows a head down view of a
cockpit and window b shows a view of the outside. In the cockpit view I have
a MFD (multi function display) that are linked to a targeting pod camera.
This camera also renders the outside as seen through the targeting pod.

I resently started experimenting with AI and characters and my problem
showed up the first time the character was shown in both views at the same
time, it chrashes with an exception that (as far as I can see) originates in
the graphics driver. The problem is shown both on nvidia and ati graphics
cards.

The last point in the call stack that i have code for is this function.

void HardwareSubmeshDrawable::drawImplementation(osg::RenderInfo
renderInfo) const
{
   //select the appropriate mesh
   mHardwareModel-selectHardwareMesh(mMeshID);
   osg::State  state = *renderInfo.getState();
   //bind the VBO's
   state.disableAllVertexArrays();
   const Extensions* glExt = getExtensions(state.getContextID(),true);
   glExt-glBindBuffer(GL_ARRAY_BUFFER_ARB, mVertexVBO);
   unsigned stride = 18 * sizeof(float);
   #define BUFFER_OFFSET(x)((GLvoid*) (0 + ((x) * sizeof(float
   state.setVertexPointer(3, GL_FLOAT, stride, BUFFER_OFFSET(0));
   state.setNormalPointer(GL_FLOAT, stride, BUFFER_OFFSET(3));
   state.setTexCoordPointer(0, 2, GL_FLOAT, stride, BUFFER_OFFSET(6));
   state.setTexCoordPointer(1, 2, GL_FLOAT, stride, BUFFER_OFFSET(8));
   state.setTexCoordPointer(2, 4, GL_FLOAT, stride, BUFFER_OFFSET(10));
   state.setTexCoordPointer(3, 4, GL_FLOAT, stride, BUFFER_OFFSET(14));
   //make the call to render
   glExt-glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, mIndexVBO);
   glDrawElements(GL_TRIANGLES,  mHardwareModel-getFaceCount() * 3,
(sizeof(CalIndex)  4) ?
 GL_UNSIGNED_SHORT: GL_UNSIGNED_INT, (void*)(sizeof(CalIndex) *
mHardwareModel-getStartIndex()));
   glExt-glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
   glExt-glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);

   // This data could potential cause problems
   // so we clear it out here (i.e CEGUI incompatible)
   state.setVertexPointer(NULL);
   state.setNormalPointer(NULL);
   state.setTexCoordPointer(0, NULL);
   state.setTexCoordPointer(1, NULL);
   state.setTexCoordPointer(2, NULL);
   state.setTexCoordPointer(3, NULL);
}

From chat i can see the function is calle 3 times for each window to draw
the character and the only difference is in the GLContextId and other
context related members of state.

The chrash comes from this line.

   glDrawElements(GL_TRIANGLES,  mHardwareModel-getFaceCount() * 3,
(sizeof(CalIndex)  4) ?
 GL_UNSIGNED_SHORT: GL_UNSIGNED_INT, (void*)(sizeof(CalIndex) *
mHardwareModel-getStartIndex()));

Can any of you see anything wrong with this code or give me a hint where to
look, there is no problem as long as im only rendering the character in one
window, I teste the behavior in a delta3d sample and if the character is
rendered in 2 windows at the same time it chrashes, if it is rendered in two
view's in the same window it works fine.

Brgs.

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