Author Topic: question on shadow size  (Read 175 times)

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
question on shadow size
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: question on shadow size
« Reply #1 on: July 17, 2017, 10:02:39 am »
Do you have a screen shot?

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: question on shadow size
« Reply #2 on: July 17, 2017, 02:37:49 pm »
here is a screenshot

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: question on shadow size
« Reply #3 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: question on shadow size
« Reply #4 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.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: question on shadow size
« Reply #5 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: question on shadow size
« Reply #6 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...