shadows method NearShadowMapMethod

Software: Away3D 4.x

Svist, Newbie
Posted: 12 October 2012 11:08 AM   Total Posts: 14

Hi!

I use the shade, method NearShadowMapMethod, everything works fine.
But when I’m drifting from the camera object - the shadows begin to disappear.
Please tell me how to avoid it?

 

   

Avatar
Baks, Newbie
Posted: 12 October 2012 12:28 PM   Total Posts: 22   [ # 1 ]

Yes. I also have same problem. When I move camera then shadows disappear .. (maybe this is due to frustrum clipping). It seems I can’t to receive shadow from object if I don’t see object in camera. Sometimes I have situation: i need to show shadow .. even if no object in camera

How can I improve\fix this bug

Any help! ty

   

Avatar
alihm, Jr. Member
Posted: 12 October 2012 02:24 PM   Total Posts: 49   [ # 2 ]

It’s how NearShadowMapMethod works, either increase the “coverageRatio” to increase the distance when fading starts, or use other shadowmap methods.

light.shadowMapper = new NearDirectionalShadowMapper(coverageRatio);

   

Avatar
Baks, Newbie
Posted: 13 October 2012 07:00 AM   Total Posts: 22   [ # 3 ]

“increase coverageRatio” not helps. It seems that i should to decrease “coverageRatio” but also not helps

Any help!

   

tree, Newbie
Posted: 15 October 2012 03:50 AM   Total Posts: 6   [ # 4 ]

try set camera’s farClip bigger? example 30000

   

Avatar
Baks, Newbie
Posted: 15 October 2012 07:33 AM   Total Posts: 22   [ # 5 ]

I already use very big value _camera.lens.far = 100000;

Who can explain me how to render all objects all time (not just object that I see on screen)? or maybe I can increase rectangle for clipping (engine can’t create shadow if there are no object on screen)

   

Svist, Newbie
Posted: 15 October 2012 07:36 AM   Total Posts: 14   [ # 6 ]

Hi again!
Yes, when we set the value of “coverageRatio” or “far of camera” more - shadows do not disappear, but the quality of the shadows are very bad. How to avoid it? Or how to make blurry shadow?

We have the following: the higher the value “coverageRatio” or “far of camera” - worse quality cast shadow.

The first picture - great value “coverageRatio” and “far of camera”.
The second picture - the values ??are small (“coverageRatio” = 0.1 and “far of camera” = 5000), but if you zoom the camera shadow disappears.

http://postimage.org/image/d2t0fms8t/
http://postimage.org/image/n9gjgjkl3/


Thanks.

   

Avatar
Baks, Newbie
Posted: 15 October 2012 07:37 AM   Total Posts: 22   [ # 7 ]

Hi

“when we set the value of “coverageRatio” or “far of camera” more - shadows do not disappear, but the quality of the shadows are very bad”

yes. I also see this problem

Rob, Fabrice, Richard we need your help smile

   

Avatar
alihm, Jr. Member
Posted: 16 October 2012 09:18 AM   Total Posts: 49   [ # 8 ]

You just need to find the perfect combination of coverageRatio and lens far, It really depends on the game but If your objects are far from the camera, there is no need to draw shadows, you better bake them on texture for more performance.

Just an idea, don’t know if it works but try adjusting coverageRatio dynamically based on the distance of the object to your camera, that way when the object is closer, shadow quality will be higher and when it’s getting away, reduced shadow quality wont be noticeable. something like this:

_nearDirectionalShadowMapper.coverageRatio distanceToCamera/camera.lens.far 0.05

For softer shadows use SoftShadowMapMethod.

Also try smaller epsilon values to close the shadow gap in your second image.

Hope it helps,
Ali

   

Svist, Newbie
Posted: 16 October 2012 11:01 AM   Total Posts: 14   [ # 9 ]

alihm, thanks a lot!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X