www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on July 16, 2017, 08:28:31 am

Title: question on shadow size
Post by: MichaelJPCT on July 16, 2017, 08:28:31 am
i used Shadowhelper to cast an object onto a wall, and noticed that when light is far away, the shadow was smaller than the object. is it normal? shouldn't the shadow be at least as large as the caster?
Title: Re: question on shadow size
Post by: EgonOlsen on July 17, 2017, 10:02:39 am
Do you have a screen shot?
Title: Re: question on shadow size
Post by: MichaelJPCT on July 17, 2017, 02:37:49 pm
here is a screenshot
Title: Re: question on shadow size
Post by: MichaelJPCT on July 17, 2017, 02:46:16 pm
i found that the horizontal size of the shadow is correct, but the vertical size is smaller. the wall is smaller in vertical dimension, so it seems the receiver should be square or the shadow would be deformed. is that so?
Title: Re: question on shadow size
Post by: EgonOlsen on July 17, 2017, 11:25:14 pm
No, it doesn't matter which shape the receiver has. It's just a projection of the depth map onto some polygons. It can't really be 'wrong' and your screenshot looks fine to me. Just make sure that the projector 'looks' into the right direction, or you'll get some kind of back projection onto the receiver which might indeed look wrong.
Title: Re: question on shadow size
Post by: MichaelJPCT on July 18, 2017, 02:43:16 am
i found out i must call both setFOV and setYFOV to have the correct size of shadow.
Title: Re: question on shadow size
Post by: EgonOlsen on July 18, 2017, 08:17:42 pm
Y-fov should actually adjust itself automatically if not set. Maybe this still happens based on actual screen dimensions and not based on the aspect ratio of the depth texture. I'll look into it when I'm back from holiday...and didn't forget about it...