Watson Ladd | 1 Oct 2006 03:22
Picon

Cross-platform development

Hello,
I am working on a cross-platform app that uses OSG. The primary
development environment is a Mac.  The goal is to minimize per-OS build
system changes. How should I do this?
Thanks,
Watson Ladd.
-- 
They who would give up an essential liberty for temporary security,
 deserve neither liberty or security
--Benjamin Franklin

Hello,
I am working on a cross-platform app that uses OSG. The primary
development environment is a Mac.  The goal is to minimize per-OS build
system changes. How should I do this?
Thanks,
Watson Ladd.
--

-- 
They who would give up an essential liberty for temporary security,
 deserve neither liberty or security
--Benjamin Franklin

Alan Purvis | 1 Oct 2006 04:28
Favicon

Re: Cross-platform development

Hi Watson,

I'm doing exactly the same thing with some software I'm developing.  
My program is being developed on a mac, but with the intention that  
it should be subsequently ported to other platforms. OSG is  
wonderfully platform agnostic, especially if you can do away with  
producer and use your own windowing code, though producer does  
support mac/linux/windows, so if they're your only platforms of  
concern you might not mind that restriction. Other than that, the  
usual rules of cross platform development will obviously apply to  
your own code, keep everything platform specific away from the  
general iso-c++ stuff, consider using polymorphism to abstract  
platform specifics from general application concepts.

On a slightly unrelated topic, how do you find developing your code  
on a mac? I've been a long time mac user (over a decade), but I've  
been growing increasingly disgruntled with the state of 3d  
development on the mac, glsl support in particular. Sometimes I  
wonder if disposing of the niceties of osx in favour of real real gpu  
drivers wouldn't be worth it. It's downright ridiculous that a quad  
g5 with 8gb of ram and a 7800gt shouldn't support floating point  
fbos, or up until recently, glsl at all :(

Alan.

On 1 Oct 2006, at 02:22, Watson Ladd wrote:

> Hello,
> I am working on a cross-platform app that uses OSG. The primary
> development environment is a Mac.  The goal is to minimize per-OS  
(Continue reading)

Robert Osfield | 1 Oct 2006 10:49
Picon

Re: Near/Far Clipping Plane when integrating OSG with external renderers

Hi Roland,

The best I can suggest is to compute the required near and far planes for your other renderers then use this is the clamping of the near and far in OSG's cull traversal, then take its results back into setting the projection matrix of the other renderers. 

Alternatively do you own work to compute the near and far for all renderers yourself then apply the projection matrices and keep the compute near far off in the OSG.

Robert.

On 9/30/06, osg-users.20.artus-w1QkCcy0X+BxKfgMtfWJuA@public.gmane.org <osg-users.20.artus-w1QkCcy0X+BxKfgMtfWJuA@public.gmane.org > wrote:
Hello Robert,

we would prefer not to disable near/far planes to use the available
z-buffer resolution as good as possible.

The problem with overriding the clamping is, that this only helps, when
the near and far planes for all other renderers are known before the
culling step of OSG and the final projection matrix is then calculated
within the clamping callback.

This integrates quite badly with the rest of our rendering system. We
need to get the clipping planes from all renderers first. Then a new
projection matrix is calculated based on these clipping planes. This
matrix is finally used for rendering.

Best regards,
Roland

Robert Osfield schrieb:
> Hi Roland,
>
> You can disable the compute of the near far planes (see the FAQ), or
> override the clamping of the near far via methods in osgUtil::CullVisitor,
> you'll need to bit of digging as I can't recall the methods off the top of
> my head.
>
> Robert.
>
> On 9/26/06, osg-users.20.artus-w1QkCcy0X+BxKfgMtfWJuA@public.gmane.org <
> osg-users.20.artus-w1QkCcy0X+BxKfgMtfWJuA@public.gmane.org> wrote:
>>
>> Hello,
>>
>> Thanks for your answer. I think, using the bounding volume of the whole
>> scene won't help much. We want to use the scene graph to render objects
>> into terrain, which is drawn by our own renderer. So most of the time
>> the user will probably be within the scene graphs bounding volume.
>>
>> We considered using a fixed near plane, but would prefer to use a
>> dynamically calculated one, since the terrain mesh is quite big and we
>> would like to use the available z-resolution as optimal as possible.
>>
>> But if there is no other way, we will possibly use a fixed near plane.
>> The two other options, I see at the moment is either writing my own
>> visitor to find the near plane or using an really ugly hack to change
>> the projection matrix after the culling step.
>>
>> State seems to be ok at the moment, though I got the problem, that OSG
>> stops with an GL_ERROR, when an VertexBuffer is bound before its draw is
>> called. Possibly a bug?
>>
>> Best Regards,
>> Roland
>>
>> Paul Martz schrieb:
>> > Do you need to have OSG recompute the near/far planes? If not, I would
>> > disable it if I were you, and instead use the top-level bounding volume
>> in
>> > your computation of the global projection matrix.
>> >
>> > I used to maintain an application that had OSG as well as other
>> renderers. I
>> > did as described above: I created a projection matrix used by all
>> renderers
>> > based on the bounding volumes of all geometry in all renderers, and I
>> told
>> > the osgUtil::SceneView to not compute the near/far planes.
>> >
>> > (The bigger problem I ran into was managing state between all the
>> renderers,
>> > but that's another thread.)
>> >
>> > Best of luck with this,
>> >    -Paul
>> >
>> >
>> >> -----Original Message-----
>> >> From: osg-users-bounces-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
>> >> [mailto:osg-users-bounces-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org] On Behalf Of
>> >> osg-users.20.artus-w1QkCcy0X+BxKfgMtfWJuA@public.gmane.org
>> >> Sent: Tuesday, September 26, 2006 1:15 AM
>> >> To: osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
>> >> Subject: [osg-users] Near/Far Clipping Plane when integrating
>> >> OSG withexternal renderers
>> >>
>> >> Hello,
>> >>
>> >> we would like to combine OSG with other renderers, which are
>> >> called independent from OpenScene Graph. The Problem is, that
>> >> for this to work, all renderers have to use the same near and
>> >> far clipping planes.
>> >>
>> >> To do this, we collect the near and far clipping planes,
>> >> required by the different renderers, before we start
>> >> rendering and combine them to an projection mMatrix, which is
>> >> then used by all renderers.
>> >>
>> >> At the moment I'm using osgUtil::SceneView to render the Scene Graph.
>> >> The problem is, that the clipping planes are calculated in
>> >> SceneView::cull. But after calling cull it seems to be
>> >> impossible to change the projection matrix again, as it is
>> >> already stored in the renderLeaf objects and a change has no
>> >> effect, before cull is called a second time.
>> >>
>> >> Is it possible to get the clipping planes independent from
>> >> the culling?
>> >> Or is it somehow possible, to change the projection matrix
>> >> after culling? Or would you generally recommend a completely
>> >> different approach to combine OSG with other renderers?
>> >>
>> >> We already considered integrating the other renderers in
>> >> Scene Graph nodes, but would prefer, to keep them apart to
>> >> reduce the dependence on each other.
>> >>
>> >> Best Regards,
>> >> Roland
>> >> _______________________________________________
>> >> osg-users mailing list
>> >> osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
>> >> http://openscenegraph.net/mailman/listinfo/osg-users
>> >> http://www.openscenegraph.org/
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
>> > http://openscenegraph.net/mailman/listinfo/osg-users
>> > http://www.openscenegraph.org/
>> >
>> >
>> _______________________________________________
>> osg-users mailing list
>> osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
>> http://openscenegraph.net/mailman/listinfo/osg-users
>> http://www.openscenegraph.org/
>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

<div>
<p>Hi Roland,<br><br>The best I can suggest is to compute the required near and far planes for your other renderers then use this is the clamping of the near and far in OSG's cull traversal, then take its results back into setting the projection matrix of the other renderers.&nbsp; 
<br><br>Alternatively do you own work to compute the near and far for all renderers yourself then apply the projection matrices and keep the compute near far off in the OSG.<br><br>Robert.<br><br></p>
<div>
<span class="gmail_quote">
On 9/30/06, <a href="mailto:osg-users.20.artus@...">osg-users.20.artus@...</a> &lt;<a href="mailto:osg-users.20.artus@...">osg-users.20.artus@...
</a>&gt; wrote:</span><blockquote class="gmail_quote">Hello Robert,<br><br>we would prefer not to disable near/far planes to use the available
<br>z-buffer resolution as good as possible.<br><br>The problem with overriding the clamping is, that this only helps, when<br>the near and far planes for all other renderers are known before the<br>culling step of OSG and the final projection matrix is then calculated
<br>within the clamping callback.<br><br>This integrates quite badly with the rest of our rendering system. We<br>need to get the clipping planes from all renderers first. Then a new<br>projection matrix is calculated based on these clipping planes. This
<br>matrix is finally used for rendering.<br><br>Best regards,<br>Roland<br><br>Robert Osfield schrieb:<br>&gt; Hi Roland,<br>&gt;<br>&gt; You can disable the compute of the near far planes (see the FAQ), or<br>&gt; override the clamping of the near far via methods in osgUtil::CullVisitor,
<br>&gt; you'll need to bit of digging as I can't recall the methods off the top of<br>&gt; my head.<br>&gt;<br>&gt; Robert.<br>&gt;<br>&gt; On 9/26/06, <a href="mailto:osg-users.20.artus@...">osg-users.20.artus@...
</a> &lt;<br>&gt; <a href="mailto:osg-users.20.artus@...">osg-users.20.artus@...</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Hello,<br>&gt;&gt;<br>&gt;&gt; Thanks for your answer. I think, using the bounding volume of the whole
<br>&gt;&gt; scene won't help much. We want to use the scene graph to render objects<br>&gt;&gt; into terrain, which is drawn by our own renderer. So most of the time<br>&gt;&gt; the user will probably be within the scene graphs bounding volume.
<br>&gt;&gt;<br>&gt;&gt; We considered using a fixed near plane, but would prefer to use a<br>&gt;&gt; dynamically calculated one, since the terrain mesh is quite big and we<br>&gt;&gt; would like to use the available z-resolution as optimal as possible.
<br>&gt;&gt;<br>&gt;&gt; But if there is no other way, we will possibly use a fixed near plane.<br>&gt;&gt; The two other options, I see at the moment is either writing my own<br>&gt;&gt; visitor to find the near plane or using an really ugly hack to change
<br>&gt;&gt; the projection matrix after the culling step.<br>&gt;&gt;<br>&gt;&gt; State seems to be ok at the moment, though I got the problem, that OSG<br>&gt;&gt; stops with an GL_ERROR, when an VertexBuffer is bound before its draw is
<br>&gt;&gt; called. Possibly a bug?<br>&gt;&gt;<br>&gt;&gt; Best Regards,<br>&gt;&gt; Roland<br>&gt;&gt;<br>&gt;&gt; Paul Martz schrieb:<br>&gt;&gt; &gt; Do you need to have OSG recompute the near/far planes? If not, I would
<br>&gt;&gt; &gt; disable it if I were you, and instead use the top-level bounding volume<br>&gt;&gt; in<br>&gt;&gt; &gt; your computation of the global projection matrix.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I used to maintain an application that had OSG as well as other
<br>&gt;&gt; renderers. I<br>&gt;&gt; &gt; did as described above: I created a projection matrix used by all<br>&gt;&gt; renderers<br>&gt;&gt; &gt; based on the bounding volumes of all geometry in all renderers, and I<br>
&gt;&gt; told<br>&gt;&gt; &gt; the osgUtil::SceneView to not compute the near/far planes.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; (The bigger problem I ran into was managing state between all the<br>&gt;&gt; renderers,<br>&gt;&gt; &gt; but that's another thread.)
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Best of luck with this,<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;-Paul<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&gt; -----Original Message-----<br>&gt;&gt; &gt;&gt; From: <a href="mailto:osg-users-bounces@...">
osg-users-bounces@...</a><br>&gt;&gt; &gt;&gt; [mailto:<a href="mailto:osg-users-bounces@...">osg-users-bounces@...</a>] On Behalf Of<br>&gt;&gt; &gt;&gt; <a href="mailto:osg-users.20.artus@...">
osg-users.20.artus@...</a><br>&gt;&gt; &gt;&gt; Sent: Tuesday, September 26, 2006 1:15 AM<br>&gt;&gt; &gt;&gt; To: <a href="mailto:osg-users@...">osg-users@...</a><br>&gt;&gt; &gt;&gt; Subject: [osg-users] Near/Far Clipping Plane when integrating
<br>&gt;&gt; &gt;&gt; OSG withexternal renderers<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; Hello,<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; we would like to combine OSG with other renderers, which are<br>&gt;&gt; &gt;&gt; called independent from OpenScene Graph. The Problem is, that
<br>&gt;&gt; &gt;&gt; for this to work, all renderers have to use the same near and<br>&gt;&gt; &gt;&gt; far clipping planes.<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; To do this, we collect the near and far clipping planes,
<br>&gt;&gt; &gt;&gt; required by the different renderers, before we start<br>&gt;&gt; &gt;&gt; rendering and combine them to an projection mMatrix, which is<br>&gt;&gt; &gt;&gt; then used by all renderers.<br>&gt;&gt; &gt;&gt;
<br>&gt;&gt; &gt;&gt; At the moment I'm using osgUtil::SceneView to render the Scene Graph.<br>&gt;&gt; &gt;&gt; The problem is, that the clipping planes are calculated in<br>&gt;&gt; &gt;&gt; SceneView::cull. But after calling cull it seems to be
<br>&gt;&gt; &gt;&gt; impossible to change the projection matrix again, as it is<br>&gt;&gt; &gt;&gt; already stored in the renderLeaf objects and a change has no<br>&gt;&gt; &gt;&gt; effect, before cull is called a second time.
<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; Is it possible to get the clipping planes independent from<br>&gt;&gt; &gt;&gt; the culling?<br>&gt;&gt; &gt;&gt; Or is it somehow possible, to change the projection matrix<br>&gt;&gt; &gt;&gt; after culling? Or would you generally recommend a completely
<br>&gt;&gt; &gt;&gt; different approach to combine OSG with other renderers?<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; We already considered integrating the other renderers in<br>&gt;&gt; &gt;&gt; Scene Graph nodes, but would prefer, to keep them apart to
<br>&gt;&gt; &gt;&gt; reduce the dependence on each other.<br>&gt;&gt; &gt;&gt;<br>&gt;&gt; &gt;&gt; Best Regards,<br>&gt;&gt; &gt;&gt; Roland<br>&gt;&gt; &gt;&gt; _______________________________________________<br>&gt;&gt; &gt;&gt; osg-users mailing list
<br>&gt;&gt; &gt;&gt; <a href="mailto:osg-users@...">osg-users@...</a><br>&gt;&gt; &gt;&gt; <a href="http://openscenegraph.net/mailman/listinfo/osg-users">http://openscenegraph.net/mailman/listinfo/osg-users
</a><br>&gt;&gt; &gt;&gt; <a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>&gt;&gt; &gt;<br>&gt;&gt; &gt; _______________________________________________<br>&gt;&gt; &gt; osg-users mailing list
<br>&gt;&gt; &gt; <a href="mailto:osg-users@...">osg-users@...</a><br>&gt;&gt; &gt; <a href="http://openscenegraph.net/mailman/listinfo/osg-users">http://openscenegraph.net/mailman/listinfo/osg-users
</a><br>&gt;&gt; &gt; <a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>&gt;&gt; &gt;<br>&gt;&gt; &gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; osg-users mailing list
<br>&gt;&gt; <a href="mailto:osg-users@...">osg-users@...</a><br>&gt;&gt; <a href="http://openscenegraph.net/mailman/listinfo/osg-users">http://openscenegraph.net/mailman/listinfo/osg-users</a>
<br>&gt;&gt; <a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________
<br>&gt; osg-users mailing list<br>&gt; <a href="mailto:osg-users@...">osg-users@...</a><br>&gt; <a href="http://openscenegraph.net/mailman/listinfo/osg-users">http://openscenegraph.net/mailman/listinfo/osg-users
</a><br>&gt; <a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>_______________________________________________<br>osg-users mailing list<br><a href="mailto:osg-users@...">osg-users@...
</a><br><a href="http://openscenegraph.net/mailman/listinfo/osg-users">http://openscenegraph.net/mailman/listinfo/osg-users</a><br><a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>
</blockquote>
</div>
<br>
</div>
Robert Osfield | 1 Oct 2006 10:54
Picon

Re: Cross-platform development

On 10/1/06, Watson Ladd <watsonbladd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hello,
I am working on a cross-platform app that uses OSG. The primary
development environment is a Mac.  The goal is to minimize per-OS build
system changes. How should I do this?

In the open source world there is an expression:

  "Release Early, Release Often"

When you start working on cross platform apps this maps to:

  "Port Early, Port Often"

This way you'll spot any cross platform dependencies very early.  Also as a general rule keep things Standard C++/OpenGL and you'll be fine, stay well away from those enticing yet proprietary API's that MS and Apple loves to seduce you with - which lock you in, so stick to API's like QT, WxWindows, FLTK, Fox or Producer when it comes to windowing.

Robert.
<div>
<p>On 10/1/06, Watson Ladd &lt;<a href="mailto:watsonbladd@...">watsonbladd@...</a>&gt; wrote:</p>
<div>
<span class="gmail_quote"></span><blockquote class="gmail_quote">
Hello,<br>I am working on a cross-platform app that uses OSG. The primary<br>development environment is a Mac.&nbsp;&nbsp;The goal is to minimize per-OS build<br>system changes. How should I do this?<br>
</blockquote>
</div>
<br>In the open source world there is an expression:
<br><br>&nbsp; "Release Early, Release Often"<br><br>When you start working on cross platform apps this maps to:<br><br>&nbsp; "Port Early, Port Often"<br><br>This way you'll spot any cross platform dependencies very early.&nbsp; Also as a general rule keep things Standard C++/OpenGL and you'll be fine, stay well away from those enticing yet proprietary API's that MS and Apple loves to seduce you with - which lock you in, so stick to API's like QT, WxWindows, FLTK, Fox or Producer when it comes to windowing.
<br><br>Robert.<br>
</div>
E. Wing | 1 Oct 2006 14:43
Picon

Re: Re: Your Precompiled OSG distro (Now with Movies!)

>
> Wow, ok, we're almost there.  Where does this ArrangeDMG.sh put what files?

The script copies everything into a temporary directory I call
PackageDir. The layout is exactly what you see in the official Disk
Image package. This is because the DMG is created from this.

Remember, the script is in repository as I mentioned so you can see
every step for yourself. I think I actually commented everything. But
from memory, the script puts all the frameworks in
PackageDir/Frameworks and the plugins in PackageDir/PlugIns. After all
the extra stuff is added to the PackageDir, then I create the disk
image. The disk image is what I upload to the ftp server. You can then
blow away the PackageDir as it is only a staging area to build the
binary package. This isn't the only way to do it. Mark Lucas mentioned
a tool called Drop DMG. All we're doing is pulling out the binaries
Xcode built and organizing them and packaging them for distribution.
This entire step is only for people who need to make a distribution.
If you are a regular developer that just needs to build OSG programs,
you don't do any of this.

> For example, where does osg.dylib go, where does osg/Node go?  In other
> words, where do the Libraries, go, where to the Headers go?  This is the
> info I need on the web page.
>
> -don

So again, there is no osg.dylib. Headers are not separate. Both the
headers and the runtime libraries are part of a single entity called a
framework.

-Eric
Don Burns | 2 Oct 2006 06:28

Re: Re: Your Precompiled OSG distro (Now with Movies!)


On 10/1/06, E. Wing <ewmailing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
 All we're doing is pulling out the binaries
Xcode built and organizing them and packaging them for distribution.
This entire step is only for people who need to make a distribution.
If you are a regular developer that just needs to build OSG programs,
you don't do any of this.

Right.... I qualify as a people who needs to make a distribution... that's sort of the jist of this email thread.  I guess I'll get the details by looking at the script.

> For example, where does osg.dylib go, where does osg/Node go?  In other
> words, where do the Libraries, go, where to the Headers go?  This is the
> info I need on the web page.
>
> -don

So again, there is no osg.dylib. Headers are not separate. Both the
headers and the runtime libraries are part of a single entity called a
framework.

Hm... lets not kid ourselves.  There are different layers of abstraction here and when I navigate "Frameworks" I see directory structures that include subdirectories named Resources and Headers.  In some "Frameworks" I find files of type "Mach-O dynamically linked shared library (i386 or ppc)".  However, for now, I'm going to assume that the XCode build system creates these and they aren't populated by your script.  The script simply moves the entire .framework subdirectory from its build location to is place in the PackageDir.

Now, for Windows and all Unix's, I'm quite familiar with the development environment's target locations bin/$(OS) lib/$(OS) include/ , etc.  From these we rearrange them into the distribution package locations (which is the contents of the table I'm trying to build on the web page). 

So, what does the development environment directory structure (containing the target builds) look like just before your script is run which copies files to the distribution locations?

-don

-Eric
_______________________________________________
osg-users mailing list
osg-users-O4jvQuzB+Dma2WnL5OXVi6xOck334EZe@public.gmane.org
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

<div>
<br><div>
<span class="gmail_quote">On 10/1/06, E. Wing &lt;<a href="mailto:ewmailing@...">ewmailing@...</a>&gt; wrote:</span> <br><blockquote class="gmail_quote">
&nbsp;All we're doing is pulling out the binaries<br>Xcode built and organizing them and packaging them for distribution.<br>This entire step is only for people who need to make a distribution.<br>If you are a regular developer that just needs to build OSG programs,
<br>you don't do any of this.</blockquote>
<div>
<br>Right.... I qualify as a people who needs to make a distribution... that's sort of the jist of this email thread.&nbsp; I guess I'll get the details by looking at the script.<br>
</div>
<br><blockquote class="gmail_quote">&gt; For example, where does osg.dylib go, where does osg/Node go?&nbsp;&nbsp;In other<br>&gt; words, where do the Libraries, go, where to the Headers go?&nbsp;&nbsp;This is the
<br>&gt; info I need on the web page.<br>&gt;<br>&gt; -don<br><br>So again, there is no osg.dylib. Headers are not separate. Both the<br>headers and the runtime libraries are part of a single entity called a<br>framework.
</blockquote>
<div>
<br>Hm... lets not kid ourselves.&nbsp; There are different layers of abstraction here and when I navigate "Frameworks" I see directory structures that include subdirectories named Resources and Headers.&nbsp; In some "Frameworks" I find files of type "Mach-O dynamically linked shared library (i386 or ppc)".&nbsp; However, for now, I'm going to assume that the XCode build system creates these and they aren't populated by your script.&nbsp; The script simply moves the entire .framework subdirectory from its build location to is place in the PackageDir.
<br><br>Now, for Windows and all Unix's, I'm quite familiar with the development environment's target locations bin/$(OS) lib/$(OS) include/ , etc.&nbsp; From these we rearrange them into the distribution package locations (which is the contents of the table I'm trying to build on the web page).&nbsp; 
<br><br>So, what does the development environment directory structure (containing the target builds) look like just before your script is run which copies files to the distribution locations?<br><br>-don<br>
</div>
<br><blockquote class="gmail_quote">
-Eric<br>_______________________________________________<br>osg-users mailing list<br><a href="mailto:osg-users@...">osg-users@...</a><br><a href="http://openscenegraph.net/mailman/listinfo/osg-users">
http://openscenegraph.net/mailman/listinfo/osg-users</a><br><a href="http://www.openscenegraph.org/">http://www.openscenegraph.org/</a><br>
</blockquote>
</div>
<br>
</div>
Chuck Seberino | 2 Oct 2006 06:39

Retrieving texture contents from ARB float FBO RTT

I have some code that sets up a CameraNode with a FBO as the target.  The texture attached to the FBO has a format of GL_RGB32F_ARB.  This seems to work just great. 

 

The problem is that I want to be able to read in the value of the texture as an osg::Image after drawing.  I have used image->readImageFromCurrentTexture(), but osg::Image doesn’t know about the ARB formats when performing the bit size calculations.  Is this a deficiency in computNumComponents() or is there something I am missing?  Even hacking that method to calculate it correctly doesn’t solve things.  I didn’t get a chance to dig deeper to see what the next roadblock was.

 

Is there a better way to grab the texture back into main memory?  In OpenGL-land I would call glReadPixels while the FBO was active, but there doesn’t seem to be an easy way to do that in OSG either.

 

Any pointers would be appreciated.

 

Chuck Seberino

 

<div>

<div class="Section1">

<p class="MsoNormal"><span>I have some code that sets up a CameraNode with a FBO as the
target.&nbsp; The texture attached to the FBO has a format of
GL_RGB32F_ARB.&nbsp; This seems to work just great.&nbsp; </span></p>

<p class="MsoNormal"><span>&nbsp;</span></p>

<p class="MsoNormal"><span>The problem is that I want to be able to read in the value
of the texture as an osg::Image after drawing.&nbsp; I have used image-&gt;readImageFromCurrentTexture(),
but osg::Image doesn&rsquo;t know about the ARB formats when performing the bit
size calculations.&nbsp; Is this a deficiency in computNumComponents() or is
there something I am missing?&nbsp; Even hacking that method to calculate it
correctly doesn&rsquo;t solve things.&nbsp; I didn&rsquo;t get a chance to dig
deeper to see what the next roadblock was.</span></p>

<p class="MsoNormal"><span>&nbsp;</span></p>

<p class="MsoNormal"><span>Is there a better way to grab the texture back into main
memory?&nbsp; In OpenGL-land I would call glReadPixels while the FBO was
active, but there doesn&rsquo;t seem to be an easy way to do that in OSG either.</span></p>

<p class="MsoNormal"><span>&nbsp;</span></p>

<p class="MsoNormal"><span>Any pointers would be appreciated.</span></p>

<p class="MsoNormal"><span>&nbsp;</span></p>

<p class="MsoNormal"><span>Chuck Seberino</span></p>

<p class="MsoNormal"><span>&nbsp;</span></p>

</div>

</div>
Robert Osfield | 2 Oct 2006 10:24
Picon

Re: Retrieving texture contents from ARB float FBO RTT

Hi Chuck,

On 10/2/06, Chuck Seberino <seberino-hOtqtM8XhHhAfugRpC6u6w@public.gmane.org> wrote:

I have some code that sets up a CameraNode with a FBO as the target.  The texture attached to the FBO has a format of GL_RGB32F_ARB.  This seems to work just great. 

The problem is that I want to be able to read in the value of the texture as an osg::Image after drawing.  I have used image->readImageFromCurrentTexture(), but osg::Image doesn't know about the ARB formats when performing the bit size calculations.  Is this a deficiency in computNumComponents() or is there something I am missing?  Even hacking that method to calculate it correctly doesn't solve things.  I didn't get a chance to dig deeper to see what the next roadblock was.


Missing support for the ARB pixel formats is obviously one missing element that will need addressing, as for what other gotcha's could be causing problems its hard to point point without digging into to debugging myself.

Is there a better way to grab the texture back into main memory?  In OpenGL-land I would call glReadPixels while the FBO was active, but there doesn't seem to be an easy way to do that in OSG either.


The osgprerender example provides a path that attaches an osg::Image to the CameraNode, and this gets read back in automatically so you can probably use this.  There is also support for post draw callback on CameraNode that you could use to implement your own glReadPixels call.

Could you modify osgprerender to use the pixel format you are having problem with and if this recreates the problem then send the modified file along to me and I'll have a go at debugging it.

Robert.
<div>
<p>Hi Chuck,<br><br></p>
<div>
<span class="gmail_quote">On 10/2/06, Chuck Seberino &lt;<a href="mailto:seberino@...">seberino@...</a>&gt; wrote:</span><blockquote class="gmail_quote">

<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span>I have some code that sets up a CameraNode with a FBO as the
target.&nbsp; The texture attached to the FBO has a format of
GL_RGB32F_ARB.&nbsp; This seems to work just great.&nbsp; </span></p>

<p><span>The problem is that I want to be able to read in the value
of the texture as an osg::Image after drawing.&nbsp; I have used image-&gt;readImageFromCurrentTexture(),
but osg::Image doesn't know about the ARB formats when performing the bit
size calculations.&nbsp; Is this a deficiency in computNumComponents() or is
there something I am missing?&nbsp; Even hacking that method to calculate it
correctly doesn't solve things.&nbsp; I didn't get a chance to dig
deeper to see what the next roadblock was.</span></p>
</div>
</div>
</blockquote>
<div>
<br>Missing support for the ARB pixel formats is obviously one missing element that will need addressing, as for what other gotcha's could be causing problems its hard to point point without digging into to debugging myself.
<br>
</div>
<br><blockquote class="gmail_quote"><div link="blue" vlink="purple" lang="EN-US"><div><p>
<span>Is there a better way to grab the texture back into main
memory?&nbsp; In OpenGL-land I would call glReadPixels while the FBO was
active, but there doesn't seem to be an easy way to do that in OSG either.</span></p></div></div></blockquote>
<div>
<br>The osgprerender example provides a path that attaches an osg::Image to the CameraNode, and this gets read back in automatically so you can probably use this.&nbsp; There is also support for post draw callback on CameraNode that you could use to implement your own glReadPixels call.
<br><br>Could you modify osgprerender to use the pixel format you are having problem with and if this recreates the problem then send the modified file along to me and I'll have a go at debugging it.<br><br>
</div>
</div>Robert.
<br>
</div>
Robert Osfield | 2 Oct 2006 12:55
Picon

osgGA::SimpleViewer

Hi All,

As many will know I've been pontificating on the future of viewer classes in the OSG for well over a year now, but other than a few additions like osgGA::EventQueue and EventVisitor have done little concrete in this direction.  My recent work on osgText::FadeText brought forward the need for me to think about it some more as I needed a generic means of logically grouping different cameras into associated views - so that fades of overlapping/abutting windows could be synchronized.  This introduced the osg::View class, which certainly helped progress things for osgText::Text and potentially for other tasks that require an overall view point to control things like per view settings or LOD ranges (for instance shadow technique).  There is also another aspect to it - would such as class be useful for a general purpose viewer?  i.e. a viewer has one or more views etc...

This general purpose viewer would be a viewer with one or more views, with each view having one or more associated cameras, and the viewer having one or more windows, with each window having one or cameras, and then viewer could have an optional event queue, and each window would have it own event queue, and there would be a optional mechanism for passing events from event queue to event queue filtering then when required, then there would be an optional graphics thread for each window, and potentially a set of threads to do cull traversals per camera too...  OK... very flexible, scalable and  powerful, perhaps to a bit closer to ideal vis-sim or VR power users scene graph viewer but not a simplification of what we have already.

Anyway on the Sunday evening the weekend before last (8 days ago) it occurred to me a general purpose viewer class would be overkill for what many OSG users want - to just open up a single 3D window in an application, for it to be event driven and single threaded, and just a couple of lines of code to create and use.  For this modest but common need perhaps having several viewer classes, and simple off the shelf one, moving up to highly configurable ones would be appropriate.  So that Sunday evening I sat down to design a  SimpleViewer class to flesh out this possibility, and on the following Monday morning and half afternoon I wrote osgGA::SimpleViewer.  I also had time to port osgsimple and osgkeyboardmouse examples over from using osgUtil::SceneView to using the new osgGA::SimpleViewer.   I then checked in the work in progress and then heading off on my five day road trip.  Alas I didn't quite check in all the neccessary updates to keep the changes in osgGA:::GUIEventAdapter & osgProducer::KeyboardMouse in sync, which unfortunately lead to users see problems with osgviewer's camera manipulators not updating correctly, so sorry about that.

On my trip away I took my laptop with me so was able to do a little coding, adding support for DatabasePager into osgGA::SimpleViewer, this allowed osgsimple and osgkeyboardmouse to automatically be able to handle paged database with no changes.  Over the this weekend I had a bash at making a series of osgsimpleviewer examples that implement this simple viewer in a range of 3rd Party windowing toolkits.  If you do a cvs update -Pd you'll find:

  osgsimpleviewerFLTK
  osgsimpleviewerGLUT
  osgsimpleviewerProducer
  osgsimpleviewerQT3
  osgsimpleviewerQT4
  osgsimpleviewerSDL

There aren't any VS projects for them yet, nor Xcode project etc.  To enable there build under unices you'll have to modify your own Make/dependencies file  - make a copy or it somewhere, and then tell the build system where to find it via export OSG_DEPDENDENCIES=/home/me/my_dependencies.  In the my_dependencies you just set things like FLTK_INSTALLED=yes.

All the examples are between 100-140 lines long, a chunk of thus code relates to adaption of events, one you've done it once you'll never need to do it again.  Actually creation and use of the viewer is pretty straight forward as you'll see from the examples.  SimpleViewer is written specifically to make it easier to integrate with windowing toolkits, and provides users with a high level support then you get previously when you wanted to roll you own viewer with osgUtil::SceneView - the SimpleViewer adds event handling, and database paging while keeping the public interface simple - much simpler than SceneView in fact. 

SimpleViewer also automatically updates the osg::State::ContextID so should, in theory, cope with opening/closing multiple windows automatically, there is also a cleaup() method to help in this direction.   It is, however, not yet tested at all in this usage style.  Also if you want to share a single scene graph between multiple windows then we'll also need to do some work to share DatabasePager's and synchronize the FrameStamps between them as well as update traversals.  All this does start to get complicated, and probably pushing such a simple viewer class beyond what we should expect it to handle.  I think its probably important to keep its role quite humble, and push these more complex usage models on to other sets of viewer classes, either existing ones like Producer or new ones that we'll develop in the future.

I have tackled a number of 3rd party windowing toolkits, and have briefly looked at Fox, and WxWindows but these were just a bit too new and big for me to bite of in a days coding, and as I don't have a Mac or a Windows build machine I can't tackle Win32/MFC/ActiveX or AGL/CGL etc.  So.. I was hoping that members of the community could review the existing osgsimpleviewer* examples and add ones for their own favoured API ;-)

Right now I consider osgGA::SimpleViewer a quick experiment in writing a simple viewer class to aid 3rd party windowing library integration.  You may well have views of whether it should exist at all, or what it should look like, for instance Don takes a different approach with his recent OsgViewer Producer example, please feel free to express what you think are the strong points/weak points etc, this can help inform how it should develop if at all. osgGA::SimpleViewer also relies upon other osgGA and osgUtil components that really need a rewrite too, you are wlecome to comment on which ones work for you, how they might be improved, or how you'd rather present the functionality.  Perhaps we should leave some of this for different threads and weeks as there is clearly a lot to talk about w.r.t viewers.

Longer term I'd like see good support for a wide range of windowing toolkits out of the bag, but the thought of having dozens of osgFLT, osgQT, osgMFC, osgWin32, osgMFC etc troubles me, especially considering the code base in each lib might well just be a hundred or so lines of code.  We could maintain these on the wiki as separate projects, but perhaps another route might be to try and put all the implementations of the glue code into headers and place them all in a single library's headers.  Putting implementation into headers would allow users to explicitly include an class into their app without the actual library needing to compile it.

Thoughts?
Robert.

<div><p>Hi All,<br><br>As many will know I've been pontificating on the future of viewer classes in the OSG for well over a year now, but other than a few additions like osgGA::EventQueue and EventVisitor have done little concrete in this direction.&nbsp; My recent work on osgText::FadeText brought forward the need for me to think about it some more as I needed a generic means of logically grouping different cameras into associated views - so that fades of overlapping/abutting windows could be synchronized.&nbsp; This introduced the osg::View class, which certainly helped progress things for osgText::Text and potentially for other tasks that require an overall view point to control things like per view settings or LOD ranges (for instance shadow technique).&nbsp; There is also another aspect to it - would such as class be useful for a general purpose viewer?&nbsp; 
i.e. a viewer has one or more views etc...<br><br>This general purpose viewer would be a viewer with one or more views, with each view having one or more associated cameras, and the viewer having one or more windows, with each window having one or cameras, and then viewer could have an optional event queue, and each window would have it own event queue, and there would be a optional mechanism for passing events from event queue to event queue filtering then when required, then there would be an optional graphics thread for each window, and potentially a set of threads to do cull traversals per camera too...&nbsp; OK... very flexible, scalable and&nbsp; powerful, perhaps to a bit closer to ideal vis-sim or VR power users scene graph viewer but not a simplification of what we have already.
<br><br>Anyway on the Sunday evening the weekend before last (8 days ago)  it occurred to me
a general purpose viewer class would be overkill for what many OSG
users want - to just open up a single 3D window in an application, for it to be event driven and single threaded, and just a couple of lines of code to create and use.&nbsp; For this modest but common need perhaps having several viewer classes, and simple off the shelf one, moving up to highly configurable ones would be appropriate.&nbsp; So that Sunday evening I sat down to design a&nbsp; SimpleViewer class to flesh out this possibility, and on the following Monday morning and half afternoon I wrote osgGA::SimpleViewer.&nbsp; I also had time to port osgsimple and osgkeyboardmouse examples over from using osgUtil::SceneView to using the new osgGA::SimpleViewer.&nbsp;&nbsp; I then checked in the work in progress and then heading off on my five day road trip.&nbsp; Alas I didn't quite check in all the neccessary updates to keep the changes in osgGA:::GUIEventAdapter &amp; osgProducer::KeyboardMouse in sync, which unfortunately lead to users see problems with osgviewer's camera manipulators not updating correctly, so sorry about that.
<br><br>On my trip away I took my laptop with me so was able to do a little coding, adding support for DatabasePager into osgGA::SimpleViewer, this allowed osgsimple and osgkeyboardmouse to automatically be able to handle paged database with no changes.&nbsp; Over the this weekend I had a bash at making a series of osgsimpleviewer examples that implement this simple viewer in a range of 3rd Party windowing toolkits.&nbsp; If you do a cvs update -Pd you'll find:
<br><br>&nbsp; osgsimpleviewerFLTK<br>&nbsp; osgsimpleviewerGLUT<br>&nbsp; osgsimpleviewerProducer<br>&nbsp; osgsimpleviewerQT3<br>&nbsp; osgsimpleviewerQT4<br>&nbsp; osgsimpleviewerSDL<br><br>There aren't any VS projects for them yet, nor Xcode project etc.&nbsp; To enable there build under unices you'll have to modify your own Make/dependencies file&nbsp; - make a copy or it somewhere, and then tell the build system where to find it via export OSG_DEPDENDENCIES=/home/me/my_dependencies.&nbsp; In the my_dependencies you just set things like FLTK_INSTALLED=yes.
<br><br>All the examples are between 100-140 lines long, a chunk of thus code relates to adaption of events, one you've done it once you'll never need to do it again.&nbsp; Actually creation and use of the viewer is pretty straight forward as you'll see from the examples.&nbsp; SimpleViewer is written specifically to make it easier to integrate with windowing toolkits, and provides users with a high level support then you get previously when you wanted to roll you own viewer with osgUtil::SceneView - the SimpleViewer adds event handling, and database paging while keeping the public interface simple - much simpler than SceneView in fact.&nbsp; 
<br><br>SimpleViewer also automatically updates the osg::State::ContextID so should, in theory, cope with opening/closing multiple windows automatically, there is also a cleaup() method to help in this direction.&nbsp;&nbsp; It is, however, not yet tested at all in this usage style.&nbsp; Also if you want to share a single scene graph between multiple windows then we'll also need to do some work to share DatabasePager's and synchronize the FrameStamps between them as well as update traversals.&nbsp; All this does start to get complicated, and probably pushing such a simple viewer class beyond what we should expect it to handle.&nbsp; I think its probably important to keep its role quite humble, and push these more complex usage models on to other sets of viewer classes, either existing ones like Producer or new ones that we'll develop in the future.
<br><br>I have tackled a number of 3rd party windowing toolkits, and have briefly looked at Fox, and WxWindows but these were just a bit too new and big for me to bite of in a days coding, and as I don't have a Mac or a Windows build machine I can't tackle Win32/MFC/ActiveX or AGL/CGL etc.&nbsp; So.. I was hoping that members of the community could review the existing osgsimpleviewer* examples and add ones for their own favoured API ;-)
<br><br>Right now I consider osgGA::SimpleViewer a quick experiment in writing a simple viewer class to aid 3rd party windowing library integration.&nbsp; You may well have views of whether it should exist at all, or what it should look like, for instance Don takes a different approach with his recent OsgViewer Producer example, please feel free to express what you think are the strong points/weak points etc, this can help inform how it should develop if at all. osgGA::SimpleViewer also relies upon other osgGA and osgUtil components that really need a rewrite too, you are wlecome to comment on which ones work for you, how they might be improved, or how you'd rather present the functionality.&nbsp; Perhaps we should leave some of this for different threads and weeks as there is clearly a lot to talk about 
w.r.t viewers.<br><br>Longer term I'd like see good support for a wide range of windowing toolkits out of the bag, but the thought of having dozens of osgFLT, osgQT, osgMFC, osgWin32, osgMFC etc troubles me, especially considering the code base in each lib might well just be a hundred or so lines of code.&nbsp; We could maintain these on the wiki as separate projects, but perhaps another route might be to try and put all the implementations of the glue code into headers and place them all in a single library's headers.&nbsp; Putting implementation into headers would allow users to explicitly include an class into their app without the actual library needing to compile it.
<br><br>Thoughts?<br>Robert.<br></p></div>
Watson Ladd | 2 Oct 2006 14:39
Picon

Xcode build problems

When I try to build OSG with Xcode using Dwarf dSYM files for debugging
and with the Deployment target I get the following error:
No Debug Map or DWARF data was found to link.
What did I do wrong? It builds correctly with the default Xcode
configuration but is quite large.

-- 
They who would give up an essential liberty for temporary security,
 deserve neither liberty or security
--Benjamin Franklin

When I try to build OSG with Xcode using Dwarf dSYM files for debugging
and with the Deployment target I get the following error:
No Debug Map or DWARF data was found to link.
What did I do wrong? It builds correctly with the default Xcode
configuration but is quite large.

--

-- 
They who would give up an essential liberty for temporary security,
 deserve neither liberty or security
--Benjamin Franklin


Gmane