[osg-users] Separate rendering of renderbins

2012-02-03 Thread Sebastian Messerschmidt

Hello,

I know this question has been asked before, but I didn't extract enough 
information out of the answers to understand it fully.
What I want to achive seems simple. I have separate renderpasses with 
the same viewpoint to render different parts of the scene to different 
rendertargets.
For example I need to split the opaque parts from the 
transparent/translucent ones.
Right now, I'm using nodemasks on the cameras an respective parts of the 
scene. Unfortunally this brings two major problems:
1. Everything has to traversed/culled more by every camera. So if the 
scenegraph is large and complex with node masks only near the leaves, 
the accumulated cull time will be a problem.
2. If a geode has transparent and opaque parts it is impossible to do it 
correctly, as drawables are second class nodes i.e. don't carry nodemasks.


So right now I'm splitting up geodes with different renderbins an 
reorder them. Naturally this can have a huge impact on the scene, as it 
get cluttered at the bottom effectively cutting my framerate in certain 
scenes to half and below.

The idea I had in the last day would like this (in a rather abstract way):

Cull the scene once and let different cameras use different renderbins 
to render to their target.




Now my problem is, that I don't know where to start with this, or if 
there are some things in OSG that might even allow this naturally.


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


[osg-users] iOS and OSG in Xcode

2012-02-03 Thread Alex Olivas

Hey All,
I'm trying to write an iOS app using OSG in Xcode
( all three of which are fairly new to me ) and am trying
to get just a basic example working.  I followed the
recipe in the README.txt to generate the Xcode project,
but when I open it Xcode stops responding and the CPU
pegs at 100%.  I'm assuming this is abnormal.

I'm using OSG 3.0.1, Xcode 3.2.5, and the iPhone 4.2 SDK
on Snow Leopard ( 10.6.8 ).

Here's the recipe I followed : http://codepad.org/SsOergMF

I set OSG_BUILD_PLATFORM_IPHONE_SIMULATOR and
OSG_GLES2_AVAILABLE.  Also installed freetype from OF.

Any ideas?  This is abnormal, right?  Any help would be
greatly appreciated.
Thanks,
Alex.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Win32 Bitmap to osg Image

2012-02-03 Thread Vincent Bourdier

Hi Urich,

Le 03/02/2012 05:41, Ulrich Hertlein a écrit :

what errors/issues/non-results are you seeing?  Black?  Reversed colors?  
Crashes?


The BGR become RGB without conversion, so the image is almost good, 
unless the color component that are swapped between red and blue.



(As I understand it you want to use the Bitmap directly as an image (not save 
it and read
it back) so I'm not sure where the plugin fits into the picture.)

It was just to see how OSG manage this issue.

First of all you don't need to do 'allocateImage' *AND* 'setImage'.  
'allocateImage'
allocates memory internally to osg::Image that can then be filled but I assume 
you already
have a buffer that it should use, so 'setImage' would be enough.
Yes, I'll remove the allocateImage call if it is not necessary, it was 
working well so I didn't change this piece of code...



osg::Image::setImage is designed to allow the user to specify a buffer that 
osg::Image
then uses (and manages, depending on the AllocationMode).  When you're passing 
a buffer
allocated by somebody else you may want to use AllocationMode::NO_DELETE, so 
that
osg::Image does not delete/free it.
Yes, thanks to this precision but I prefer the image to delete the 
content of the buffer in my implementation.



Regarding the RGB vs BGR you only want to change the 'pixelFormat' parameter, 
not the
'internalTextureFormat'.

I would naively expect that either
_image-setImage(width, height, 1, GL_RGB,
GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::NO_DELETE);
or
_image-setImage(width, height, 1, GL_RGB,
GL_BGR, GL_UNSIGNED_BYTE, data, osg::Image::NO_DELETE);
would do the trick.
I'll try this but I don't think it would be so easy... even if it would 
be very interesting !


Thanks a lot for your help, I'll continue to analyze this.

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


Re: [osg-users] iOS and OSG in Xcode

2012-02-03 Thread Stephan Maximilian Huber
Hi Alex,

the generated xcode project is pretty big and xcode munges a lot of
cycles on it. Does it open at all if you wait some time? It takses two
minutes to open the project on an old macmini with 1.25GB RAM.

As an alternative you can try the handmaintained xcode-project from
github. It comes with a recent osg-version, but does not offer all
plugins but is usable for device and simulator.

https://github.com/stmh/osg/tree/iphone (use the iphone branch)

cheers,
Stephan


Am 03.02.12 10:29, schrieb Alex Olivas:
 Hey All,
 I'm trying to write an iOS app using OSG in Xcode
 ( all three of which are fairly new to me ) and am trying
 to get just a basic example working.  I followed the
 recipe in the README.txt to generate the Xcode project,
 but when I open it Xcode stops responding and the CPU
 pegs at 100%.  I'm assuming this is abnormal.
 
 I'm using OSG 3.0.1, Xcode 3.2.5, and the iPhone 4.2 SDK
 on Snow Leopard ( 10.6.8 ).
 
 Here's the recipe I followed : http://codepad.org/SsOergMF
 
 I set OSG_BUILD_PLATFORM_IPHONE_SIMULATOR and
 OSG_GLES2_AVAILABLE.  Also installed freetype from OF.
 
 Any ideas?  This is abnormal, right?  Any help would be
 greatly appreciated.
 Thanks,
 Alex.
 ___
 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] Problems with textures converted

2012-02-03 Thread Johan Thengi
It was the Gamma / LUT! Thank you! It works now;)
... 

Thank you!

Cheers,
Johan

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





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


[osg-users] Visualize water on dem

2012-02-03 Thread Mohammed Rashad
All,
I know my question doesnt have a single line answer.
But it will be great if somone provides some info or sparks for starting
I have an SRTM data. I created deom using osgdem
and i got a srtm_12.ive file which I visualized using osgviewer and is fine
Now I want to show that
How a water flow occurs in DEM
or srtm_12.ive data
dem contains some valleys and hills so i need to find a way in OSG to
display water get accumulated on terrain valleys(no realtime rendering).

For a given altitude I need to show the coast of dem which is filled with
water

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


[osg-users] Visualize water on dem

2012-02-03 Thread Sergey Kurdakov
Hi Rashad,

take a look at osgOcean http://code.google.com/p/osgocean/ see examples in
the code,

there was a osgRiver submission ( which I cannot find  on the net, but I
can mail you code )
still the poster is on the net

*http://graphics.tudelft.nl/~ruben/PosterI3D2010.pdf

*

read also docs here http://graphics.tudelft.nl/Game_Technology/Smelik

Regards
Sergey



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


[osg-users] DatabaseCacheReadCallback trouble, crashes when maxNumFilesToCache is too large

2012-02-03 Thread Ed LaFave
Hi,

I've got a pretty large terrain database in the OpenFlight format. I've written 
an algorithm that samples the elevation at various/lots of points throughout 
the entire database. To accomplish this I'm wrapping a LineSegmentIntersector  
inside an IntersectionVisitor.

This first iteration of the algorithm took forever seemingly because each 
height query would page in one of the OpenFlight tiles, perform the height 
query, and discard that data. So the next height query would have to page in 
the same data again. To address this issue I started giving the 
IntersectionVisitor a reference to my DatabaseCacheReadCallback.

This second iteration of my algorithm sped up performance dramatically. 
However, if I set the maximum number of files to cache to too high a number it 
will crash OSG. Presumably, because I'm running out of memory before the cache 
is full.

Any suggestions on how to handle this? It would be nice if I could set a memory 
size on the cache file as opposed to the number of files. It would be nice if I 
could somehow tell OSG to gracefully handle this error. I'm sure the API 
address this issue and I'm just missing it, any suggestions?

Here is a code sample of what I'm doing...


Code:

osg::Vec3d lineStart(xyPoint.x(), xyPoint.y(), -100);
osg::Vec3d lineEnd(xyPoint.x(), xyPoint.y(), 100);

osg::ref_ptrosgUtil::LineSegmentIntersector lineSegmentIntersector =
new osgUtil::LineSegmentIntersector(lineStart, lineEnd);
osg::ref_ptrosgUtil::IntersectionVisitor intersectionVisitor = new 
osgUtil::IntersectionVisitor(lineSegmentIntersector, 
mDatabaseCacheReadCallback);
mRootNode-accept(*(intersectionVisitor.get()));

osgUtil::LineSegmentIntersector::Intersections intersections = 
lineSegmentIntersector-getIntersections();
if(intersections.size()  0)
{
const osg::Vec3d intersectionPoint = 
intersections.begin()-getLocalIntersectPoint();
}




Thank you!

Cheers,
Ed[/code]

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





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


Re: [osg-users] [build] make-ing error with osg

2012-02-03 Thread Hobbes Pierre
Hi,

Thank you very much. The first answer already helped!!

Thank you thank you!

best regards,
Kati

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





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


[osg-users] Case IN-sensitivity for osgDB when searching for files

2012-02-03 Thread Chris Hanson
Ran into a problem where models made on a Windows box didn't work on a
Linux box because the modeler had stored texture filenames in the file in
one case foo.jpg and the actual image file was a different case foo.JPG.

Obviously the solution is to fix the model, but unfortunately, I am dealt
the task of dealing with clueless modelers and yet-unborn clueless models
in the wild.

I believe I could rig some code to, in the event of a failure to locate a
file, get a directory listing of each osgDB search path, and attempt a
case-insensitive string compare looking for a file that matches, and then
load that.

My questions are:

Is there a better way to do this or away to do this already?

Is there an osgDB callback that I could hook into that would let me make
one last-ditch effort at finding a file before osgDB gives up?

I suspect I'd have to use something like BOOST::filesystem to do the
directory listing in a portable manner, which means this would be code that
couldn't be in core OSG (because of BOOST), hence the callback. If there's
a better way to do this within core OSG, and it would be a welcomed
submission, I'd be happy to do it that way too. Obviously it would have to
be an optional behavior since not everybody on Linux/OSX wants artificial
case insensitivity.

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


Re: [osg-users] Separate rendering of renderbins

2012-02-03 Thread Terry Welsh
Hi Sebastian,
I wanted to do this too.  Specifically, I wanted to cull once based on
the view frustum, then use nodemasks to render regular geometry to one
buffer and render everything that glows to a glow texture.
Unfortunately, I never figured out a way to do this.  I don't think
it's possible with OSG so I am doing all the culling twice.  I hope
someone can tell us otherwise.

I still have not gotten around to trying to use multiple render
targets and shaders to direct different information to each one, but
this might be an option.
--
Terry Welsh
mogumbo 'at' gmail.com
www.reallyslick.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Case IN-sensitivity for osgDB when searching for files

2012-02-03 Thread Jason Daly

On 02/03/2012 04:55 PM, Chris Hanson wrote:
Ran into a problem where models made on a Windows box didn't work on a 
Linux box because the modeler had stored texture filenames in the file 
in one case foo.jpg and the actual image file was a different case 
foo.JPG.


Obviously the solution is to fix the model, but unfortunately, I am 
dealt the task of dealing with clueless modelers and yet-unborn 
clueless models in the wild.


I believe I could rig some code to, in the event of a failure to 
locate a file, get a directory listing of each osgDB search path, and 
attempt a case-insensitive string compare looking for a file that 
matches, and then load that.


My questions are:

Is there a better way to do this or away to do this already?

Is there an osgDB callback that I could hook into that would let me 
make one last-ditch effort at finding a file before osgDB gives up?


I suspect I'd have to use something like BOOST::filesystem to do the 
directory listing in a portable manner, which means this would be code 
that couldn't be in core OSG (because of BOOST), hence the callback. 
If there's a better way to do this within core OSG, and it would be a 
welcomed submission, I'd be happy to do it that way too. Obviously it 
would have to be an optional behavior since not everybody on Linux/OSX 
wants artificial case insensitivity.


Hi, Chris,

In case you weren't aware, osgDB::findFileInPath (and it's companion, 
findFileInDirectory) has an option for case insensitivity.  I had to 
deal with a similar problem when I was writing the .mdl plugin 
(apparently, Valve's artists didn't care much about matching case, 
either).  Of course, I had the advantage that I could specify 
CASE_INSENSITIVE in the plugin, and know that it would be OK in all 
cases.  That's probably not true in your case.


Still, if you can figure out a way to hook in your last-ditch effort, 
there's already a tool to help.


--J

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


Re: [osg-users] Case IN-sensitivity for osgDB when searching for files

2012-02-03 Thread Thrall, Bryan
Chris Hanson wrote on 2012-02-03: 
 Ran into a problem where models made on a Windows box didn't work on a
 Linux box because the modeler had stored texture filenames in the file
in
 one case foo.jpg and the actual image file was a different case
foo.JPG.
...
 Is there a better way to do this or away to do this already?
 
 Is there an osgDB callback that I could hook into that would let me
make one
 last-ditch effort at finding a file before osgDB gives up?

You could add a osgDB::ReadFileCallback to the osgDB::Registry that
would do a case-insensitive search for the file.
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com


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


Re: [osg-users] Case IN-sensitivity for osgDB when searching for files

2012-02-03 Thread Chris Hanson
Thanks guys. That's exactly what I was envisioning. I didn't realize
findFileInPath had that option, so that would make it easier than
using BOOST. I'd guess the readfilecallback would call the normal read
implementation. If it succeeded, it could return that, and if it
failed, try  findFileInPath and then readImageImplementation() and
return the result of that.

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