Hi Richard,

Thanks for your assistance, at this stage we have mostly completed option 1, still a few issues but mostly functional, this is essentially little more than a quick and dirty hack that does limit scope on what we can do with the trees in our particular circumstance. In the long run this approach won't cut it, and we will look at a more complete solution, I can see at a glance however that we are likely to hit the same issues with LOD's as you have.....joy o joy :)

Will let you know how we get along and if we work out a way around it.

Cheers

Jon


Schmidt, Richard wrote:
Hi Jon,
we have tried to integrate speedtree into osg.

There are serveral ways to do it:

1. alternative: Just use the opengl example from speedtree and wrap it
with a custom drawable. Using this solution there are many pros:
* easy to integrate
cons: * your are using the texture loading/management of speedtree
* you loose the ability of multithreading/multicontext stuff of osg,
because the speedtree example uses CG in a non-multicontext version

2. alternative: Create a osg wrapper for CG (as custom stateattributes)
in osg and use the example to build the appropiate osg geometry.
pros:
* no need to touch the speedtree shader
* useable in multicontext/multithreaded environment.
cons:
* Integrating CG into osg is a daunting task. However CG does not make
any guaranties about the opengl state after it has been applied, so you
can't use it with other stateattributes or in a hierarchy of statesets.
So I wouldn't recommend using CG at all in OSG.

3. alternative: Like above you port all the geometry to osg as well as
the CG shaders to GLSL. Porting the shaders to GLSL is easy. I haven't
done anything with shaders before, but if you take a look at Mike
Weiblen GLSL quickrefernce it should be really easy to port the CG
shader.
pros:
* now is pure osg, you don't have any custom drawable or wrappers in it,
EXCEPT: SpeedWind - Speedtree provides a class for creating wind. Just
build a basic wrapper which gets called in the update cycle.
The next thing you have to care about is how you organize your
scenegraph (for LOD stuff). Thats were I am currently stuck with.
Richard

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jon
Newell
Sent: Thursday, August 07, 2008 1:56 AM
To: OpenSceneGraph Users
Subject: [osg-users] osg and speedtree

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

Reply via email to