[osg-users] Artefact and jitter effects using osgShadows
Hi, I have tried to use osgShadow on a terrain database to make it more reallistic but could not get what I want. I started with the osgShadow sample (v3.1.5) and noticed on the island demo (-4) that the shadows where jittering when the light was moving. Then, I replaced the island with an OSG database onto which I added one truck. So, my shadowedScene contains 2 nodes, the osg database node and the truck node. On the final result, I tried several shadow techniques. The ShadowMap is the one I like the most but the result with the moving truck is not satisfactory. I believe that the selfshadowing is the problem because, when the terrain is receving only and the truck is casting, the shadow of the truck is nice, BUT, there is no shadow for all buildings and trees of the database ! Is is possible to remove the selfshadowing effect ? Could it be possible to make the terrain apply the shadow on itself, without the truck node, then cast the truck node on the terrain only ? (so that to prevent the terrain from casting shadows on the truck) Any hint would help me. Thanks in advance. ... Thank you! Cheers, Yann -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58872#58872 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Artefact and jitter effects using osgShadows
Hi Yann, from my experience with different shadow maps techniques the best results I am getting with open terrain and models is with LightSpacePerspectiveShadowMapDB. To answer your question: probably you have found the masks for shadow casting and recieval with setReceivesShadowTraversalMask and setCastsShadowTraversalMask methods of ShadowedScene. Then you set these masks in the node->setNodeMask. For the terrain you set the nodemask to terrain->setNodeMask(CastsShadowTraversalMask | ReceivesShadowTraversalMask) and for the truck you do truck->setNodeMask(ReceivesShadowTraversalMask) I have some code I can share if you wish that works well with huge terrains and models. Ping me on my email if you want Nick On Thu, Apr 10, 2014 at 4:27 PM, Yann Takvorian wrote: > Hi, > > I have tried to use osgShadow on a terrain database to make it more > reallistic but could not get what I want. > > I started with the osgShadow sample (v3.1.5) and noticed on the island > demo (-4) that the shadows where jittering when the light was moving. > > Then, I replaced the island with an OSG database onto which I added one > truck. > > So, my shadowedScene contains 2 nodes, the osg database node and the truck > node. > > On the final result, I tried several shadow techniques. The ShadowMap is > the one I like the most but the result with the moving truck is not > satisfactory. > > I believe that the selfshadowing is the problem because, when the terrain > is receving only and the truck is casting, the shadow of the truck is nice, > BUT, there is no shadow for all buildings and trees of the database ! > > Is is possible to remove the selfshadowing effect ? > > Could it be possible to make the terrain apply the shadow on itself, > without the truck node, then cast the truck node on the terrain only ? (so > that to prevent the terrain from casting shadows on the truck) > > Any hint would help me. > Thanks in advance. > ... > > Thank you! > > Cheers, > Yann > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=58872#58872 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Artefact and jitter effects using osgShadows
wops, your truck has to be set to truck->setNodeMask( CastsShadowTraversalMask ) only .. was a typo Nick On Thu, Apr 10, 2014 at 7:46 PM, Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > Hi Yann, > > from my experience with different shadow maps techniques the best results > I am getting with open terrain and models is > with LightSpacePerspectiveShadowMapDB. > > To answer your question: probably you have found the masks for shadow > casting and recieval with setReceivesShadowTraversalMask > and setCastsShadowTraversalMask methods of ShadowedScene. Then you set > these masks in the node->setNodeMask. For the terrain you set the nodemask > to terrain->setNodeMask(CastsShadowTraversalMask | > ReceivesShadowTraversalMask) and for the truck you do > truck->setNodeMask(ReceivesShadowTraversalMask) > > I have some code I can share if you wish that works well with huge > terrains and models. Ping me on my email if you want > > Nick > > > On Thu, Apr 10, 2014 at 4:27 PM, Yann Takvorian > wrote: > >> Hi, >> >> I have tried to use osgShadow on a terrain database to make it more >> reallistic but could not get what I want. >> >> I started with the osgShadow sample (v3.1.5) and noticed on the island >> demo (-4) that the shadows where jittering when the light was moving. >> >> Then, I replaced the island with an OSG database onto which I added one >> truck. >> >> So, my shadowedScene contains 2 nodes, the osg database node and the >> truck node. >> >> On the final result, I tried several shadow techniques. The ShadowMap is >> the one I like the most but the result with the moving truck is not >> satisfactory. >> >> I believe that the selfshadowing is the problem because, when the terrain >> is receving only and the truck is casting, the shadow of the truck is nice, >> BUT, there is no shadow for all buildings and trees of the database ! >> >> Is is possible to remove the selfshadowing effect ? >> >> Could it be possible to make the terrain apply the shadow on itself, >> without the truck node, then cast the truck node on the terrain only ? (so >> that to prevent the terrain from casting shadows on the truck) >> >> Any hint would help me. >> Thanks in advance. >> ... >> >> Thank you! >> >> Cheers, >> Yann >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=58872#58872 >> >> >> >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > > > > -- > trajce nikolov nick > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Artefact and jitter effects using osgShadows
Hi Nick, Thanks for your reply. Unfortunately, with the LightSpacePerspectiveShadowMapDB, it is even worse. I have set the TraversalMask and the only combinaison that works is: terrain->setNodeMask(ReceivesShadowTraversalMask); truck->setNodeMask(CastsShadowTraversalMask); When I do: terrain->setNodeMask(CastsShadowTraversalMask | ReceivesShadowTraversalMask); I got flickering shadows on terrain buildings and the truck. Also, the truck shadows moves and flickers. It looks like the resolution is wrong because the shadows are like big squares and the jumping seems to come from resolution. ... Thank you! Cheers, Yann -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59344#59344 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Artefact and jitter effects using osgShadows
Hi, it has somethink like setTextureSize(). You can try large texture like 8192x8192 Nick On Sun, May 11, 2014 at 1:22 PM, Yann Takvorian wrote: > Hi Nick, > > Thanks for your reply. > Unfortunately, with the LightSpacePerspectiveShadowMapDB, it is even > worse. I have set the TraversalMask and the only combinaison that works is: > terrain->setNodeMask(ReceivesShadowTraversalMask); > truck->setNodeMask(CastsShadowTraversalMask); > > When I do: > terrain->setNodeMask(CastsShadowTraversalMask | > ReceivesShadowTraversalMask); > > I got flickering shadows on terrain buildings and the truck. > Also, the truck shadows moves and flickers. It looks like the resolution > is wrong because the shadows are like big squares and the jumping seems to > come from resolution. > > > > ... > > Thank you! > > Cheers, > Yann > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=59344#59344 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org