Shadow Offset Issue (tried epsilon, scaling up/down,etc)

Software: Away3D 4.x

iansen, Newbie
Posted: 25 April 2014 11:58 AM   Total Posts: 17

Hello,

I’m having some issues with the shadows in my game.
I can’t seem the make the gap/offset between a couple of meshes (loaded via awd models) and the shadow they cast disappear.
I have tried playing around with epsilon,  lightOffset ,camera far, near, etc but I can’t get the shadow to display correctly. I get very close ... about 8 units….but that’s about it.

Here’s what I’m doing:

skyLight   = new DirectionalLight();
skyLight.diffuse 0.85
skyLight.specular 0.12;
skyLight.ambient 0.75;

var 
nds:NearDirectionalShadowMapper = new NearDirectionalShadowMapper(0.04);
skyLight.shadowMapper nds
var 
shm:SoftShadowMapMethod = new SoftShadowMapMethod(skyLight,4,1);
shadowMapMethod = new NearShadowMapMethod(shm1.1);
//this is the value that is close to what I want to get ...but still off by a bit
shadowMapMethod.epsilon =0.6;

scene.addChild(skyLight);
lightPicker = new StaticLightPicker([skyLight ]); 

For lower epsilon values the gap increases. For greater values the gap stays about the same and banding occurs.

The strange thing is that on simpler objects (made up of simple textured planes) the shadow displays as it should. But on the more complex ones ( awd models) I get this small gap.

A solution that would work for me is to make the shadow “think” it’s being cast on a plane that’s just 8-10 units above the actual real one. Is this possible (hard coding and offset for the shadow map/ projection, or just simply scaling it )?

I would really appreciate any advice on this issue. Thanks.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X