OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

osgPPU & osgShadow


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgPPU [osgPPU]
View previous topic :: View next topic  
Author Message
Michael Guerrero
Guest





PostPosted: Tue Oct 07, 2008 7:17 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi Art, thanks for your attention. I've constructed an example for you by
minimally modifying Example viewer. Below is the modified view.cpp. It has an
additional createScene function that sets up a shadowed scene. Also note the
#define ENABLE_SHADOWS. Commenting that out will use the default scene instead
of the shadowed one for comparison.

Michael

PS You'll have to link to osgShadow as well of course



#include <osg/GLExtensions>
#include <osgViewer/Renderer>
#include <osgGA/TrackballManipulator>
#include <osgDB/WriteFile>

#include <osgPPU/Processor.h>

#include "osgteapot.h"

#define ENABLE_SHADOWS

#if defined (ENABLE_SHADOWS)
# include <osgShadow/ShadowedScene>
# include <osgShadow/ShadowMap>
# include <osg/LightSource>
#endif

//--------------------------------------------------------------------------
// Create camera resulting texture
//--------------------------------------------------------------------------
osg::Texture* createRenderTexture(int tex_width, int tex_height, bool depth)
{
// create simple 2D texture
osg::Texture2D* texture2D = new osg::Texture2D;
texture2D->setTextureSize(tex_width, tex_height);
texture2D->setResizeNonPowerOfTwoHint(false);
texture2D->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
texture2D->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
texture2D->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
texture2D->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
texture2D->setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));

// setup float format
if (!depth)
{
texture2D->setInternalFormat(GL_RGBA16F_ARB);
texture2D->setSourceFormat(GL_RGBA);
texture2D->setSourceType(GL_FLOAT);
}else{
texture2D->setInternalFormat(GL_DEPTH_COMPONENT);
}

return texture2D;
}

//--------------------------------------------------------------------------
// Create scene
//--------------------------------------------------------------------------
osg::Group* createScene(const std::string& filename)
{
osg::Node* loadedModel = NULL;

// Load in the model to use in our scene
if (!filename.empty()) loadedModel = osgDB::readNodeFile(filename);
if (!loadedModel) loadedModel = createTeapot();
if (!loadedModel) return NULL;

#if defined (ENABLE_SHADOWS)
const int ReceivesShadowTraversalMask = 0x1;
const int CastsShadowTraversalMask = 0x2;

osgShadow::ShadowedScene* shadowedScene = new osgShadow::ShadowedScene;
shadowedScene->setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);
shadowedScene->setCastsShadowTraversalMask(CastsShadowTraversalMask);

osg::LightSource* lightSource = new osg::LightSource;
lightSource->getLight()->setPosition(
osg::Vec4(osg::Vec3(100.0, 0.0, 100.0f), 0.0f));

// Setup the scene with shadows via shadow mapping
osgShadow::ShadowMap* shadowMap = new osgShadow::ShadowMap;
shadowMap->setTextureSize(osg::Vec2s(1024, 1024));
shadowMap->setLight(lightSource);

shadowedScene->setShadowTechnique(shadowMap);
shadowedScene->addChild(lightSource);

return shadowedScene;
#else
osg::Group* scene = new osg::Group;
scene->addChild(loadedModel);

return scene;
#endif
}

//--------------------------------------------------------------------------
// Setup the camera to do the render to texture
//--------------------------------------------------------------------------
void setupCamera(osg::Camera* camera)
{
osg::Viewport* vp = camera->getViewport();

// create texture to render to
osg::Texture* texture = createRenderTexture((int)vp->width(),
(int)vp->height(), false);
osg::Texture* depthTexture = createRenderTexture((int)vp->width(),
(int)vp->height(), true);

// set up the background color and clear mask.
camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f));
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// set viewport
camera->setViewport(vp);
camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
camera->setProjectionMatrixAsPerspective(35.0, vp->width()/vp->height(),
1.0, 256.0);

// tell the camera to use OpenGL frame buffer object where supported.
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

// attach the texture and use it as the color buffer.
camera->attach(osg::Camera::COLOR_BUFFER, texture);
camera->attach(osg::Camera::DEPTH_BUFFER, depthTexture);
}

//--------------------------------------------------------------------------
int main(int argc, char **argv)
{
// parse arguments
osg::ArgumentParser arguments(&argc,argv);

// give some info in the console
printf("view ppufile [osgfile]\n");

if (argc <= 1) return 0;

// construct the viewer.
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer();

unsigned int screenWidth;
unsigned int screenHeight;

osg::GraphicsContext::getWindowingSystemInterface()->getScreenResolution(
osg::GraphicsContext::ScreenIdentifier(0), screenWidth, screenHeight);
unsigned int windowWidth = 640;
unsigned int windowHeight = 480;
viewer->setUpViewInWindow((screenWidth-windowWidth)/2,
(screenHeight-windowHeight)/2, windowWidth, windowHeight);

// setup scene
osg::Group* node = createScene((argc > 2) ? arguments[2]: "");

// disable color clamping, because we want to work on real hdr values
osg::ClampColor* clamp = new osg::ClampColor();
clamp->setClampVertexColor(GL_FALSE);
clamp->setClampFragmentColor(GL_FALSE);
clamp->setClampReadColor(GL_FALSE);

// make it protected and override, so that it is done for the whole
rendering pipeline
node->getOrCreateStateSet()->setAttribute(clamp, osg::StateAttribute:ShockedN |
osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED);

// load the processor from a file
osg::ref_ptr<osgPPU::Processor> processor =
dynamic_cast<osgPPU::Processor*>(osgDB::readObjectFile(arguments[1]));
if (!processor)
{
osg::notify(osg::FATAL) << "File does not contain a valid pipeline" <<
std::endl;
return 0;
}

// setup viewers camera
setupCamera(viewer->getCamera());
processor->setCamera(viewer->getCamera());

// add processor to the scene
node->addChild(processor.get());

// add model to viewer.
viewer->setSceneData( node );

// run viewer
return viewer->run();
}







------------------
Post generated by Mail2Forum
Back to top
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbrücken, Germany

PostPosted: Tue Oct 07, 2008 8:23 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi Michael,

hmm, your setup for the shadowed scene isn't correct. I have attached a changed setup where I am able to see the teapot shadowed by some shadow technique and also working perfectly with the osgPPU (latest svn release). Look at it. Call with ./viewer Data/motionblur.ppu


Does it solve your problem?

Cheers,
art



--- Michael Guerrero <> schrieb am Di, 7.10.2008:

Quote:
Von: Michael Guerrero <>
Betreff: Re: osgPPU & osgShadow
An:
Datum: Dienstag, 7. Oktober 2008, 21:16
Hi Art, thanks for your attention. I've constructed an
example for you by
minimally modifying Example viewer. Below is the modified
view.cpp. It has an
additional createScene function that sets up a shadowed
scene. Also note the
#define ENABLE_SHADOWS. Commenting that out will use the
default scene instead
of the shadowed one for comparison.

Michael

PS You'll have to link to osgShadow as well of course



#include <osg/GLExtensions>
#include <osgViewer/Renderer>
#include <osgGA/TrackballManipulator>
#include <osgDB/WriteFile>

#include <osgPPU/Processor.h>

#include "osgteapot.h"

#define ENABLE_SHADOWS

#if defined (ENABLE_SHADOWS)
# include <osgShadow/ShadowedScene>
# include <osgShadow/ShadowMap>
# include <osg/LightSource>
#endif

//--------------------------------------------------------------------------
// Create camera resulting texture
//--------------------------------------------------------------------------
osg::Texture* createRenderTexture(int tex_width, int
tex_height, bool depth)
{
// create simple 2D texture
osg::Texture2D* texture2D = new osg::Texture2D;
texture2D->setTextureSize(tex_width, tex_height);
texture2D->setResizeNonPowerOfTwoHint(false);

texture2D->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);

texture2D->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

texture2D->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);

texture2D->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);

texture2D->setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));

// setup float format
if (!depth)
{
texture2D->setInternalFormat(GL_RGBA16F_ARB);
texture2D->setSourceFormat(GL_RGBA);
texture2D->setSourceType(GL_FLOAT);
}else{

texture2D->setInternalFormat(GL_DEPTH_COMPONENT);
}

return texture2D;
}

//--------------------------------------------------------------------------
// Create scene
//--------------------------------------------------------------------------
osg::Group* createScene(const std::string& filename)
{
osg::Node* loadedModel = NULL;

// Load in the model to use in our scene
if (!filename.empty()) loadedModel =
osgDB::readNodeFile(filename);
if (!loadedModel) loadedModel = createTeapot();
if (!loadedModel) return NULL;

#if defined (ENABLE_SHADOWS)
const int ReceivesShadowTraversalMask = 0x1;
const int CastsShadowTraversalMask = 0x2;

osgShadow::ShadowedScene* shadowedScene = new
osgShadow::ShadowedScene;

shadowedScene->setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);

shadowedScene->setCastsShadowTraversalMask(CastsShadowTraversalMask);


osg::LightSource* lightSource = new osg::LightSource;
lightSource->getLight()->setPosition(
osg::Vec4(osg::Vec3(100.0, 0.0, 100.0f), 0.0f));

// Setup the scene with shadows via shadow mapping
osgShadow::ShadowMap* shadowMap = new
osgShadow::ShadowMap;
shadowMap->setTextureSize(osg::Vec2s(1024, 1024));
shadowMap->setLight(lightSource);

shadowedScene->setShadowTechnique(shadowMap);
shadowedScene->addChild(lightSource);

return shadowedScene;
#else
osg::Group* scene = new osg::Group;
scene->addChild(loadedModel);

return scene;
#endif
}

//--------------------------------------------------------------------------
// Setup the camera to do the render to texture
//--------------------------------------------------------------------------
void setupCamera(osg::Camera* camera)
{
osg::Viewport* vp = camera->getViewport();

// create texture to render to
osg::Texture* texture =
createRenderTexture((int)vp->width(),
(int)vp->height(), false);
osg::Texture* depthTexture =
createRenderTexture((int)vp->width(),
(int)vp->height(), true);

// set up the background color and clear mask.

camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f));
camera->setClearMask(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT);

// set viewport
camera->setViewport(vp);

camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
camera->setProjectionMatrixAsPerspective(35.0,
vp->width()/vp->height(),
1.0, 256.0);

// tell the camera to use OpenGL frame buffer object
where supported.

camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

// attach the texture and use it as the color buffer.
camera->attach(osg::Camera::COLOR_BUFFER, texture);
camera->attach(osg::Camera::DEPTH_BUFFER,
depthTexture);
}

//--------------------------------------------------------------------------
int main(int argc, char **argv)
{
// parse arguments
osg::ArgumentParser arguments(&argc,argv);

// give some info in the console
printf("view ppufile [osgfile]\n");

if (argc <= 1) return 0;

// construct the viewer.
osg::ref_ptr<osgViewer::Viewer> viewer = new
osgViewer::Viewer();

unsigned int screenWidth;
unsigned int screenHeight;

osg::GraphicsContext::getWindowingSystemInterface()->getScreenResolution(
osg::GraphicsContext::ScreenIdentifier(0), screenWidth,
screenHeight);
unsigned int windowWidth = 640;
unsigned int windowHeight = 480;

viewer->setUpViewInWindow((screenWidth-windowWidth)/2,
(screenHeight-windowHeight)/2, windowWidth, windowHeight);

// setup scene
osg::Group* node = createScene((argc > 2) ?
arguments[2]: "");

// disable color clamping, because we want to work on
real hdr values
osg::ClampColor* clamp = new osg::ClampColor();
clamp->setClampVertexColor(GL_FALSE);
clamp->setClampFragmentColor(GL_FALSE);
clamp->setClampReadColor(GL_FALSE);

// make it protected and override, so that it is done
for the whole
rendering pipeline
node->getOrCreateStateSet()->setAttribute(clamp,
osg::StateAttribute:ShockedN |
osg::StateAttribute::OVERRIDE |
osg::StateAttribute::PROTECTED);

// load the processor from a file
osg::ref_ptr<osgPPU::Processor> processor =
dynamic_cast<osgPPU::Processor*>(osgDB::readObjectFile(arguments[1]));
if (!processor)
{
osg::notify(osg::FATAL) << "File does
not contain a valid pipeline" <<
std::endl;
return 0;
}

// setup viewers camera
setupCamera(viewer->getCamera());
processor->setCamera(viewer->getCamera());

// add processor to the scene
node->addChild(processor.get());

// add model to viewer.
viewer->setSceneData( node );

// run viewer
return viewer->run();
}











------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message Visit poster's website
Michael Guerrero
Guest





PostPosted: Tue Oct 07, 2008 8:51 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Awesome, thanks for the correction. I see that my initial example forgot to
actually add the model to the shadowed scene Razz But that wasn't the real
problem. The real problem was giving osgPPU the same node that i was using for
shadows. After seeing what you did in your correction I rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected. Now I just want to understand why this
worked. It it because osgPPU and osgShadow are no longer fighting to control
the state of the single scene node?



------------------
Post generated by Mail2Forum
Back to top
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbrücken, Germany

PostPosted: Tue Oct 07, 2008 10:22 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi,

Quote:
Awesome, thanks for the correction. I see that my initial
example forgot to
actually add the model to the shadowed scene Razz But that
wasn't the real
problem. The real problem was giving osgPPU the same node
that i was using for
shadows.
I do not realy understand what you mean here with "giving osgPPU the same node as for shadows". osgPPU doesn't now anything about the graph, it does only get camera as input, hence use the camera color buffer texture as input. Therefor the camera, which is connected to the osgPPU, which can be your main camera or some other one, should be able to render your shadowed scene.


Cheers,
art


Quote:
After seeing what you did in your correction I
rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected. Now I just want to
understand why this
worked. It it because osgPPU and osgShadow are no longer
fighting to control
the state of the single scene node?







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message Visit poster's website
allensaucier
Appreciator


Joined: 10 Apr 2009
Posts: 126

PostPosted: Wed Mar 24, 2010 2:59 pm    Post subject:
Reply with quote

Hi Art,

Your osgPPU does an awesome job of blurring! I just got the example listed above to work by using your view.cpp code. Thanks for posting it!

I have a question: I am trying to blur my entire scene. Is that possible with osgPPU? If so, would you mind showing me how? I can not find any examples of how to use osgPPU at the website - perhaps I'm looking in the wrong place.

I am needing to blur both my scene and to have motion blur on objects within my scene that are moving.

Thank you so much!

Cheers,
Allen
Back to top
View user's profile Send private message
Serge Lages
Guest





PostPosted: Wed May 12, 2010 3:26 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi Art and all,

I am coming back on this subject because I am currently trying to use osgPPU with osgShadow.


I've followed this thread instructions and it works, but only with the ShadowMap technique, and the one I prefer is MinimalShadowMap. With this one, combined with HDR, it  renders all my scene in white... Any idea on what to do ?


Thanks !

On Wed, Oct 8, 2008 at 12:22 AM, Art Tevs < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

Quote:
Awesome, thanks for the correction.  I see that my initial
example forgot to
actually add the model to the shadowed scene Razz  But that
wasn't the real
problem.  The real problem was giving osgPPU the same node
that i was using for
shadows.

I do not realy understand what you mean here with "giving osgPPU the same node as for shadows". osgPPU doesn't now anything about the graph, it does only get camera as input, hence use the camera color buffer texture as input. Therefor the camera, which is connected to the osgPPU, which can be your main camera or some other one, should be able to render your shadowed scene.


Cheers,
art



Quote:
After seeing what you did in your correction I
rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected.  Now I just want to
understand why this
worked.  It it because osgPPU and osgShadow are no longer
fighting to control
the state of the single scene node?

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Serge Lages
http://www.tharsis-software.com

------------------
Post generated by Mail2Forum
Back to top
Martin Naylor
Guest





PostPosted: Wed May 12, 2010 4:09 pm    Post subject:
osgPPU & osgShadow
Reply with quote

I did mention this a while back about osgShadow.
All my are examples do this now after installing a new Nvidia GTX 480
card(from a gtx 9800), with the latest drivers from Nvidia.
My guess you are running Windows Vista/7, try alt tab?
For a permanent fix disable the pesky Aero desktop!
I tried looking for a fix last night and its something to do with
swapbuffers either being called or not, I cannot remember it was late and
the viewer code was baffling me!
Ok it might b
Regards

Martin


-----Original Message-----
From:
[mailto:] On Behalf Of Art Tevs
Sent: 02 October 2008 15:14
To: OpenSceneGraph Users
Subject: Re: osgPPU & osgShadow

Hi Michael,

I have never tried osgShadow at all, hence I can not say what happens if you
use osgPPU with it. Could you prepare some simple example showing the issue?

Maybe try the newest version from the svn, since there are some changes to
the previous one.

Best regards,
art


Quote:
Hi guys, I've recently delved into osgPPU and am loving
it. I have a scene
beautifully rendering with HDR. However, when I tried
adding osgShadow
ShadowMap to the scene I had conflicts. I don't yet
know exactly what is going
just yet but I was wondering if anyone has had success
combining these two and
if so, I would appreciate the help.

Thanks,
Michael




__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com




------------------
Post generated by Mail2Forum
Back to top
Martin Naylor
Guest





PostPosted: Wed May 12, 2010 4:10 pm    Post subject:
osgPPU & osgShadow
Reply with quote

And my email updated and I see you found a solution...
Oh well its probably just me ;)

Martin


-----Original Message-----
From:
[mailto:] On Behalf Of Art Tevs
Sent: 07 October 2008 23:22
To: OpenSceneGraph Users
Subject: Re: osgPPU & osgShadow

Hi,

Quote:
Awesome, thanks for the correction. I see that my initial
example forgot to
actually add the model to the shadowed scene Razz But that
wasn't the real
problem. The real problem was giving osgPPU the same node
that i was using for
shadows.
I do not realy understand what you mean here with "giving osgPPU the same
node as for shadows". osgPPU doesn't now anything about the graph, it does
only get camera as input, hence use the camera color buffer texture as
input. Therefor the camera, which is connected to the osgPPU, which can be
your main camera or some other one, should be able to render your shadowed
scene.


Cheers,
art


Quote:
After seeing what you did in your correction I
rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected. Now I just want to
understand why this
worked. It it because osgPPU and osgShadow are no longer
fighting to control
the state of the single scene node?









------------------
Post generated by Mail2Forum
Back to top
Serge Lages
Guest





PostPosted: Wed May 12, 2010 4:17 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi Martin, thanks for your reply but I am talking about another problem.

The problem with osgShadow + Seven/Vista + fullscreen = black screen is pretty familiar to me, but I always disable aero on final setups so it's not a deal.


My current problem is with osgShadow::MinimalShadowMap and osgPPU, my scene becomes white, but it works with the osgShadow::ShadowMap technique.


Cheers,

On Wed, May 12, 2010 at 6:10 PM, Martin Naylor < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
And my email updated and I see you found a solution...
Oh well its probably just me Wink

Martin


-----Original Message-----
From: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
[mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Art Tevs

Sent: 07 October 2008 23:22
To: OpenSceneGraph Users
Subject: Re: osgPPU & osgShadow



Hi,

Quote:
Awesome, thanks for the correction.  I see that my initial
example forgot to
actually add the model to the shadowed scene Razz  But that
wasn't the real
problem.  The real problem was giving osgPPU the same node
that i was using for
shadows.
I do not realy understand what you mean here with "giving osgPPU the same
node as for shadows". osgPPU doesn't now anything about the graph, it does
only get camera as input, hence use the camera color buffer texture as
input. Therefor the camera, which is connected to the osgPPU, which can be
your main camera or some other one, should be able to render your shadowed
scene.


Cheers,
art


Quote:
After seeing what you did in your correction I
rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected.  Now I just want to
understand why this
worked.  It it because osgPPU and osgShadow are no longer
fighting to control
the state of the single scene node?

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Serge Lages
http://www.tharsis-software.com

------------------
Post generated by Mail2Forum
Back to top
Martin Naylor
Guest





PostPosted: Wed May 12, 2010 4:25 pm    Post subject:
osgPPU & osgShadow
Reply with quote

Hi Serge,
Yeah sorry I somehow posted to a 2 year post.
Good luck with your problem, I will butt out now as its out of my league J

Martin.


From: [mailto:] On Behalf Of Serge Lages
Sent: 12 May 2010 17:17
To: OpenSceneGraph Users
Subject: Re: osgPPU & osgShadow


Hi Martin, thanks for your reply but I am talking about another problem.


The problem with osgShadow + Seven/Vista + fullscreen = black screen is pretty familiar to me, but I always disable aero on final setups so it's not a deal.



My current problem is with osgShadow::MinimalShadowMap and osgPPU, my scene becomes white, but it works with the osgShadow::ShadowMap technique.



Cheers,
On Wed, May 12, 2010 at 6:10 PM, Martin Naylor < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
And my email updated and I see you found a solution...
Oh well its probably just me Wink

Martin


-----Original Message-----
From: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
[mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Art Tevs

Sent: 07 October 2008 23:22
To: OpenSceneGraph Users
Subject: Re: osgPPU & osgShadow

Hi,

Quote:
Awesome, thanks for the correction. I see that my initial
example forgot to
actually add the model to the shadowed scene Razz But that
wasn't the real
problem. The real problem was giving osgPPU the same node
that i was using for
shadows.
I do not realy understand what you mean here with "giving osgPPU the same
node as for shadows". osgPPU doesn't now anything about the graph, it does
only get camera as input, hence use the camera color buffer texture as
input. Therefor the camera, which is connected to the osgPPU, which can be
your main camera or some other one, should be able to render your shadowed
scene.


Cheers,
art


Quote:
After seeing what you did in your correction I
rearranged the graph
like this:

scene->addChild(shadowedScene);
shadowedScene->addChild(loadedModel);

and everything worked as expected. Now I just want to
understand why this
worked. It it because osgPPU and osgShadow are no longer
fighting to control
the state of the single scene node?

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--
Serge Lages
http://www.tharsis-software.com

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgPPU [osgPPU] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts obj plugin does not support diffuse ... Ralf Habacker Submission 0 Tue Nov 14, 2017 4:18 pm View latest post
No new posts osgShadow and gl3 wernerM General 1 Fri Feb 24, 2017 2:54 pm View latest post
No new posts 答复: osg-users Digest, Vol 105, Is... 韩志平 General 1 Thu Feb 09, 2017 3:03 am View latest post
No new posts osgShadow with GLES PJPetitprez General 1 Mon Jul 04, 2016 3:48 pm View latest post
No new posts using osgShadow messes ref_ptrs on exit Trajce Nikolov NICK General 4 Wed Feb 24, 2016 6:48 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP