Re: [osg-users] Some question about osgShadow... can someone help me?

2011-02-02 Thread Axel Spirtaat
Hi Steven,
thanks for reply. 
I tryed to add shadows on my scene copying the osgShadow demo example. When I 
cleanbuild the project, the make returns an error... I don't understand why. 
Can you help me? 

Here is the code I added to my project:

Code:
int ReceivesShadowTraversalMask = 0x1;
int CastsShadowTraversalMask = 0x2;

osg::ref_ptrosgShadow::ShadowedScene shadowedScene = new 
osgShadow::ShadowedScene;
shadowedScene-setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);
shadowedScene-setCastsShadowTraversalMask(CastsShadowTraversalMask);
osg::ref_ptrosgShadow::StandardShadowMap st = new 
osgShadow::StandardShadowMap;
shadowedScene-setShadowTechnique(st.get());
shadowedScene-addChild(root);

viewer.setSceneData(shadowedScene.get());




I alo removed a light, and added the one to shadoewScene and set a model to 
cast and receive shadows...
The make error is the following:
Linking CXX executable ../bin/Room
CMakeFiles/Room.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x621): undefined reference to 
`osgShadow::ShadowedScene::ShadowedScene(osgShadow::ShadowTechnique*)'
main.cpp:(.text+0x698): undefined reference to 
`osgShadow::StandardShadowMap::StandardShadowMap()'
main.cpp:(.text+0x6d0): undefined reference to 
`osgShadow::ShadowedScene::setShadowTechnique(osgShadow::ShadowTechnique*)'
collect2: ld returned 1 exit status
make[2]: *** [bin/Room] Error 1
make[1]: *** [src/CMakeFiles/Room.dir/all] Error 2
make: *** [all] Error 2



I tryed to change ShadowTEcnhique but I obtain the same issue... :(

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





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


Re: [osg-users] Some question about osgShadow... can someone help me?

2011-02-02 Thread Axel Spirtaat
Hi Wojtek,
thank you for reply and suggestions. 

Wojciech Lewandowski wrote:
 Axel,
 
 Messages suggest that Linker cannot find symbols. Looks to me as missing 
 osgShadow lib in your make file.
 


I was supposing this, and of course I need to change the make file. 
Unfortunatelly, to create the make file I used the cmake, and my CMakeLists.txt 
contains the several lines of 4 CMakeLists.txt (openScenegraph 2.3.3, bullet 
physics 2.76, osgWorks and osgBullet). I checked the OpenSceneGraph's one, but 
seems that I haven't forgotten anything... seems. 
I also inclueded all #include osgShadow/*   lines of osgshadow to my main.cpp 
(the osgshadow app works properly). However, I enclose my CMakeLists.txt file 
if you have some second... or can you suggest me any other solution to solve 
this?



Wojciech Lewandowski wrote:
 Axel,
 For the small scene like yours simplest ShadowMap technique should be 
 sufficient. I am recomending it because, extending this technique to support 
 multiple lights will be easiest thing to do. Its still advanced stuff but 
 probably not that complex as extending other techniques. Basically you would 
 need to multiply resources associated with shadows/light sources. So instead 
 of single resource of each type,  you will need array of  shadow cameras, 
 shadow textures, shadow texgens indexed by light ids.
 
 Your modifications will mostly override ShadowMap::cull method. All 
 technique important work is done there. You will need to take most of the 
 code from this method (except first part traversing scene for main view 
 where shadows are applied) and put it into the loop iterating on all your 
 lightsources rendering neccessary shadows with their cameras and applying 
 proper texgens. And thats generally all whats needed in a shortcut. 
 Hopefully when you do this you will learn enough to hack other techniques...
 


These suggestions are really precious to me. I hope to solve the make problem 
to try my scene with one light and then try to implement your suggestions with 
multiple lights.
Thank you again

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




Attachments: 
http://forum.openscenegraph.org//files/cmakelists_162.txt


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


Re: [osg-users] Some question about osgShadow... can someone help me?

2011-02-02 Thread Axel Spirtaat
HI Wojtek,
thank you very much, your suggestion helped me a lot! Now the shadow works 
properly in my app.
For who may have my same problem (I'm sure nobody is newbie as me), the 
solution was to add the line:
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
to CMakeModules/FindOSG.cmake file

Now I can go further, thank you again Wojtek!!

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





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