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 Hi everyone, I know this question has been asked previously but I have not been able to locate a definitive answer so.. We have a need to implement speedtree into OSG, and am wondering if anyone has had prior success with this? From a cursory glance it does not appear that it will be as straight forward as the SPT documentation would have us believe. If so does anyone have any pointers, tips or perhaps even reference code they may be willing to share that may be of assistance??? I would be grateful for any help! cheers Jon Newell > > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org