[osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-02 Thread Cyril Bondue
Hello fellow coders :)

I'm asking for you help one more time. I have a problem with shadows, it seems 
like I have a "view dependent shadow clipping plane".
I have an osgShadow::ShadowedScene with a city and a light following the player 
in it. The problem is that, when we move the camera, the shadows get clipped, 
as you can see in the attached screens, when the camera is high every buildings 
have a shadow, but when the camera gets to a "human" position then the clipping 
occurs :/ neither the models nor the light moved.
I have tried many different shadow technics but it happened for all of them, 
right now i use a osgShadow::MinimalShadowMap, i tried to change the 
minLightMargin with no success. I tried to change some parameters on the light 
or on the camera with no success either :( that's why i come here to ask for 
help!
I added the red line on the screens, to show the "clipping plane" position.
This happens with OSG 2.8.3 and OSG 3.0.1

Thank you!

Cheers,
Cyril

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




Attachments: 
http://forum.openscenegraph.org//files/shadow_clippingplane_109.jpg


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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-02 Thread Robert Osfield
Hi Cyril,

I'm afraid I don't have an immeditate solutions for you but if you can
wait a few weeks I should hopefully have an improved view depedent
shadow technique implemented.

Robert.

On Tue, Aug 2, 2011 at 1:45 PM, Cyril Bondue  wrote:
> Hello fellow coders :)
>
> I'm asking for you help one more time. I have a problem with shadows, it 
> seems like I have a "view dependent shadow clipping plane".
> I have an osgShadow::ShadowedScene with a city and a light following the 
> player in it. The problem is that, when we move the camera, the shadows get 
> clipped, as you can see in the attached screens, when the camera is high 
> every buildings have a shadow, but when the camera gets to a "human" position 
> then the clipping occurs :/ neither the models nor the light moved.
> I have tried many different shadow technics but it happened for all of them, 
> right now i use a osgShadow::MinimalShadowMap, i tried to change the 
> minLightMargin with no success. I tried to change some parameters on the 
> light or on the camera with no success either :( that's why i come here to 
> ask for help!
> I added the red line on the screens, to show the "clipping plane" position.
> This happens with OSG 2.8.3 and OSG 3.0.1
>
> Thank you!
>
> Cheers,
> Cyril
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=41789#41789
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/shadow_clippingplane_109.jpg
>
>
> ___
> 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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-02 Thread Sebastian Messerschmidt

Hi Cyril,

have you tried setting the MinLightMargin of the shadowmap to a high value?
I didn't look to closely, but i recall having such problems when using 
the standard settings.
Also the LightSpacePerspective shadow mapping works very well for me, so 
maybe try this one for the bigger outdoor scenes.


cheers
Sebastian

Hello fellow coders :)

I'm asking for you help one more time. I have a problem with shadows, it seems like I 
have a "view dependent shadow clipping plane".
I have an osgShadow::ShadowedScene with a city and a light following the player in it. 
The problem is that, when we move the camera, the shadows get clipped, as you can see in 
the attached screens, when the camera is high every buildings have a shadow, but when the 
camera gets to a "human" position then the clipping occurs :/ neither the 
models nor the light moved.
I have tried many different shadow technics but it happened for all of them, 
right now i use a osgShadow::MinimalShadowMap, i tried to change the 
minLightMargin with no success. I tried to change some parameters on the light 
or on the camera with no success either :( that's why i come here to ask for 
help!
I added the red line on the screens, to show the "clipping plane" position.
This happens with OSG 2.8.3 and OSG 3.0.1

Thank you!

Cheers,
Cyril

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




Attachments:
http://forum.openscenegraph.org//files/shadow_clippingplane_109.jpg


___
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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-02 Thread Cyril Bondue
Thank you for your answers. I tried all LightSpacePerspective shadow techniques 
with the same result :/
Changing the MinLightMargin didn't solve the problem either. Can it be a 
setting on the light or the camera?
I wanted to write a short program you could try, but i couldn't reproduce the 
problem xD i'm now removing parts from the main program to try to find where 
the problem comes from

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





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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-02 Thread Sergey Polischuk
Hi all

PSM technique with double sided projection transform dont have this problems 
and dont require scene analysis, there are article about it in gpugems 3. It is 
not implemented in osgShadows though. I have osg implementation, but cant share 
source. But if you are up to writing osgShadow psm technique implementation u 
can mail me if you get stuck with some problems, mb i can give some advice.

Cheers,
Sergey.

02.08.2011, 19:26, "Cyril Bondue" :
> Thank you for your answers. I tried all LightSpacePerspective shadow 
> techniques with the same result :/
> Changing the MinLightMargin didn't solve the problem either. Can it be a 
> setting on the light or the camera?
> I wanted to write a short program you could try, but i couldn't reproduce the 
> problem xD i'm now removing parts from the main program to try to find where 
> the problem comes from
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=41796#41796
>
> ___
> 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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-04 Thread Cyril Bondue
I couldn't reproduce my problem because the scene wasn't showing it.
I've attached a zip file containinig the c++ program and the IVE scene. By 
moving the camera up and down you should see the problem!
BTW if you see anything wrong about the code please tell me, thanks. Maybe I 
missed something

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




Attachments: 
http://forum.openscenegraph.org//files/shadow_clippingplane_272.jpg
http://forum.openscenegraph.org//files/testosgshadow_168.zip


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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-09 Thread Cyril Bondue
anyone can try the attached code please? Just to see if the bug comes from my 
compilation (even if i didn't change a think..) my code or something.

Thanks!

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





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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-12 Thread Cyril Bondue
Hi,

Thanks for taking time when you shouldn't to see my problem ! ^^
The osg::Light is used is the default one :


Code:
_light = new osg::Light();
osg::ref_ptr lightSource = new osg::LightSource();
lightSource->setLight(_light);
_sceneRoot->addChild(lightSource);



I only changed it's ambiant value and it's position, to make it follow the car.
I tried to setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR), without 
result. Changing the minLighMargin afterward didn't solve the problem either. I 
tried this on the exemple code i've attached to this post and the simulation, 
same result.

Also, I have the same result with MinimalShadowMap or 
MinimalCullBoundsShadowMap, have you ever seen such problem? I don't thing i've 
done anything special!
That's strange :/

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





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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-12 Thread Robert Osfield
Hi Cyril,

Rather than spend lots of time investigating this issue with the
present osgShadow implementation I would recommend waiting till I have
the new codes checked in.  I haven't competed the work yet but have
early results that show that the light space/shadow volume computation
is far more robust than the old view dependent shadow techniques - I
don't see clipping of the shadow or wild jumps in shadow resolution.
I'm testing the new code on models that pick out the problem areas for
the old techniques, and would suspect that as my new codes address the
problems in these problem areas that there is good chance it'll
address the problems you are seeing as well.

So far I've written a new base class,
osgShadow::ViewDependentShadowMap, that provides a framework for
setting up and rendering view dependent shadow techinques.  This base
class currently implements a minimal bounds shadow map, this base
class will be usable out of the box for doing minimal bounds shadow
mapping, and provide the ability to provide custom light space/shadow
map projections such as perspective/LispSM shadow maps just by
subclassing or callbacks.

Today I'll be writing some provisional shaders for the minimal bounds
shadow map that should give a basic drop in replacement for the
current osgShadow::MinimalBoundsShadowMap implementation.  Through
next week I'll be making the shader codes more powerful and flexible,
and looking at add multiple shadow map techniques and alternative
projections for the light space/shadow maps.

If all goes well in a couple of weeks I'll have replacements for most
of the exist shadow map implementations.

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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-12 Thread Cyril Bondue
Hi Robert

I'll wait for next release so, and I'll test this new code and post the result. 
Feel free to send me some code if you want it to be beta tested :) (or can it 
be tested from the developper svn?)
The situation that makes the bug very visible for me is when moving in a 
tunnel, all the tunnel is shadowed but not the space in front of the camera. 
When moving the camera all the tunnel become shadowed.

Thank you!

Cyril

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





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


Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow clipping plane

2011-08-12 Thread Robert Osfield
Hi Cyril,

On Fri, Aug 12, 2011 at 12:42 PM, Cyril Bondue  wrote:
> I'll wait for next release so, and I'll test this new code and post the 
> result. Feel free to send me some code if you want it to be beta tested :) 
> (or can it be tested from the developper svn?)

I'll be checking the work into svn/trunk, and it'll be part of a 3.1.0
dev releases once I've completed enough of the functionality to wrap
up into a dev release.

> The situation that makes the bug very visible for me is when moving in a 
> tunnel, all the tunnel is shadowed but not the space in front of the camera. 
> When moving the camera all the tunnel become shadowed.

I don't have a test model with a tunnel in it, but I don't expect any
issues in tunnels as the new code makes sure the light space/shadow
volume setup encompasses all objects in the view frustum and all
objects between the view frustum and light source..

You can start testing the shadow map creation using what I have
already checked into OSG svn/trunk - if you run:

  osgviewer --vdsm YourModel

You should see your model rendered with the blank banding from
rendering the shadow map directly onto the scene - this is crude but
will give you an idea of shows that will be generated. I'm just
working on the shader setup that will take the shadowmap and do the
proper shadow rendering, hopefully I'll have something checked in
today.

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