Dropped shadow gap problem

Software: Away3D 4.x

Mike Samuel, Newbie
Posted: 12 July 2012 05:55 AM   Total Posts: 30

Hi all,

I’m running in circles try’n to get ride of the gap between mesh and shadow. (see attached image).

I know there are 2 or 3 posts about this problem already, however, none seems solved.

Suggestions like increase scale, change lens and alike do not really work. Yes, I can make the model huge, but the gap never goes away.

I use the camera / light settings from the 11 examples, but have tried others as well. Also, I notice in the examples, (file Intermediate_MD5Animation), the walking guy has the same offset. The foot hits the floor, but the shadow has a gap .

PS: in my example image, the ground mesh is at y=0, the model as well as the test cube go down to y=-5, so there is no gap between object and ground.
Using the newest code from github (fp11-v4.0.0-beta-70)
I tried all shadow methods, always the same.

I don’t recall this being a problem in 3.6. Am I missing something? Is there a workaround? Can I somehow set the shadow offset?

Regards

 

   

yyovchev, Newbie
Posted: 12 July 2012 04:57 PM   Total Posts: 29   [ # 1 ]

I was stuck on this problem for 2 days and there is no way to create good smooth shadow in big scene. Next week Awa3D 4 gold is going to be released and I hope this problems will be solved. Meanwhile try to adjust epsilon on shadowMapMethod:

filteredShadowMapMethod = new TripleFilteredShadowMapMethod(directLight);
filteredShadowMapMethod.epsilon 0.0045
   

Mike Samuel, Newbie
Posted: 12 July 2012 09:09 PM   Total Posts: 30   [ # 2 ]

Thanx for your suggestion yyovchev,

I tried your epsilon value of 0.0045, kinda doubled the distance. Going down to 0.001 and it gets closer for me. I guess it dep. on other settings as well.

However, if I go even smaller to 0.0001, I start seeing parallel lines all over the place.

There is not much documentation I could find, and since I am no 3D Pro I have to ask, what is this epsilon, what does it do?

Regards

   

yyovchev, Newbie
Posted: 12 July 2012 09:25 PM   Total Posts: 29   [ # 3 ]

These “parallel lines” are problem which occurred in my project too.
You can also try adjust lightOffset of the shadow mapper default is 10000

shadowM = new DirectionalShadowMapper();
   
shadowM.lightOffset 1500

I am close to normal offset of the shadows and no “parallel lines” but never both at same time. You can set camera.lens.far = Number; lower the number more quality shadow.

   

Ivan Moreno, Newbie
Posted: 13 July 2012 04:24 PM   Total Posts: 22   [ # 4 ]

Hello,

Are you going to move the lights in your application? is it necessary to create those shadows inside Away3D? because you have to avoid as maximum the creation of shadows inside the rendering engine in general. If so, are you using the same scale of the meshes without adjusting any scaling value inside the engine? Maybe you just need to bake those shadows and place them as transparent textures in another planes, or play with the offset and epsilon values as yyovchev suggested.

Best.

   

Mike Samuel, Newbie
Posted: 14 July 2012 04:21 AM   Total Posts: 30   [ # 5 ]

Thank you both for taking the time to post.
I’m not @ home till Saturday, I’ll post a full replay as soon as I’m back.

   

Mike Samuel, Newbie
Posted: 16 July 2012 03:12 AM   Total Posts: 30   [ # 6 ]

@yyovchev : I’ve tried your suggestions, but as you already noted .. it’s always a tradeoff. I really hope the gold release will take care of this.

@Ivan: Right now, I do have animated light, but that’s for me to find a certain “sun position”, the final will be static. So no, I do not need to move the light. And I would like to turn shadow of in away3D, it does take up lotsa cycles.

But: The model is interactive, the user can change the material/color of the walls etc. Now let me say again, I am no 3D pro. As far as I understand this backing:
I would do it in Blender, it is backed into the material used within Blender.

So if I switch the material within flash later on, I would need to “back” the shadow into each material. Seems to be a lot of work, and I would loose re-usability of the material. Right now I use the same “wall” material file on all walls. If I back the “shadow” of he front wall into the material, I can’t use it @ the side wall anymore. right?

However: you say “place them as transparent textures in another planes”.
What do you mean. Can I “back” the shadows alone into a transparent png? And then “stack” texture and shadow onto the mesh?

If so, can you provide a simple example on how to do that?

Regards

 

   

yyovchev, Newbie
Posted: 17 July 2012 11:12 AM   Total Posts: 29   [ # 7 ]

Problem solved. Just testing Away3D 4 GOLD and there is new NearShadowMapMethod which is used with new NearDirectionalShadowMapper. Now you can adjust alpha and fadeRatio of the shadow smile

   

Mike Samuel, Newbie
Posted: 17 July 2012 01:37 PM   Total Posts: 30   [ # 8 ]

UHHH, I am downloading now ... can’t wait….thanx for the info

It doesn’t even break anything, except “MouseHitMethod” seems to be gone..

So Ya… now this is more like it, right out of the box the shadow looks ok. Not perfect, but ok, close, as expected ... strangely, if I add the the roof to the model, the shadow the roof casts onto the wall is still offset,  while the shadows the wall/roof casts onto the floor are as expected. hm.

Create Job and many thanx to the Team for the Gold release

Regards

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X