Shadows disappearing

Software: Away3D 4.x

Elringus, Newbie
Posted: 21 September 2012 05:29 PM   Total Posts: 6

Hello,

I’m using NearDirectionalShadowMapper and have a bug (or it’s a feature? ^) ) when shadow disappears if its casting object is not in the camera frustum (or at least I think it’s because of that).

For example in this demo: http://palema.ru/play you can see shadows from the landscape, but if you turn back from the trees or any columns shadows from them will disappear.

So, is there some way to fix that, or any hope that it will be fixed in the near future?

   

Avatar
Baush, Sr. Member
Posted: 22 September 2012 05:45 PM   Total Posts: 135   [ # 1 ]

I have the same problem, it’s probably because when off the camera, those object don’t get rendered for optimisation purpose but then won’t cast shadows.

If you find a solution on this, let me know!

   

Elringus, Newbie
Posted: 23 September 2012 06:53 PM   Total Posts: 6   [ # 2 ]

I looked through relevant shadow classes, but couldn’t really find something that makes shadows to disappear, but one thing in the NearDirectionalShadowMapper class:

_mtx.copyFrom(_light.inverseSceneTransform);
   
_mtx.prepend(viewCamera.sceneTransform);
   
_mtx.transformVectors(viewCamera.lens.frustumCorners_localFrustum);

   
0;
   
12;
   while (
12{
    xN 
_localFrustum[i++];
    
yN _localFrustum[i++];
    
zN _localFrustum[i++];
    
x2 _localFrustum[j++xN;
    
y2 _localFrustum[j++yN;
    
zF _localFrustum[j++];
    
xF xN x2*_coverageRatio;
    
yF yN y2*_coverageRatio;
    if (
xN minXminX xN;
    if (
xN maxXmaxX xN;
    if (
yN minYminY yN;
    if (
yN maxYmaxY yN;
    if (
zN minZminZ zN;
    if (
zN maxZmaxZ zN;
    if (
xF minXminX xF;
    if (
xF maxXmaxX xF;
    if (
yF minYminY yF;
    if (
yF maxYmaxY yF;
    if (
zF minZminZ zF;
    if (
zF maxZmaxZ zF

Tried to do something with this, but no luck so far =/ (Though I’m not too handy with that kind of things)
Could someone please give me a hint how to fix that bug or some thoughts about what classes to look for?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X