Re: [osg-users] osgOcean application

2009-08-27 Thread Hou Xl
Hi,kim ,Jean-Sebastien Guay and others: 


I tried it as you said ,and disabled the default shader (which is enabled by 
default in oceanscene).

void OceanScene::setUseDefaultSceneShader( bool enable )
{
_enableDefaultShader = enable;
}

I also loaded the cessnafire.osg in osgOcean example,But it had no effect, it 
didn't completely solve the transparent object rendering.

Kim ,you are the developer of osgOcean .I am sure that you will solve it.
And ,now,I am studying the source code in order to solve it.

Thank you!
Cheers,
Hou

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





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


Re: [osg-users] osgOcean application

2009-08-26 Thread Hou Xl
Hi,kim

I print screen and get some images.From the three images you maybe know what 
happen in spaceship flame trail.In fact ,i want to get the reason why the flame 
trail turns grey or white when i toggle glare and dof(underwater) false at run 
time.

Thank you!

Cheers,
houxl

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





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


Re: [osg-users] osgOcean application

2009-08-26 Thread Hou Xl
Hi,kim
in osgocean example :
...
_oceanScene-enableUnderwaterDOF(false);
_oceanScene-enableGlare(false);
...
i print screen and get some images.

Thank you!

Cheers,
houxl[/img][/quote]

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



attachment: (run-time )disable glare and	dof(underwater).JPGattachment: (application init) disable glare and	dof(underwater).JPGattachment: render correctly no ocean.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgOcean application

2009-08-26 Thread Kim Bale
Hi Houxl,

Try disabling the default shader (which is enabled by default in oceanscene)

void OceanScene::setUseDefaultSceneShader( bool enable )
 {
_enableDefaultShader = enable;
 }

Regards,

Kim.

2009/8/25 Hou Xl osg...@163.com:
 Hi,kim

 I print screen and get some images.From the three images you maybe know what 
 happen in spaceship flame trail.In fact ,i want to get the reason why the 
 flame trail turns grey or white when i toggle glare and dof(underwater) false 
 at run time.

 Thank you!

 Cheers,
 houxl

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





 ___
 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] osgOcean application

2009-08-23 Thread osghxl
Hi ,all:
In the ocean example attached osgOcean,i loaded a 3d model which is named 
spaceship.osg from osg offical data, but i did not find the transparent 
colorful flame trail of spaceship,which exist in fact if spaceship was rendered 
correctly . why?
the code as follows:
//==
...
 osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFiles(arguments);
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program 
arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
osgViewer::Viewer viewer;
viewer.setUpViewInWindow( 150,150,1024,768, 0 );
viewer.addEventHandler( new osgViewer::StatsHandler );
osg::ref_ptrTextHUD hud = new TextHUD;
osg::ref_ptrSceneModel scene = new SceneModel(windDirection, windSpeed, 
depth, scale, isChoppy, choppyFactor, crestFoamHeight);
viewer.addEventHandler(scene-getOceanSceneEventHandler());
viewer.addEventHandler(scene-getOceanSurface()-getEventHandler());
viewer.addEventHandler( new SceneEventHandler(scene.get(), hud.get(), 
viewer ) );
viewer.addEventHandler( new osgViewer::HelpHandler );
osg::Group* root = new osg::Group;
root-addChild( scene-getScene() );
root-addChild( hud-getHudCamera() );
if (loadedModel.valid())
{
loadedModel-setNodeMask( scene-getOceanScene()-getNormalSceneMask() 
| 
scene-getOceanScene()-getReflectedSceneMask() 
| 
scene-getOceanScene()-getRefractedSceneMask() 
);
scene-getOceanScene()-addChild(loadedModel.get());
}
   // load spaceship ,added by me
 osg::ref_ptrosg::PositionAttitudeTransform pat = new 
osg::PositionAttitudeTransform();
 //osg::Vec3(10.0f,0.0f,0.0f)
 pat-setPosition(osg::Vec3(0.0f,0.0f,20.0f));
   osg::ref_ptrosg::Node spaceship= osgDB::readNodeFiles(spaceship.osg);
if (spaceship.valid())
{
spaceship-setNodeMask( scene-getOceanScene()-getNormalSceneMask() | 
scene-getOceanScene()-getReflectedSceneMask() 
| 
scene-getOceanScene()-getRefractedSceneMask() 
);
pat-addChild(spaceship.get());
scene-getOceanScene()-addChild(pat.get());
}
viewer.setSceneData( root );
viewer.realize();
while(!viewer.done())
{
viewer.frame();
}
return 0;___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgOcean application

2009-08-23 Thread Jean-Sébastien Guay

Hi ???

(please sign with a real name so we can address you correctly, this 
makes the list more personal)


In the ocean example attached osgOcean,i loaded a 3d model which is 
named spaceship.osg from osg offical data, but i did not find the 
transparent colorful flame trail of spaceship,which exist in fact if 
spaceship was rendered correctly . why?


The default scene shader in osgOcean is very simple and is missing lots 
of things, most models will not render properly using it. You need to 
replace the shader with your own.


See resources/shaders/default_scene.{vert|frag} for guidance as to which 
uniform variables to use for various effects like fog and such. They are 
prefixed with osgOcean_. You can even use those shaders as a base and 
just modify them. Then call 
oceanScene-setDefaultSceneShader(osg::Program*) loading your modified 
shaders in the osg::Program you pass to the function.


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


Re: [osg-users] osgOcean application

2009-08-23 Thread Kim Bale
Just a little more information on this one. If you wish to use
transparency in conjunction with osgOcean you will have to disable the
full screen effects (depth of field and cross hatch glare) as they
overwrite the alpha channel of objects rendered within the scene. In
order to use these effects at the same time as transparency you'll
have to add another render pass for transparent objects and then
combine it into the scene. If you want to add that functionality i'd
be happy to add it...

Regards,

Kim.

2009/8/23 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com:
 Hi ???

 (please sign with a real name so we can address you correctly, this makes
 the list more personal)

 In the ocean example attached osgOcean,i loaded a 3d model which is named
 spaceship.osg from osg offical data, but i did not find the transparent
 colorful flame trail of spaceship,which exist in fact if spaceship was
 rendered correctly . why?

 The default scene shader in osgOcean is very simple and is missing lots of
 things, most models will not render properly using it. You need to replace
 the shader with your own.

 See resources/shaders/default_scene.{vert|frag} for guidance as to which
 uniform variables to use for various effects like fog and such. They are
 prefixed with osgOcean_. You can even use those shaders as a base and just
 modify them. Then call oceanScene-setDefaultSceneShader(osg::Program*)
 loading your modified shaders in the osg::Program you pass to the function.

 Hope this helps,

 J-S
 --
 __
 Jean-Sebastien Guay    jean-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